boolean oldIsPersistent = oldEntry.isPersistent();
if (callback != null) newEntry = callback.changeEntry(oldEntry);
if (newEntry == null) return oldEntry;
final I_MapEntry newEntryFinal = newEntry;
I_MapEntry retEntry = this.transientStore.change(oldEntry, new I_ChangeCallback() {
public final I_MapEntry changeEntry(I_MapEntry entry)
throws XmlBlasterException {
return newEntryFinal;
}
});
if (oldIsPersistent != retEntry.isPersistent()) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, "Changing of persistence flag of '" + oldEntry.getLogId() + "' to persistent=" + retEntry.isPersistent() + " is not implemented");
// TODO: In case we changed the entry flag from persistent to transient it should be removed from the persistence.
}
if (newEntry.isPersistent()) {
if (this.persistentStore != null && this.isConnected) {
retEntry = this.persistentStore.change(oldEntry, new I_ChangeCallback() {
public final I_MapEntry changeEntry(I_MapEntry entry)
throws XmlBlasterException {
return newEntryFinal;
}
});