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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations