Class 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 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 - If true, all children should be enumerated whereas if false 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 - If true, all children should be enumerated whereas if false 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 above getChildApplicationObjectIterators(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 for
        includeBranchedDefinitions - 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 - If true, all children should be enumerated whereas if false then for types that can be branched (BranchedUniqueNamedApplicationObject) only master versions should be included.
        Returns:
        an iterator over the application and all descendants.