/** * Prepare the given model of an external child resource for inline removal (along with the definition or update of parent resource). * * @param model the model representing child resource to remove */ protected final void prepareInlineRemove(FluentModelTImpl model) { FluentModelTImpl childResource = find(model.childResourceKey()); if (childResource != null) { throw new IllegalArgumentException(pendingOperationMessage(model.name(), model.childResourceKey())); } model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeRemoved); this.childCollection.put(model.childResourceKey(), model); super.prepareForFutureCommitOrPostRun(model); }
/** * Prepare the given model of an external child resource for inline update (along with the definition or update of parent resource). * * @param model the model to track update changes * @return the external child resource prepared for update */ protected final FluentModelTImpl prepareInlineUpdate(FluentModelTImpl model) { FluentModelTImpl childResource = find(model.childResourceKey()); if (childResource != null) { throw new IllegalArgumentException(pendingOperationMessage(model.name(), model.childResourceKey())); } model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeUpdated); this.childCollection.put(model.childResourceKey(), model); return super.prepareForFutureCommitOrPostRun(model); }
/** * Prepare the given model of an external child resource for inline create (along with the definition or update of parent resource). * * @param model the model to track create changes * @return the external child resource prepared for create */ protected final FluentModelTImpl prepareInlineDefine(FluentModelTImpl model) { FluentModelTImpl childResource = find(model.childResourceKey()); if (childResource != null) { throw new IllegalArgumentException(pendingOperationMessage(model.name(), model.childResourceKey())); } model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); this.childCollection.put(model.childResourceKey(), model); return super.prepareForFutureCommitOrPostRun(model); }