Search in sources :

Example 61 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class MapMessageImpl method checkMap.

private void checkMap() {
    if (map == null)
        map = new MessageProperties();
    if (mapBytes != null) {
        try {
            DataByteArrayInputStream dis = new DataByteArrayInputStream(mapBytes);
            map.readContent(dis);
            mapBytes = null;
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Also used : IOException(java.io.IOException) DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 62 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class AuthResponseRequest method readContent.

/**
 * Read the content of this object from the stream.
 *
 * @param in input stream
 * @throws IOException if an error occurs
 */
public void readContent(DataInput in) throws IOException {
    super.readContent(in);
    byte set = in.readByte();
    if (set == 0) {
        response = null;
    } else {
        try {
            byte[] b = new byte[in.readInt()];
            in.readFully(b);
            response = (Serializable) (new ObjectInputStream(new DataByteArrayInputStream(b))).readObject();
        } catch (ClassNotFoundException ignored) {
        }
    }
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 63 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class GetAuthChallengeReply method readContent.

/**
 * Read the content of this object from the stream.
 *
 * @param in input stream
 * @throws IOException if an error occurs
 */
public void readContent(DataInput in) throws IOException {
    super.readContent(in);
    byte set = in.readByte();
    if (set == 0) {
        challenge = null;
    } else {
        try {
            byte[] b = new byte[in.readInt()];
            in.readFully(b);
            challenge = (Serializable) (new ObjectInputStream(new DataByteArrayInputStream(b))).readObject();
        } catch (ClassNotFoundException ignored) {
        }
    }
    set = in.readByte();
    if (set == 0) {
        challengeResponseFactoryClass = null;
    } else {
        challengeResponseFactoryClass = in.readUTF();
    }
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 64 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class ConnectReply method readContent.

public void readContent(DataInput in) throws IOException {
    super.readContent(in);
    routerName = in.readUTF();
    authRequired = in.readBoolean();
    if (authRequired) {
        crFactory = in.readUTF();
        byte[] b = new byte[in.readInt()];
        in.readFully(b);
        DataByteArrayInputStream dbis = new DataByteArrayInputStream(b);
        ObjectInputStream ois = new ObjectInputStream(dbis);
        try {
            challenge = (Serializable) ois.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(e.toString());
        }
        ois.close();
    }
    leaseTimeout = in.readLong();
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Example 65 with DataByteArrayInputStream

use of com.swiftmq.tools.util.DataByteArrayInputStream in project swiftmq-client by iitsoftware.

the class AuthRequest method readContent.

public void readContent(DataInput input) throws IOException {
    super.readContent(input);
    byte[] b = new byte[input.readInt()];
    input.readFully(b);
    DataByteArrayInputStream dbis = new DataByteArrayInputStream(b);
    ObjectInputStream ois = new ObjectInputStream(dbis);
    try {
        response = (Serializable) ois.readObject();
    } catch (ClassNotFoundException e) {
        throw new IOException(e.toString());
    }
    ois.close();
}
Also used : DataByteArrayInputStream(com.swiftmq.tools.util.DataByteArrayInputStream)

Aggregations

DataByteArrayInputStream (com.swiftmq.tools.util.DataByteArrayInputStream)68 InvalidSelectorException (javax.jms.InvalidSelectorException)22 ResourceLimitException (com.swiftmq.swiftlet.auth.ResourceLimitException)21 QueuePushTransaction (com.swiftmq.swiftlet.queue.QueuePushTransaction)21 RingBuffer (com.swiftmq.tools.collection.RingBuffer)21 JMSException (javax.jms.JMSException)21 MessageImpl (com.swiftmq.jms.MessageImpl)20 EntityList (com.swiftmq.mgmt.EntityList)15 List (java.util.List)15 InvalidDestinationException (javax.jms.InvalidDestinationException)14 TopicImpl (com.swiftmq.jms.TopicImpl)8 QueueImpl (com.swiftmq.jms.QueueImpl)7 DataByteArrayOutputStream (com.swiftmq.tools.util.DataByteArrayOutputStream)7 IOException (java.io.IOException)7 com.swiftmq.jms (com.swiftmq.jms)2 AddressString (com.swiftmq.amqp.v100.generated.messaging.message_format.AddressString)1 MessageFormat (com.swiftmq.amqp.v100.generated.transport.definitions.MessageFormat)1 CountableBufferedInputStream (com.swiftmq.impl.net.netty.CountableBufferedInputStream)1 CountableWrappedOutputStream (com.swiftmq.impl.net.netty.CountableWrappedOutputStream)1 BytesMessageImpl (com.swiftmq.jms.BytesMessageImpl)1