Search in sources :

Example 1 with TextMessageImpl

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

the class FileQueryPropsReply method toMessage.

public Message toMessage() throws JMSException {
    TextMessage message = new TextMessageImpl();
    message.setIntProperty(ProtocolFactory.DUMPID_PROP, ProtocolFactory.FILEQUERYPROPS_REP);
    if (result != null && result.size() > 0) {
        XStream xStream = new XStream(new Dom4JDriver());
        StringWriter writer = new StringWriter();
        xStream.toXML(result, writer);
        message.setText(writer.toString());
    }
    return fillMessage(message);
}
Also used : StringWriter(java.io.StringWriter) XStream(com.thoughtworks.xstream.XStream) Dom4JDriver(com.thoughtworks.xstream.io.xml.Dom4JDriver) TextMessageImpl(com.swiftmq.jms.TextMessageImpl) TextMessage(javax.jms.TextMessage)

Example 2 with TextMessageImpl

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

the class FileQueryRequest method toMessage.

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

Example 3 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 4 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 5 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)

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