Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Interface CommunicationContext<C extends Communication,P extends Participant,M extends Message>

Type Parameters:
C - Communication object in this CommunicationContext.
P - Participant object in this CommunicationContext.
M - Message object in this CommunicationContext.
All Superinterfaces:
Cloneable

public interface CommunicationContext<C extends Communication,P extends Participant,M extends Message>
extends Cloneable

Represents the context of a given Communication event. The SFT application can get the current active Communication and corresponding message using the CommunicationContext object.


Method Summary
 Object clone()
          Return a cloned, thread-safe copy of the CommunicationContext object.
<E extends ContextElement>
Map<Class<E>,E>
getAllContextElements()
          Get a map of Context Elements and their type.
 C getCommunication()
          Return the communication associated with the context.
<E extends ContextElement>
E
getContextElement(Class<E> elementClass)
          Generic method to retrieve context elements.
 M getMessage()
          Gets the current Message from the ongoing communication.
 P getParticipant()
          Return the current participant.
 Principal getUserPrincipal()
          Returns a java.security.Principal object containing the name of the current authenticated user.
 boolean isUserInRole(String role)
          Returns a boolean indicating whether the authenticated user is included in the specified logical "role".

 

Method Detail

getCommunication

C getCommunication()
Return the communication associated with the context.
Returns:
communication

getParticipant

P getParticipant()
Return the current participant.
Returns:
participant

getMessage

M getMessage()
Gets the current Message from the ongoing communication. Returns null if there is no such communication ongoing.
Returns:
Message
See Also:
Message

clone

Object clone()
Return a cloned, thread-safe copy of the CommunicationContext object.

Note that the getClass() of the communication context may not equal to the getClass of its clone. So, application is advised to not depend on that behavior.

Returns:
a copy of the CommunicationContext.

getUserPrincipal

Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user.
Returns:
a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated

isUserInRole

boolean isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.
Parameters:
role - a String specifying the name of the role
Returns:
a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated

getContextElement

<E extends ContextElement> E getContextElement(Class<E> elementClass)
Generic method to retrieve context elements. There can be many context elements associated with an event. For example, to retrieve the HistoryInformation from a Conversation an application would do the following. HistoryInformation hi = context.getContextElement(ContextElement.class);
Type Parameters:
E - A class that extends ContextElement
Parameters:
elementClass - Class of the context element to be returned.
Returns:
An instance of ContextElement or null, if the ContextElement does not exist.

getAllContextElements

<E extends ContextElement> Map<Class<E>,E> getAllContextElements()
Get a map of Context Elements and their type.
Type Parameters:
E - A class that extends ContextElement
Returns:
A map of context element type and ContextElements.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.