jetbrains.buildServer.serverSide.tracker
Class SubscriptionsCollection

java.lang.Object
  extended by jetbrains.buildServer.serverSide.tracker.SubscriptionsCollection

public class SubscriptionsCollection
extends java.lang.Object

Represents serializable subscriptions collection.


Constructor Summary
SubscriptionsCollection()
          Constructor.
SubscriptionsCollection(java.lang.String serializedSubscription)
          Creates subscriptions collection from the string
 
Method Summary
 java.util.Collection<EventSubscription> getSubscriptions()
          Returns subscriptions collection
 int getTotalNumberOfEvents(EventTracker tracker)
          Returns total number of events corresponding to contained subscriptions
 java.lang.String serialize()
          Serializes this collection of subscriptions to string
 void subscribeOnBuildTypeEvent(TrackerEventType event, java.lang.String buildTypeId)
          Adds subscription on build configuration related event for specified build configuration
 void subscribeOnEvent(TrackerEventType event)
          Adds subscription on an event
 void subscribeOnProjectEvent(TrackerEventType event, java.lang.String projectId)
          Adds subscription on project related event for specified project
 void subscribeOnUserEvent(TrackerEventType event, long userId)
          Adds subscription on user related event for specified user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
seralized 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