records.get(i).getRecord());
DataInputStream dis = new DataInputStream(bis);
GPacket gp = GPacket.getInstance();
gp.read(dis);
if (gp.getType() != records.get(i).getType()) {
throw new BrokerException(Globals.getBrokerResources().getKString(
BrokerResources.X_SHARECC_RECORD_TYPE_CORRUPT,
ProtocolGlobals.getPacketTypeString(gp.getType()),
records.get(i).toString()));
}
if (gp.getType() == ProtocolGlobals.G_RESET_PERSISTENCE) {
String uuid = records.get(i).getUUID();
if (resetUUID != null && !resetUUID.equals(uuid)) {
throw new BrokerException(Globals.getBrokerResources().getKString(
BrokerResources.X_SHARECC_RESET_RECORD_UUID_CORRUPT,
ProtocolGlobals.getPacketTypeString(ProtocolGlobals.G_RESET_PERSISTENCE),
"["+resetUUID+", "+uuid+"]"));
} else if (resetUUID == null) {
resetUUID = uuid;
}
}
if (resetFlag) {
l.add(gp);
} else {
proto.handleGPacket(mbcb, Globals.getMyAddress(), gp);
}
}
if (resetFlag) {
proto.applyPersistentStateChanges(Globals.getMyAddress(), l);
}
if (records.size() > 0) {
ChangeRecordInfo rec = records.get(records.size()-1);
cb.setLastSyncedChangeRecord(rec);
storeLastSeq(rec.getSeq());
if (resetFlag && resetUUID != null) {
rec.setResetUUID(resetUUID);
storeLastResetUUID(resetUUID);
}
}
} catch (Throwable t) {
Globals.getLogger().logStack(Logger.ERROR,
Globals.getBrokerResources().getKString(
BrokerResources.E_FAIL_PROCESS_SHARECC_RECORDS,
t.getMessage()), t);
if (t instanceof BrokerException) throw (BrokerException)t;
throw new BrokerException(t.getMessage(), t);
}
}