Search in sources :

Example 26 with GPacket

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

the class ChangeRecord method makeResetRecord.

public static ChangeRecordInfo makeResetRecord(boolean withUUID) {
    if (DEBUG) {
        Globals.getLogger().log(Logger.INFO, "ChangeRecord.makeResetRecord(" + withUUID + ")");
    }
    ChangeRecordInfo cri = new ChangeRecordInfo();
    GPacket gp = GPacket.getInstance();
    gp.setType(ProtocolGlobals.G_RESET_PERSISTENCE);
    if (withUUID) {
        String uuid = UUID.randomUUID().toString();
        gp.putProp(ChangeRecord.UUID_PROPERTY, uuid);
        cri.setUUID(uuid);
    }
    cri.setTimestamp(System.currentTimeMillis());
    ChangeRecord cr = ChangeRecord.makeChangeRecord(gp);
    cri.setUKey(cr.getUniqueKey());
    try {
        cri.setRecord(cr.getBytes());
    } catch (Exception e) {
        Globals.getLogger().log(Logger.ERROR, "Unexpected exception in makeResetRecord(" + withUUID + "):" + e.toString());
    }
    return cri;
}
Also used : ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) GPacket(com.sun.messaging.jmq.io.GPacket) BrokerException(com.sun.messaging.jmq.jmsserver.util.BrokerException)

Example 27 with GPacket

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

the class ChangeRecord method recordUnsubscribe.

public static void recordUnsubscribe(Subscription sub, ChangeRecordCallback cb) throws BrokerException {
    ClusterSubscriptionInfo csi = ClusterSubscriptionInfo.newInstance(sub);
    GPacket gp = csi.getGPacket(ProtocolGlobals.G_REM_DURABLE_INTEREST, true);
    ChangeRecordInfo cri = storeChangeRecord(gp, cb);
    sub.setCurrentChangeRecordInfo(ProtocolGlobals.G_REM_DURABLE_INTEREST, cri);
}
Also used : ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) GPacket(com.sun.messaging.jmq.io.GPacket) ClusterSubscriptionInfo(com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterSubscriptionInfo)

Example 28 with GPacket

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

the class ChangeRecord method recordRemoveDestination.

public static void recordRemoveDestination(Destination d, ChangeRecordCallback cb) throws BrokerException {
    ClusterDestInfo cdi = ClusterDestInfo.newInstance(d);
    GPacket gp = cdi.getGPacket(ProtocolGlobals.G_REM_DESTINATION, true);
    ChangeRecordInfo cri = storeChangeRecord(gp, cb);
    d.setCurrentChangeRecordInfo(ProtocolGlobals.G_UPDATE_DESTINATION, cri);
}
Also used : ClusterDestInfo(com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterDestInfo) ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) GPacket(com.sun.messaging.jmq.io.GPacket)

Example 29 with GPacket

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

the class ChangeRecord method storeResetRecordIfNecessary.

public static void storeResetRecordIfNecessary(ChangeRecordCallback cb) throws BrokerException {
    GPacket gp = GPacket.getInstance();
    gp.setType(ProtocolGlobals.G_RESET_PERSISTENCE);
    storeChangeRecord(gp, cb);
}
Also used : GPacket(com.sun.messaging.jmq.io.GPacket)

Example 30 with GPacket

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

the class ChangeRecord method recordUpdateDestination.

public static synchronized void recordUpdateDestination(Destination d, ChangeRecordCallback cb) throws BrokerException {
    ClusterDestInfo cdi = ClusterDestInfo.newInstance(d);
    GPacket gp = cdi.getGPacket(ProtocolGlobals.G_UPDATE_DESTINATION, true);
    ChangeRecordInfo cri = storeChangeRecord(gp, cb);
    d.setCurrentChangeRecordInfo(ProtocolGlobals.G_UPDATE_DESTINATION, cri);
}
Also used : ClusterDestInfo(com.sun.messaging.jmq.jmsserver.multibroker.raptor.ClusterDestInfo) ChangeRecordInfo(com.sun.messaging.jmq.jmsserver.persist.api.ChangeRecordInfo) 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