Package com.jms.client.entity

Examples of com.jms.client.entity.Message


     * @param id the id
     * @throws Exception
     */
    public void destroy(long id) throws Exception {
        Collections.sort(messages);
        int foundIndex = Collections.binarySearch(messages, new Message(id));
        Validate.isTrue((foundIndex >= 0), "Entity not found");

        messages.remove(foundIndex);
    }
View Full Code Here


     * @param clientId the client id
     * @throws Exception
     */
    public void destroyAll(String clientId) throws Exception {
        for (Iterator<Message> it = messages.iterator(); it.hasNext();) {
            Message message = it.next();
            if (message.getClientId().equals(clientId)) {
                it.remove();
            }
        }
    }
View Full Code Here

     * @param id the id
     * @return message
     */
    public Message findEntity(long id) {
        Collections.sort(messages);
        int foundIndex = Collections.binarySearch(messages, new Message(id));

        if (foundIndex < 0) {
            return null;
        }

        Message found = messages.get(foundIndex);

        return found;
    }
View Full Code Here

    public void handleChange(AjaxBehaviorEvent event) {
        addMessage("handleChange called", UiLogLevel.DEBUG);
    }

    public void onRowSelect(SelectEvent event) {
        Message selected = ((Message) event.getObject());

        addMessage("onRowSelect called. Selected: " + selected, UiLogLevel.DEBUG);
    }
View Full Code Here

     * Reinit Send Message dialog with empty one
     *
     * @return page to redirect/forward
     */
    public String reinitSendMessage() {
        messageToSend = new Message(Message.Status.SEND);
        messageToSend.setClientId(connection.getClient().getClientId());
        reinitMapMessage();
        reinitMessageHeaders();
        reinitMessageProperties();

View Full Code Here

     *
     * @param message the message
     * @throws Exception
     */
    private void addMessageToTable(javax.jms.Message message) throws Exception {
        Message targetMessage = MessageConverterHelper.convert(message);
        targetMessage.setClientId(connection.getClient().getClientId());
        messageController.create(targetMessage);
    }
View Full Code Here

    }

    @Test
    public void testCreate() throws Exception {
        LOGGER.info("create");
        Message entity = FakeStaticMessageFactory.createMessage();
        entity = jpaController.create(entity);
        assertTrue("Entity not created properly", (entity.getId() > 0L));
    }
View Full Code Here

    }

    @Test
    public void testEditSimpleMessageBody() throws Exception {
        LOGGER.info("edit simple body");
        Message entity = FakeStaticMessageFactory.createMessage();
        entity = jpaController.create(entity);
        assertTrue("Entity not created properly", (entity.getId() > 0L));

        final String ASSERT_BODY = "FIXED BODY VALUE";

        entity.setSimpleBody(ASSERT_BODY);
        entity = jpaController.edit(entity);
        assertEquals("Entity not edited properly", ASSERT_BODY, entity.getSimpleBody());
    }
View Full Code Here

    }

    @Test
    public void testEditMapMessageBody() throws Exception {
        LOGGER.info("edit map body");
        Message entity = FakeStaticMessageFactory.createMapMessage();
        entity = jpaController.create(entity);
        assertTrue("Entity not created properly", (entity.getId() > 0L));

        final String ASSERT_KEY = "BODY";
        final String ASSERT_BODY = "FIXED BODY VALUE";
        final Property ASSERT_MAP_ITEM = new Property(ASSERT_KEY, ASSERT_BODY, Type.STRING);

        entity.getMapBodyItems().add(ASSERT_MAP_ITEM);
        entity = jpaController.edit(entity);

        int indexOfMapItem = entity.getMapBodyItems().indexOf(ASSERT_MAP_ITEM);
        assertTrue("Entity not found in the collection", (indexOfMapItem > -1));
        Property foundMapItem = entity.getMapBodyItems().get(indexOfMapItem);
        assertEquals("Entity not edited properly", ASSERT_MAP_ITEM, foundMapItem);
    }
View Full Code Here

    }

    @Test
    public void testDestroy() throws Exception {
        LOGGER.info("destroy");
        Message entity = FakeStaticMessageFactory.createMessage();
        entity = jpaController.create(entity);
        assertTrue("Entity not created properly", (entity.getId() > 0L));

        final long ASSERT_REMOVED_ENTITY_ID = entity.getId();

        jpaController.destroy(ASSERT_REMOVED_ENTITY_ID);
        Message foundEntity = jpaController.findEntity(ASSERT_REMOVED_ENTITY_ID);
        assertNull("Entity not removed properly", foundEntity);
    }
View Full Code Here

TOP

Related Classes of com.jms.client.entity.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.