Package com.redwood.scheduler.api.model
Class ChildApplicationObjectIterator
- java.lang.Object
-
- com.redwood.scheduler.infrastructure.collections.IteratorConcatenator<ApplicationObject>
-
- com.redwood.scheduler.api.model.ChildApplicationObjectIterator
-
- All Implemented Interfaces:
Iterator<ApplicationObject>
public class ChildApplicationObjectIterator extends com.redwood.scheduler.infrastructure.collections.IteratorConcatenator<ApplicationObject>
Small helper class for retrieving all ApplicationObject instances that belong to a particular application.
-
-
Constructor Summary
Constructors Constructor Description ChildApplicationObjectIterator(Application application, boolean includeBranchedDefinitions)
Construct an iterator over the child objects of an application.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Iterator<ApplicationObject>
getApplicationAndDescendents(Application application, boolean includeBranchedDefinitions)
Return an iterator over this application and all descendants in the application hierarchy.static Iterator<ApplicationObject>[]
getChildApplicationObjectIterators(Application application, boolean includeBranchedDefinitions)
Retrieve an array of iterators for the child objects of an application.static Iterator<ApplicationObject>
getChildrenOfTypeApplicationObjectIterator(Application application, boolean includeBranchedDefinitions)
Get all ApplicationObject-children of an application by getting all child properties for the various child/ApplicationObject types.-
Methods inherited from class com.redwood.scheduler.infrastructure.collections.IteratorConcatenator
hasNext, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
ChildApplicationObjectIterator
public ChildApplicationObjectIterator(Application application, boolean includeBranchedDefinitions)
Construct an iterator over the child objects of an application.- Parameters:
application
- the application whose children should be enumerated.includeBranchedDefinitions
- Iftrue
, all children should be enumerated whereas iffalse
then for types that can be branched (BranchedUniqueNamedApplicationObject
) only master versions should be included.
-
-
Method Detail
-
getChildApplicationObjectIterators
public static Iterator<ApplicationObject>[] getChildApplicationObjectIterators(Application application, boolean includeBranchedDefinitions)
Retrieve an array of iterators for the child objects of an application. Each element in the returned array is an iterator over a different type of child objects. WARNING: despite the typing, the iterators returned here are not actually all of type ApplicationObject. In fact, QueryFilter and AuditRule are not.- Parameters:
application
- the application whose children should be enumerated.includeBranchedDefinitions
- Iftrue
, all children should be enumerated whereas iffalse
then for types that can be branched (BranchedUniqueNamedApplicationObject
) only master versions should be included.- Returns:
- an array of iterators that enumerate the application's children.
-
getChildrenOfTypeApplicationObjectIterator
public static Iterator<ApplicationObject> getChildrenOfTypeApplicationObjectIterator(Application application, boolean includeBranchedDefinitions)
Get all ApplicationObject-children of an application by getting all child properties for the various child/ApplicationObject types. NOTE: this is different from the abovegetChildApplicationObjectIterators(com.redwood.scheduler.api.model.Application, boolean)
in the following way. It only includes children of type ApplicationObject. Despite its name getChildApplicationObjectIterators also includes child QueryFilters and child AuditRules, which do have parentApplication properties but are not ApplicationObjects.- Parameters:
application
- application to get the ApplicationObject-children forincludeBranchedDefinitions
- should we include branched definitions when getting JobDefinition children- Returns:
- iterator over all ApplicationObject-children of the application
-
getApplicationAndDescendents
public static Iterator<ApplicationObject> getApplicationAndDescendents(Application application, boolean includeBranchedDefinitions)
Return an iterator over this application and all descendants in the application hierarchy.- Parameters:
application
- the application whose children should be enumerated.includeBranchedDefinitions
- Iftrue
, all children should be enumerated whereas iffalse
then for types that can be branched (BranchedUniqueNamedApplicationObject
) only master versions should be included.- Returns:
- an iterator over the application and all descendants.
-
-