/** * Mark that there is no action pending on this child resource and clear * any cached result, i.e. the output produced by the invocation of last * action. */ public void clear() { this.setPendingOperation(PendingOperation.None); this.childAction.clear(); }
@SuppressWarnings("unchecked") @Override public Observable<FluentModelT> createResourceAsync() { if (this.creatableParentResourceKey != null) { FluentParentModelT parentResource = this.<FluentParentModelT>taskResult(this.creatableParentResourceKey); withExistingParentResource(parentResource); } return this.createChildResourceAsync(); }
/** * Add a creatable dependency for this model. * * @param creatable the creatable dependency. * @return the key to be used as parameter to taskResult(string) method to retrieve created dependency */ @SuppressWarnings("unchecked") protected String addDependency(Creatable<? extends Indexable> creatable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; return this.addDependency(dependency); }
/** * Add an appliable "post-run" dependent for this model. * * @param appliable the appliable "post-run" dependent. * @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent */ @SuppressWarnings("unchecked") protected String addPostRunDependent(Appliable<? extends Indexable> appliable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; return this.addPostRunDependent(dependency); }
/** * Prepare this external child resource for update. * * @return this external child resource prepared for update */ @SuppressWarnings("unchecked") protected final FluentModelT prepareUpdate() { this.setPendingOperation(PendingOperation.ToBeCreated); return (FluentModelT) this; }
/** * @return the key of this child resource in the collection maintained by ExternalChildResourceCollectionImpl */ public String childResourceKey() { return name(); }
/** * Creates an instance of external child resource in-memory. * * @param name the name of this external child resource * @param parent reference to the parent of this external child resource * @param innerObject reference to the inner object representing this external child resource */ protected ExternalChildResourceImpl(String name, ParentImplT parent, InnerModelT innerObject) { super(innerObject, parent); this.childAction = new ExternalChildActionTaskItem(this); this.name = name; }
@SuppressWarnings("unchecked") @Override public FluentModelImplT withNewParentResource(Creatable<FluentParentModelT> parentResourceCreatable) { if (this.creatableParentResourceKey == null) { this.creatableParentResourceKey = this.addDependency(parentResourceCreatable); } return (FluentModelImplT) this; }
@Override public FluentModelT call(InnerModelT innerModelT) { self.setInner(innerModelT); return (FluentModelT) self; } });
/** * @return the task group associated with this external child resource. */ @Override public TaskGroup taskGroup() { return this.childAction.taskGroup(); }
/** * @return <tt>true</tt> if currently in define..create mode */ @Override public boolean isInCreateMode() { return this.id() == null; }
protected <InnerT> List<InnerT> innersFromWrappers(Collection<? extends HasInner<InnerT>> wrappers) { return innersFromWrappers(wrappers, null); }
/** * Specifies the region for the resource. * @param region The location for the resource * @return the next stage of the definition */ public final FluentModelImplT withRegion(Region region) { return this.withRegion(region.toString()); }
/** * Add an executable dependency for this model. * * @param executable the executable dependency * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing * the executable dependency */ @SuppressWarnings("unchecked") protected String addDependency(Executable<? extends Indexable> executable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; return this.addDependency(dependency); }
/** * Add a creatable "post-run" dependent for this model. * * @param creatable the creatable "post-run" dependent. * @return the key to be used as parameter to taskResult(string) method to retrieve created "post-run" dependent */ @SuppressWarnings("unchecked") protected String addPostRunDependent(Creatable<? extends Indexable> creatable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) creatable; return this.addPostRunDependent(dependency); }
/** * Prepare the given model of an external child resource for independent definition (without the parent context). * * @param model the model to prepare for independent create definition * @return the external child resource prepared for create */ protected final FluentModelTImpl prepareIndependentDefine(FluentModelTImpl model) { model.setPendingOperation(ExternalChildResourceImpl.PendingOperation.ToBeCreated); return model; }
/** * Adds an external child resource to the childCollection. * * @param childResource the external child resource */ protected void addChildResource(FluentModelTImpl childResource) { this.addChildResource(childResource.name(), childResource); }
/** * Creates an instance of external child resource in-memory. * * @param key the task group key for the task item that perform actions on this child * @param name the name of this external child resource * @param parent reference to the parent of this external child resource * @param innerObject reference to the inner object representing this external child resource */ protected ExternalChildResourceImpl(String key, String name, ParentImplT parent, InnerModelT innerObject) { super(innerObject, parent); this.childAction = new ExternalChildActionTaskItem(key, this); this.name = name; }
/** * Add an appliable dependency for this model. * * @param appliable the appliable dependency. * @return the key to be used as parameter to taskResult(string) method to retrieve updated dependency */ @SuppressWarnings("unchecked") protected String addeDependency(Appliable<? extends Indexable> appliable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; return this.addDependency(dependency); }
/** * Add an executable "post-run" dependent for this model. * * @param executable the executable "post-run" dependent * @return the key to be used as parameter to taskResult(string) method to retrieve result of executing * the executable "post-run" dependent */ @SuppressWarnings("unchecked") protected void addPostRunDependent(Executable<? extends Indexable> executable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable; this.addPostRunDependent(dependency); }