Class SubscriptionContentProvider

java.lang.Object
com.webmethods.caf.faces.data.pubsub.SubscriptionContentProvider
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PubSubContentProvider

public abstract class SubscriptionContentProvider extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • SubscriptionContentProvider

      public SubscriptionContentProvider()
  • Method Details

    • getPrincipalID

      protected abstract String getPrincipalID()
      Get the principal Id which to subscribe or unsubscribe.

      Used by methods subscribe(), unsubscribe(), isSubscribed(), and getSubscriptionObjectID()
      Returns:
      A principal Id.
    • getPrincipalType

      protected abstract String getPrincipalType()
      Get the principal type for the current principal Id.

      Used by methods subscribe(), unsubscribe(), {@link #isSubscribed()()}, and getSubscriptionObjectID()



      Principal type can be PRINCIPAL_TYPE_USER, PRINCIPAL_TYPE_ROLE, or PRINCIPAL_TYPE_GROUP. Default value is PRINCIPAL_TYPE_USER.
      Returns:
      The principal type for the current principal Id.
    • subscribe

      public String subscribe() throws ContentProviderException
      Subscribes current principal to the source identified by the current subscription Id.
      Returns:
      The id of the subscription.
      Throws:
      ContentProviderException
    • unsubscribe

      public void unsubscribe() throws ContentProviderException
      Unsubscribes the current principal from the source identified by the current subscription Id.
      Throws:
      ContentProviderException
    • isSubscribed

      public boolean isSubscribed() throws ContentProviderException
      Determines if current principal is already subscribed to the current subscription Id.
      Returns:
      True if user is subscribed. Otherwise false.
      Throws:
      ContentProviderException
    • getSubscriptionObjectID

      public String getSubscriptionObjectID() throws ContentProviderException
      Get the the subscription object Id for the current subscription Id. The current principal must be subscribed to this Id to get a valid Id.
      Returns:
      The user subscription object Id.
      Throws:
      ContentProviderException
    • getSubscribers

      public IPrincipalProvider[] getSubscribers() throws ContentProviderException
      Get an array of principal Ids for the current subscription Id.
      Returns:
      An array IPrincipalProvider IDs, currently subscribed to this resource
      Throws:
      ContentProviderException
    • getSubscriptionID

      public String getSubscriptionID()
      Get the current subscription Id for this content provider.
      Returns:
      The source Id.
    • setSubscriptionID

      public void setSubscriptionID(String id)
      Set the current subscription Id for this content provider.
      Parameters:
      id - The source Id.
    • getSubscriptionName

      public String getSubscriptionName()
      Get the current subscription name for this content provider.
      Returns:
      The current subscription name.
    • setSubscriptionName

      public void setSubscriptionName(String name)
      Set the current subscription name for this content provider.
      Parameters:
      name - The current subscription name.