@Override public void inCancelEntryLeaseByUID(IReplicationInContext context, String typeName, String uid, boolean isTransient, int routingValue) { if (_isPrimaryBackupSpace && ignoreOperation(isTransient)) return; try { // this entry holder is safe to read from and will not be modified after this method returns IEntryHolder entryHolder = getLeaseManager().cancel(uid, typeName, ObjectTypes.ENTRY, true /* fromRepl */, false /*origin*/, false /* isFromGateway */); if (context.getContentContext() != null) { if (entryHolder != null) { IEntryData entryData = entryHolder.getEntryData(); context.getContentContext().setMainEntryData(entryData); } else if (context.getContextLogger().isLoggable(Level.FINE)) context.getContextLogger().log(Level.FINE, "Cancellation of entry lease did not return an associated entry: Type name:" + typeName + " UID: " + uid); } } catch (UnknownLeaseException ex) { if (getConflictingOperationPolicy().isOverride()) return; if (context.getContextLogger().isLoggable(Level.WARNING)) { context.getContextLogger().log(Level.WARNING, "Replicator: " + ex.getClass().getName() + ". Failed to cancel Entry lease: " + typeName + " UID: " + uid + " ObjectType: " + ObjectTypes.ENTRY + " in target [" + _engine.getFullSpaceName() + "] space." + "\n" + ex.getMessage()); } } }
@Override public void inEntryLeaseExpiredByUID(IReplicationInContext context, String typeName, String uid, boolean isTransient, OperationID operationID) { if (_isPrimaryBackupSpace && ignoreOperation(isTransient)) return; try { // this entry holder is safe to read from and will not be modified after this method returns IEntryHolder entryHolder = getLeaseManager().cancel(uid, typeName, ObjectTypes.ENTRY, true /* fromRepl */, false /*origin*/, true /*leaseExpired*/, operationID, false /* isFromReplication */); if (context.getContentContext() != null) { if (entryHolder != null) { IEntryData entryData = entryHolder.getEntryData(); context.getContentContext().setMainEntryData(entryData); } else if (context.getContextLogger().isLoggable(Level.FINE)) context.getContextLogger().log(Level.FINE, "Expiration of entry lease did not return an associated entry: Type name:" + typeName + " UID: " + uid); } } catch (UnknownLeaseException ex) { if (getConflictingOperationPolicy().isOverride()) return; Level logLevel = getLeaseManager().isSlaveLeaseManagerForEntries() ? Level.FINE : Level.WARNING; if (context.getContextLogger().isLoggable(logLevel)) { context.getContextLogger().log(logLevel, "Replicator: " + ex.getClass().getName() + ". Failed to expire Entry lease: " + typeName + " UID: " + uid + " ObjectType: " + ObjectTypes.ENTRY + " in target [" + _engine.getFullSpaceName() + "] space." + "\n" + ex.getMessage()); } } }