Package jabber.client

Examples of jabber.client.Message


                    }
                });

                scheduledThreadPoolExecutor.submit(task);

                Message message = createXmppMessage(to, messageDispatch);
                if (message != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Sending message to XMPP client from: " + message.getFrom() + " to: " + message.getTo() + " type: " + message.getType() + " with body: " + message.getAny());
                    }
                    transport.marshall(message);
                }
            }
        });
View Full Code Here


    protected Message createXmppMessage(String to, MessageDispatch messageDispatch) throws IOException, JMSException {
       
        org.apache.activemq.command.Message message = messageDispatch.getMessage();

        Message answer = new Message();
        String from = (String)message.getProperty("XMPPFrom");
        if ( from == null ) {
            from = to;
            int idx = from.indexOf('/');
            if (idx > 0) {
                from = from.substring(0, idx) + "/broker";
            }
            answer.setType("groupchat");
        } else {
            answer.setType("chat");
        }
        LOG.debug("Sending message from " + from + " and to " + to);
        answer.setFrom(from);
        answer.setTo(to);

        // answer.setType(message.getType());
        if (message instanceof ActiveMQTextMessage) {
            ActiveMQTextMessage activeMQTextMessage = (ActiveMQTextMessage)message;
            Body body = new Body();
            String text = activeMQTextMessage.getText();
            LOG.info("Setting the body text to be: " + text);
            body.setValue(text);
            answer.getAny().add(body);
        } else {
            // TODO support other message types
            LOG.warn("Could not convert the message to a complete Jabber message: " + message);
        }
        return answer;
View Full Code Here

                // lets send back an ACK
                MessageAck ack = new MessageAck(messageDispatch, MessageAck.STANDARD_ACK_TYPE, 1);
                sendToActiveMQ(ack, createErrorHandler("Ack of message: " + messageDispatch.getMessage().getMessageId()));

                Message message = createXmppMessage(to, messageDispatch);
                if (message != null) {
                    if (log.isDebugEnabled()) {
                        log.debug("Sending message to XMPP client from: " + message.getFrom() + " to: " + message.getTo() " type: " + message.getType() + " with body: " + message.getAny());
                    }
                    transport.marshall(message);
                }
            }
        });
View Full Code Here

        });
        sendToActiveMQ(consumerInfo, createErrorHandler("subscribe to destination: " + destination));
    }

    protected Message createXmppMessage(String to, MessageDispatch messageDispatch) throws JMSException {
        Message answer = new Message();
        answer.setType("groupchat");
        String from = to;
        int idx= from.indexOf('/');
        if (idx > 0) {
            from = from.substring(0, idx) + "/broker";
        }
        answer.setFrom(from);
        answer.setTo(to);

        org.apache.activemq.command.Message message = messageDispatch.getMessage();
        //answer.setType(message.getType());
        if (message instanceof ActiveMQTextMessage) {
            ActiveMQTextMessage activeMQTextMessage = (ActiveMQTextMessage) message;
            Body body = new Body();
            body.setValue(activeMQTextMessage.getText());
            answer.getAny().add(body);
        }
        else {
            // TODO support other message types
        }
        return answer;
View Full Code Here

                    }
                });

                scheduledThreadPoolExecutor.submit(task);

                Message message = createXmppMessage(to, messageDispatch);
                if (message != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Sending message to XMPP client from: " + message.getFrom() + " to: " + message.getTo() + " type: " + message.getType() + " with body: " + message.getAny());
                    }
                    transport.marshall(message);
                }
            }
        });
View Full Code Here

    protected Message createXmppMessage(String to, MessageDispatch messageDispatch) throws IOException, JMSException {
       
        org.apache.activemq.command.Message message = messageDispatch.getMessage();

        Message answer = new Message();
        String from = (String)message.getProperty("XMPPFrom");
        if ( from == null ) {
            from = to;
            int idx = from.indexOf('/');
            if (idx > 0) {
                from = from.substring(0, idx) + "/broker";
            }
            answer.setType("groupchat");
        } else {
            answer.setType("chat");
        }
        LOG.debug("Sending message from " + from + " and to " + to);
        answer.setFrom(from);
        answer.setTo(to);

        // answer.setType(message.getType());
        if (message instanceof ActiveMQTextMessage) {
            ActiveMQTextMessage activeMQTextMessage = (ActiveMQTextMessage)message;
            Body body = new Body();
            String text = activeMQTextMessage.getText();
            LOG.info("Setting the body text to be: " + text);
            body.setValue(text);
            answer.getAny().add(body);
        } else {
            // TODO support other message types
            LOG.warn("Could not convert the message to a complete Jabber message: " + message);
        }
        return answer;
View Full Code Here

                // lets send back an ACK
                MessageAck ack = new MessageAck(messageDispatch, MessageAck.STANDARD_ACK_TYPE, 1);
                sendToActiveMQ(ack, createErrorHandler("Ack of message: " + messageDispatch.getMessage().getMessageId()));

                Message message = createXmppMessage(to, messageDispatch);
                if (message != null) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Sending message to XMPP client from: " + message.getFrom() + " to: " + message.getTo() + " type: " + message.getType() + " with body: " + message.getAny());
                    }
                    transport.marshall(message);
                }
            }
        });
View Full Code Here

        });
        sendToActiveMQ(consumerInfo, createErrorHandler("subscribe to destination: " + destination));
    }

    protected Message createXmppMessage(String to, MessageDispatch messageDispatch) throws JMSException {
        Message answer = new Message();
        answer.setType("groupchat");
        String from = to;
        int idx = from.indexOf('/');
        if (idx > 0) {
            from = from.substring(0, idx) + "/broker";
        }
        answer.setFrom(from);
        answer.setTo(to);

        org.apache.activemq.command.Message message = messageDispatch.getMessage();
        // answer.setType(message.getType());
        if (message instanceof ActiveMQTextMessage) {
            ActiveMQTextMessage activeMQTextMessage = (ActiveMQTextMessage)message;
            Body body = new Body();
            String text = activeMQTextMessage.getText();
            LOG.info("Setting the body text to be: " + text);
            body.setValue(text);
            answer.getAny().add(body);
        } else {
            // TODO support other message types
            LOG.warn("Could not convert the message to a complete Jabber message: " + message);
        }
        return answer;
View Full Code Here

TOP

Related Classes of jabber.client.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.