Search in sources :

Example 1 with DataStructure

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.

the class ConsumerControlMarshaller method tightMarshal2.

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataByteArrayOutputStream dataOut, BooleanStream bs) throws IOException {
    super.tightMarshal2(wireFormat, o, dataOut, bs);
    ConsumerControl info = (ConsumerControl) o;
    bs.readBoolean();
    tightMarshalNestedObject2(wireFormat, (DataStructure) info.getConsumerId(), dataOut, bs);
    dataOut.writeInt(info.getPrefetch());
}
Also used : ConsumerControl(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerControl)

Example 2 with DataStructure

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.

the class ConsumerControlMarshaller method tightMarshal1.

/**
 * Write the booleans that this object uses to a BooleanStream
 */
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
    ConsumerControl info = (ConsumerControl) o;
    int rc = super.tightMarshal1(wireFormat, o, bs);
    bs.writeBoolean(info.isClose());
    rc += tightMarshalNestedObject1(wireFormat, (DataStructure) info.getConsumerId(), bs);
    return rc + 4;
}
Also used : ConsumerControl(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerControl) DataStructure(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure)

Example 3 with DataStructure

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.

the class ConsumerInfoMarshaller method tightMarshal1.

/**
 * Write the booleans that this object uses to a BooleanStream
 */
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
    ConsumerInfo info = (ConsumerInfo) o;
    int rc = super.tightMarshal1(wireFormat, o, bs);
    rc += tightMarshalCachedObject1(wireFormat, (DataStructure) info.getConsumerId(), bs);
    bs.writeBoolean(info.isBrowser());
    rc += tightMarshalCachedObject1(wireFormat, (DataStructure) info.getDestination(), bs);
    bs.writeBoolean(info.isDispatchAsync());
    rc += tightMarshalString1(info.getSelector(), bs);
    rc += tightMarshalString1(info.getSubscriptionName(), bs);
    bs.writeBoolean(info.isNoLocal());
    bs.writeBoolean(info.isExclusive());
    bs.writeBoolean(info.isRetroactive());
    rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
    rc += tightMarshalNestedObject1(wireFormat, (DataStructure) info.getAdditionalPredicate(), bs);
    bs.writeBoolean(info.isNetworkSubscription());
    bs.writeBoolean(info.isOptimizedAcknowledge());
    bs.writeBoolean(info.isNoRangeAcks());
    return rc + 9;
}
Also used : ConsumerInfo(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerInfo) DataStructure(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure)

Example 4 with DataStructure

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.

the class DataArrayResponseMarshaller method looseUnmarshal.

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn) throws IOException {
    super.looseUnmarshal(wireFormat, o, dataIn);
    DataArrayResponse info = (DataArrayResponse) o;
    if (dataIn.readBoolean()) {
        short size = dataIn.readShort();
        DataStructure[] value = new DataStructure[size];
        for (int i = 0; i < size; i++) {
            value[i] = (DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn);
        }
        info.setData(value);
    } else {
        info.setData(null);
    }
}
Also used : DataStructure(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure) DataArrayResponse(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataArrayResponse)

Example 5 with DataStructure

use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.

the class DataArrayResponseMarshaller method tightUnmarshal.

/**
 * Un-marshal an object instance from the data input stream
 *
 * @param o the object to un-marshal
 * @param dataIn the data input stream to build the object from
 * @throws IOException
 */
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataByteArrayInputStream dataIn, BooleanStream bs) throws IOException {
    super.tightUnmarshal(wireFormat, o, dataIn, bs);
    DataArrayResponse info = (DataArrayResponse) o;
    if (bs.readBoolean()) {
        short size = dataIn.readShort();
        DataStructure[] value = new DataStructure[size];
        for (int i = 0; i < size; i++) {
            value[i] = (DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs);
        }
        info.setData(value);
    } else {
        info.setData(null);
    }
}
Also used : DataStructure(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure) DataArrayResponse(io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataArrayResponse)

Aggregations

DataStructure (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure)30 IOException (java.io.IOException)7 Message (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message)6 DataResponse (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataResponse)5 RemoveInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.RemoveInfo)5 BrokerInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.BrokerInfo)3 ConnectionError (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConnectionError)3 ConnectionInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConnectionInfo)3 ConsumerControl (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerControl)3 ConsumerInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ConsumerInfo)3 DestinationInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DestinationInfo)3 LocalTransactionId (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.LocalTransactionId)3 MessageAck (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.MessageAck)3 MessageDispatch (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.MessageDispatch)3 MessageDispatchNotification (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.MessageDispatchNotification)3 MessageId (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.MessageId)3 NetworkBridgeFilter (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.NetworkBridgeFilter)3 ProducerInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.ProducerInfo)3 RemoveSubscriptionInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.RemoveSubscriptionInfo)3 SessionInfo (io.fabric8.gateway.handlers.detecting.protocol.openwire.command.SessionInfo)3