Search in sources :

Example 11 with TextMessageImpl

use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.

the class SessionCloseRequest method toMessage.

public Message toMessage() throws JMSException {
    TextMessage message = new TextMessageImpl();
    fillMessage(message);
    message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.SESSIONCLOSE_REQ);
    return message;
}
Also used : TextMessageImpl(com.swiftmq.jms.TextMessageImpl) TextMessage(javax.jms.TextMessage)

Example 12 with TextMessageImpl

use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.

the class FileChunkReply method toMessage.

public Message toMessage() throws JMSException {
    TextMessage message = new TextMessageImpl();
    message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.FILECHUNK_REP);
    message.setIntProperty(CHUNKNO_PROP, chunkNo);
    if (link != null)
        message.setText(link);
    return fillMessage(message);
}
Also used : TextMessageImpl(com.swiftmq.jms.TextMessageImpl) TextMessage(javax.jms.TextMessage)

Example 13 with TextMessageImpl

use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.

the class FileConsumeRequest method toMessage.

public Message toMessage() throws JMSException {
    TextMessage message = new TextMessageImpl();
    fillMessage(message);
    message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.FILECONSUME_REQ);
    message.setStringProperty(QUEUENAME_PROP, queueName);
    message.setIntProperty(REPLYINTERVAL_PROP, replyInterval);
    if (passwordHexDigest != null)
        message.setStringProperty(PWDHEXDIGEST_PROP, passwordHexDigest);
    message.setText(link);
    return message;
}
Also used : TextMessageImpl(com.swiftmq.jms.TextMessageImpl) TextMessage(javax.jms.TextMessage)

Example 14 with TextMessageImpl

use of com.swiftmq.jms.TextMessageImpl in project swiftmq-client by iitsoftware.

the class FileDeleteRequest method toMessage.

public Message toMessage() throws JMSException {
    TextMessage message = new TextMessageImpl();
    fillMessage(message);
    message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.FILEDELETE_REQ);
    if (passwordHexDigest != null)
        message.setStringProperty(PWDHEXDIGEST_PROP, passwordHexDigest);
    message.setText(link);
    return message;
}
Also used : TextMessageImpl(com.swiftmq.jms.TextMessageImpl) TextMessage(javax.jms.TextMessage)

Example 15 with TextMessageImpl

use of com.swiftmq.jms.TextMessageImpl in project swiftmq-ce by iitsoftware.

the class SessionStore method load.

public synchronized Map<String, MQTTSession> load() throws Exception {
    Map<String, MQTTSession> result = new HashMap<String, MQTTSession>();
    QueueReceiver receiver = ctx.queueManager.createQueueReceiver(STORE_QUEUE, null, null);
    QueuePullTransaction t = receiver.createTransaction(false);
    MessageEntry entry = null;
    while ((entry = t.getMessage(0)) != null) {
        TextMessageImpl msg = (TextMessageImpl) entry.getMessage();
        String clientId = msg.getStringProperty(PROP_CLIENTID);
        result.put(clientId, new MQTTSession(ctx, clientId, (SessionStoreEntry) xStream.fromXML(msg.getText())));
    }
    t.rollback();
    receiver.close();
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.mqttSwiftlet.getName(), toString() + ", load, result.size=" + result.size());
    return result;
}
Also used : HashMap(java.util.HashMap) TextMessageImpl(com.swiftmq.jms.TextMessageImpl)

Aggregations

TextMessageImpl (com.swiftmq.jms.TextMessageImpl)18 TextMessage (javax.jms.TextMessage)12 ContentHeaderProperties (com.swiftmq.amqp.v091.types.ContentHeaderProperties)2 BytesMessageImpl (com.swiftmq.jms.BytesMessageImpl)2 MessageImpl (com.swiftmq.jms.MessageImpl)2 QueueImpl (com.swiftmq.jms.QueueImpl)2 HashMap (java.util.HashMap)2 JMSException (javax.jms.JMSException)2 Field (com.swiftmq.amqp.v091.types.Field)1 Delivery (com.swiftmq.impl.amqp.amqp.v00_09_01.Delivery)1 XStream (com.thoughtworks.xstream.XStream)1 Dom4JDriver (com.thoughtworks.xstream.io.xml.Dom4JDriver)1 StringWriter (java.io.StringWriter)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Enumeration (java.util.Enumeration)1 Destination (javax.jms.Destination)1