Class SCMHeadObserver.AllFinished

java.lang.Object
jenkins.scm.api.SCMHeadObserver
jenkins.scm.api.SCMHeadObserver.AllFinished
Enclosing class:
SCMHeadObserver

public static class SCMHeadObserver.AllFinished extends SCMHeadObserver
An observer that wraps multiple observers and keeps observing as long as one of the wrapped observers wants to.
  • Constructor Details

    • AllFinished

      public AllFinished(SCMHeadObserver... observers)
      Constructor.
      Parameters:
      observers - the observers to wrap.
    • AllFinished

      public AllFinished(@NonNull Iterable<SCMHeadObserver> observers)
      Constructor.
      Parameters:
      observers - the observers to wrap.
  • Method Details

    • observe

      public void observe(@NonNull SCMHead head, @NonNull SCMRevision revision) throws IOException, InterruptedException
      Observes a head and current revision.
      Specified by:
      observe in class SCMHeadObserver
      Parameters:
      head - the head.
      revision - the revision.
      Throws:
      IOException - if processing of the observation could not be completed due to an IOException.
      InterruptedException - if processing of the observation was interrupted
    • isObserving

      public boolean isObserving()
      Returns information about whether the observer wants more results.
      Overrides:
      isObserving in class SCMHeadObserver
      Returns:
      true if the observer is still observing or false to signal that it is ok to stop early.
    • getIncludes

      public Set<SCMHead> getIncludes()
      Returns the subset of SCMHead instances that this observer is interested in or null if interested in all SCMHead instances.

      Implementations should not assume that the SCMHeadObserver.getIncludes() will be honoured. This method is designed to provide a hint to SCMSource implementations.

      Overrides:
      getIncludes in class SCMHeadObserver
      Returns:
      the subset of SCMHead instances that this observer is interested in or null.