Class SubscriptionsCollection


  • public class SubscriptionsCollection
    extends java.lang.Object
    Represents serializable subscriptions collection.
    • Constructor Detail

      • SubscriptionsCollection

        public SubscriptionsCollection()
        Constructor.
      • SubscriptionsCollection

        public SubscriptionsCollection​(@NotNull
                                       java.lang.String serializedSubscription)
                                throws java.lang.IllegalArgumentException
        Creates subscriptions collection from the string
        Parameters:
        serializedSubscription - serialized collection of subscriptions
        Throws:
        java.lang.IllegalArgumentException - if deserialization failed
    • Method Detail

      • subscribeOnProjectEvent

        public void subscribeOnProjectEvent​(@NotNull
                                            TrackerEventType event,
                                            @NotNull
                                            java.lang.String projectId)
        Adds subscription on project related event for specified project
        Parameters:
        event - event
        projectId - project id
      • subscribeOnBuildTypeEvent

        public void subscribeOnBuildTypeEvent​(@NotNull
                                              TrackerEventType event,
                                              @NotNull
                                              java.lang.String buildTypeId)
        Adds subscription on build configuration related event for specified build configuration
        Parameters:
        event - event
        buildTypeId - build configuration id
      • subscribeOnUserEvent

        public void subscribeOnUserEvent​(@NotNull
                                         TrackerEventType event,
                                         long userId)
        Adds subscription on user related event for specified user
        Parameters:
        event - event
        userId - id of the user
      • subscribeOnEvent

        public void subscribeOnEvent​(@NotNull
                                     TrackerEventType event)
        Adds subscription on an event
        Parameters:
        event - event
      • serialize

        public java.lang.String serialize()
        Serializes this collection of subscriptions to string
        Returns:
        serialized collection of subscriptions
      • getSubscriptions

        public java.util.Collection<EventSubscription> getSubscriptions()
        Returns subscriptions collection
        Returns:
        subscriptions collection
      • getTotalNumberOfEvents

        public int getTotalNumberOfEvents​(@NotNull
                                          EventTracker tracker)
        Returns total number of events corresponding to contained subscriptions
        Parameters:
        tracker - event tracker
        Returns:
        total number of events