if (changeRecord) {
gp.putProp("N", subscription.getDurableName());
gp.putProp("I", subscription.getClientID());
gp.putProp("M", Boolean.valueOf(true));
} else {
ChangeRecordInfo cri = subscription.getCurrentChangeRecordInfo(
ProtocolGlobals.G_NEW_INTEREST);
if (cri != null) {
gp.putProp("shareccSeq"+1, cri.getSeq());
gp.putProp("shareccUUID"+1, cri.getUUID());
gp.putProp("shareccResetUUID"+1, cri.getResetUUID());
}
}
break;
case ProtocolGlobals.G_DURABLE_ATTACH:
{
assert ( consumer != null );
gp = GPacket.getInstance();
gp.setType(protocol);
String dname = subscription.getDurableName();
if (dname != null) {
gp.putProp("N", new String(dname));
}
String clientID = subscription.getClientID();
gp.putProp("I", new String(clientID));
gp.putProp(String.valueOf(consumer.getConsumerUID().longValue())+":"+
Consumer.PREFETCH, new Integer(consumer.getPrefetch()));
gp.putProp("allowsNonDurable", new Boolean(true));
c.marshalBrokerAddress(c.getSelfAddress(), gp);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
ClusterConsumerInfo.writeConsumer(consumer, dos);
dos.flush();
bos.flush();
}
catch (IOException e) { /* Ignore */ }
gp.setPayload(ByteBuffer.wrap(bos.toByteArray()));
}
break;
case ProtocolGlobals.G_REM_DURABLE_INTEREST:
{
gp = GPacket.getInstance();
gp.setType(protocol);
gp.putProp("C", new Integer(1));
String dname = subscription.getDurableName();
String clientID = subscription.getClientID();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
dos.writeUTF(dname);
dos.writeUTF(clientID);
dos.flush();
bos.flush();
}
catch (IOException e) { /* Ignore */ }
gp.setPayload(ByteBuffer.wrap(bos.toByteArray()));
if (changeRecord) {
gp.putProp("N", new String(dname));
gp.putProp("I", new String(clientID));
gp.putProp("M", new Boolean(true));
} else {
ChangeRecordInfo cri = subscription.getCurrentChangeRecordInfo(
ProtocolGlobals.G_REM_DURABLE_INTEREST);
if (cri != null) {
gp.putProp("shareccSeq"+1, cri.getSeq());
gp.putProp("shareccUUID"+1, cri.getUUID());
gp.putProp("shareccResetUUID"+1, cri.getResetUUID());
}
}
}
break;