Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api.context
Interface ReferPolicy

All Superinterfaces:
ContextElement

public interface ReferPolicy
extends ContextElement

ReferPolicy interface is used by application to get the detailed information for CommunicationEvent.Type.REFER event and do the authorization by implement method annotated with this event in CommunicationBean, application can also set the correct refer-by value in this method.

The usage as following:

 @CommunicationEvent(type = CommunicationEvent.Type.REFER)
 void handleRefer() {
   ReferPolicy referPolicy = ctx.getContextElement(ReferPolicy.class);
   String sender = referPolicy.getSender();
   String recipient = referPolicy.getRecipient();
   String referredBy = referPolicy.getReferredBy();
   String referTo = referPolicy.getReferTo();
   String referToMethod = referPolicy.getReferToMethod();
   
   // application can set correctly referred-by header in this event.
   if (referredBy == null) {
     IdentityInformation identityInfo =
         ctx.getContextElement(IdentityInformation.class);
     if (identityInfo != null) {
       String pAssertedIdentity = identityInfo.getAssertedIdentity();
       referPolicy.setReferredBy(pAssertedIdentity);
     }
   }

   // an example of authorization
   if (sender.equals("conf1@example.com")) {
     referPolicy.reject(Reason.DECLINE);
   }
 } 
 
See Also:
ReferPolicy

Method Summary
 String getEarlyFlag()
          Return the early-flag value.
 String getRecipient()
          Returns the recipient name.
 String getReferredBy()
          Returns the value of Referred-By header.
 String getReferTo()
          Returns the refer to user name.
 String getReferToMethod()
          Returns the method parameter in Refer-To header.
 String getSender()
          Returns the sender name.
 boolean referToIncludeReplaces()
          If the Refer-To header includes Replaces parameter, invoke this method will returns true, otherwise returns false.
 void reject()
          Reject the participant that referring to SFT.
 void reject(Reason reason)
          Reject the participant that referring to SFT.
 void setReferredBy(String name)
          Set the Referred-By header with the specified value.

 

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

 

Method Detail

getSender

String getSender()
Returns the sender name.
Returns:
the sender name.

getRecipient

String getRecipient()
Returns the recipient name.
Returns:
the recipient name.

getReferTo

String getReferTo()
Returns the refer to user name.
Returns:
the refer to user name.

getReferToMethod

String getReferToMethod()
Returns the method parameter in Refer-To header.
Returns:
the method name.

getReferredBy

String getReferredBy()
Returns the value of Referred-By header.
Returns:
the string value of Referred-By header.

setReferredBy

void setReferredBy(String name)
Set the Referred-By header with the specified value. When handing the REFER event, application can get the Referred-By value use getReferredBy() method, if the value is not valid, application can use this method to set a correct value.

referToIncludeReplaces

boolean referToIncludeReplaces()
If the Refer-To header includes Replaces parameter, invoke this method will returns true, otherwise returns false.
Returns:
true or false.

getEarlyFlag

String getEarlyFlag()
Return the early-flag value.
Returns:
String the value of early-flag parameter.

reject

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

reject

void reject(Reason reason)
Reject the participant that referring to SFT.
Parameters:
reason - Reason for rejecting the participant.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.