Skip navigation links

Oracle Communications Service Broker
SAL API Reference Reference
Release 6.0

E26227-01


com.convergin.common.sal.ext.api
Interface B2buaHelper


public interface B2buaHelper

Helper class providing support for B2BUA applications. An instance of this class can be retrieved from a SalRequest by invoking the method SalRequest.getB2buaHelper().


Method Summary
 SalRequest createCancel(SalSession _session)
          Creates a new CANCEL request to cancel the initial request sent on the other leg.
 SalRequest createRequest(SalRequest _origRequest)
          Creates a new request object belonging to a new SalSession.
 SalRequest createRequest(SalRequest _origRequest, boolean _linked, java.util.Map<java.lang.String,java.util.List<java.lang.String>> _headerMap)
          Creates a new request object belonging to a new SalSession.
 SalRequest createRequest(SalSession _session, SalRequest _origRequest, java.util.Map<java.lang.String,java.util.List<java.lang.String>> _headerMap)
          Creates a new subsequent request based on the specified original request.
 SalResponse createResponseToOriginalRequest(SalSession _session, int _status, java.lang.String _reasonPhrase)
          The request that results in creation of a SalSession is termed as the original request, a response to this original request can be created by the application even if the request was committed and application does not have a reference to this Request.
 SalRequest getLinkedSalRequest(SalRequest _req)
          If a new request is created based on an existing one with the link argument true using createRequest(SalRequest, boolean, java.util.Map) or using createRequest(SalSession, SalRequest, java.util.Map) the new request gets implicitly linked with the original request.
 SalSession getLinkedSession(SalSession _session)
          Returns the other SalSession that is linked to the specified SalSession, or null if none.
 java.util.List<SalMessage> getPendingMessages(SalSession _session, UAMode _mode)
           
 void linkSalSessions(SalSession _session1, SalSession _session2)
          Links the specified sessions, such that there is a 1-1 mapping between them.
 void unlinkSalSessions(SalSession _session)
          If the specified SalSession is linked to another session, then unlinks the two sessions from each other.

 

Method Detail

getLinkedSession

SalSession getLinkedSession(SalSession _session)
Returns the other SalSession that is linked to the specified SalSession, or null if none. The sessions get linked by either explicit call to linkSalSessions(SalSession, SalSession) or createRequest(SalServletRequest, boolean, java.util.Map)
Parameters:
_session - the SalSession from which to obtain the linked session
Returns:
the linked SalSession, or null if none

getLinkedSalRequest

SalRequest getLinkedSalRequest(SalRequest _req)
If a new request is created based on an existing one with the link argument true using createRequest(SalRequest, boolean, java.util.Map) or using createRequest(SalSession, SalRequest, java.util.Map) the new request gets implicitly linked with the original request. This method is to be used to retrieve the linked request. There is no explicit linking/unlinking like that of the session for requests. However unlinking of sessions also result in unlinking of linked requests.
Parameters:
_req - other request
Returns:
the linked request

linkSalSessions

void linkSalSessions(SalSession _session1,
                     SalSession _session2)
Links the specified sessions, such that there is a 1-1 mapping between them. Each session can retrieved from the other by calling getLinkedSession(SalSession). One SalSession at any given time can be linked to only one other SalSession belonging to the same SalApplicationSession. Calling linkSessions() with already linked sessions to each other is a no-op and is to be silently ignored, while calling linkSessions() with any of the session linked with other sessions result in java.lang.IllegalArgumentException
Parameters:
_session1 - the first SalSession to link
_session2 - the other SalSession to link

unlinkSalSessions

void unlinkSalSessions(SalSession _session)
If the specified SalSession is linked to another session, then unlinks the two sessions from each other. This also implicitly unlinks the linkage at the request level.
Parameters:
_session - the session to be unlinked

createResponseToOriginalRequest

SalResponse createResponseToOriginalRequest(SalSession _session,
                                            int _status,
                                            java.lang.String _reasonPhrase)
The request that results in creation of a SalSession is termed as the original request, a response to this original request can be created by the application even if the request was committed and application does not have a reference to this Request. This is required because the B2BUA application may require to send more than one successful response to a request. For example when a downstream proxy forked and more than one success responses are to be forwarded upstream. This can only be required on initial requests, as only original requests shall need such multiple responses.

The response thus generated must have a different To tag from the other responses generated to the Request and must result in a different SalSession. In this (and similar) cases the container clones the original SalSession for the second and subsequentdialogs, as detailed above. The cloned session object will contain the same application data but its createRequest method will create requests belonging to that second or subsequent dialog, that is, with a To tag specific to that dialog.

Parameters:
_session - the SalSession for the original request
_status - the status code for the response
_reasonPhrase - the reason phrase for the response, or null to use a default reason phrase
Returns:
the resulting SalResponse

createRequest

SalRequest createRequest(SalRequest _origRequest,
                         boolean _linked,
                         java.util.Map<java.lang.String,java.util.List<java.lang.String>> _headerMap)
Creates a new request object belonging to a new SalSession. The new request is similar to the specified origRequest in that the method and the majority of header fields are copied from origRequest to the new request. The headerMap parameter can contain From, To, Contact, Route headers and any non system header. The header field map is then used to override the headers in the newly created request. The SalSession created for the new request also shares the same SalApplicationSession associated with the original request.
Parameters:
_origRequest - request to be "copied"
_linked - indicating if the resulting session should be linked with original or not
_headerMap - a simple map containing header names and their values to be overridden in the new request. The values can be a specified in a java.util.List to accomodate for multi-valued headers
Returns:
the "copied" request object

createRequest

SalRequest createRequest(SalRequest _origRequest)
Creates a new request object belonging to a new SalSession. The new request is similar to the specified origRequest in that the method and the majority of header fields are copied from origRequest to the new request. The SalSession created for the new request also shares the same SalApplicationSession associated with the original request.
Parameters:
_origRequest - request to be "copied"
Returns:
the "copied" request object

createRequest

SalRequest createRequest(SalSession _session,
                         SalRequest _origRequest,
                         java.util.Map<java.lang.String,java.util.List<java.lang.String>> _headerMap)
Creates a new subsequent request based on the specified original request. This results in automatically linking the two SalSessions (if they are not already linked) and the two SalRequests.
Parameters:
_session - the session on which this request is to be created
_origRequest - the original request
_headerMap - the header map used to override the headers in the new subsequent request created. Also see createRequest(SalRequest, boolean, Map);
Returns:
the new subsequent request

createCancel

SalRequest createCancel(SalSession _session)
Creates a new CANCEL request to cancel the initial request sent on the other leg. The CANCEL is created by the container using the initial request stored in the session corresponding to the other leg.
Parameters:
_session - the session whose initial request is to be cancelled.
Returns:
the new CANCEL request to be sent on the other leg

getPendingMessages

java.util.List<SalMessage> getPendingMessages(SalSession _session,
                                              UAMode _mode)

Skip navigation links

Oracle Communications Service Broker
SAL API Reference Reference
Release 6.0

E26227-01


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.