Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api.context
Interface SubscriptionPolicy

All Superinterfaces:
ContextElement

public interface SubscriptionPolicy
extends ContextElement

SubscriptionPolicy interface is used by application to get the detailed information for CommunicationEvent.Type.SUBSCRIPTION event and do the authorization by implement method annotated with this event in CommunicationBean.

The usage as following:

 @CommunicationEvent(type = CommunicationEvent.Type.SUBSCRIPTION)
 void handleSubscription() {
   SubscriptionPolicy subsPolicy = ctx.getContextElement(SubscriptionPolicy.class);
   String resourceId = subsPolicy.getResourceId();
   String subscriber = subsPolicy.getSubscriber();

   // An example of authorization, 
   // forbid alice's subscription to resource conf1@example.com.
   if (subscriber.equals("alice@example.com")) {
     if (resourceId.equals("conf1@example.com")) {
       subsPolicy.reject();
     }
   }
 }
 
See Also:
SubscriptionPolicy

Method Summary
 EventPackageName getEventName()
          Return the Event name.
 String getResourceId()
          Returns the resource id that the subscriber subscribe to.
 String getSubscriber()
          Get the subscriber name.
 void reject()
          Reject the participant that referring to SFT.

 

Methods inherited from interface com.oracle.sft.api.ContextElement
isUpdatable

 

Method Detail

getSubscriber

String getSubscriber()
Get the subscriber name.
Returns:
the name of the user that send the subscribe request.

getResourceId

String getResourceId()
Returns the resource id that the subscriber subscribe to.
Returns:
the resource id.

getEventName

EventPackageName getEventName()
Return the Event name.
Returns:
the Event name.

reject

void reject()
Reject the participant that referring to SFT.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.