Search in sources :

Example 51 with GPacket

use of com.sun.messaging.jmq.io.GPacket in project openmq by eclipse-ee4j.

the class ClusterTxnInfoInfo method getGPacket.

public GPacket getGPacket() throws IOException {
    GPacket gp = GPacket.getInstance();
    gp.setType(ProtocolGlobals.G_TRANSACTION_INFO);
    gp.putProp("transactionID", transactionID);
    gp.putProp("transactionState", Integer.valueOf(transactionState));
    if (owner) {
        gp.putProp("owner", Boolean.TRUE);
        c.marshalBrokerAddress(c.getSelfAddress(), gp);
    }
    if (msgStoreSession != null) {
        gp.putProp("messageStoreSession", Long.valueOf(msgStoreSession.longValue()));
    }
    if (brokers != null) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < brokers.length; i++) {
            if (i > 0) {
                buf.append(',');
            }
            buf.append(brokers[i].toProtocolString());
        }
        gp.putProp("brokers", buf.toString());
    }
    if (waitfor != null) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < waitfor.length; i++) {
            if (i > 0) {
                buf.append(',');
            }
            buf.append(waitfor[i].toProtocolString());
        }
        gp.putProp("waitfor", buf.toString());
    }
    if (txnHome != null) {
        gp.putProp("transactionHome", txnHome.toProtocolString());
    }
    if (xid != null) {
        gp.putProp("X", xid);
    }
    gp.setBit(gp.A_BIT, false);
    return gp;
}
Also used : GPacket(com.sun.messaging.jmq.io.GPacket)

Aggregations

GPacket (com.sun.messaging.jmq.io.GPacket)51 ChangeRecordInfo (com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo)9 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)8 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 SysMessageID (com.sun.messaging.jmq.io.SysMessageID)2 ClusterManager (com.sun.messaging.jmq.jmsserver.cluster.api.ClusterManager)2 ClusterDestInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterDestInfo)2 ClusterSubscriptionInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterSubscriptionInfo)2 ClusterTransferFileEndInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterTransferFileEndInfo)2 ClusterTransferFileListInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterTransferFileListInfo)2 ClusterTransferFileStartInfo (com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterTransferFileStartInfo)2 LoadException (com.sun.messaging.jmq.jmsserver.persist.api.LoadException)2 LoopbackAddressException (com.sun.messaging.jmq.jmsserver.util.LoopbackAddressException)2 ArrayList (java.util.ArrayList)2 Packet (com.sun.messaging.jmq.io.Packet)1 HAClusteredBroker (com.sun.messaging.jmq.jmsserver.cluster.api.ha.HAClusteredBroker)1 BrokerAddress (com.sun.messaging.jmq.jmsserver.core.BrokerAddress)1 Consumer (com.sun.messaging.jmq.jmsserver.core.Consumer)1 ConsumerUID (com.sun.messaging.jmq.jmsserver.core.ConsumerUID)1 Subscription (com.sun.messaging.jmq.jmsserver.core.Subscription)1