com.ibm.twss.common.siputils.pheader
Class PAssertedIdentity

java.lang.Object
  extended by com.ibm.twss.common.siputils.pheader.PAssertedIdentity

public class PAssertedIdentity
extends java.lang.Object

Utilty to add P-Asserted-Identity headers. These headers allow IMS signaling elements to assert the identity of the use on behalf of which a SIP message is created. This code follows RFC 3325. The PAssertedIdentity utility methods are used to query the security information and insert it appropriate into the headers of a request when forwarding the request to another system. Note the code to do this is something like this:

final String pAssertedValue = PAssertedIdentity.findPAssertedIdentityValue(requesterID); try { Address pAssertedAddress = PAssertedIdentity.setPAssertedIdentityHeader( requesterID,, request, sipFactory); } catch (Exception e) { trace("Error occurred asserting a header for " + pAssertedValue); }

Version:
1.4

Field Summary
static java.lang.String HEADER
          The SIP header string for a P-Asserted-Identity header
 
Method Summary
static java.lang.String findPAssertedIdentityValue(java.lang.String requesterId)
          Find the String-representation of the identity that should be asserted.
static java.lang.String findPAssertedIdentityValue(java.lang.String requesterId, java.lang.String assumedUriPrefix)
          Find the String-representation of the identity that should be asserted.
static javax.servlet.sip.Address setPAssertedIdentityHeader(java.lang.String requesterId, javax.servlet.sip.SipServletRequest request, javax.servlet.sip.SipFactory sipFactory)
          Add the P-Asserted-Identity header to requests based on the requesterId provided by the ServiceImplContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER

public static final java.lang.String HEADER
The SIP header string for a P-Asserted-Identity header

See Also:
Constant Field Values
Method Detail

findPAssertedIdentityValue

public static java.lang.String findPAssertedIdentityValue(java.lang.String requesterId)
Find the String-representation of the identity that should be asserted. Does some "intelligent" translation from non-SIP/SIPS/TEL URIs into SIP URIs.

Parameters:
requesterId - to use to calculate the the requester ID. Should be null, whitespace-only, or a case variation of "UNAUTHENTICATED" to indicate no requester identity available. Leading and trailing whitespace is ignored.
a - String representation of the P-Asserted-Identity value, or null if such a header isn't appropriate for the request.

findPAssertedIdentityValue

public static java.lang.String findPAssertedIdentityValue(java.lang.String requesterId,
                                                          java.lang.String assumedUriPrefix)
Find the String-representation of the identity that should be asserted. Does some "intelligent" translation from non-SIP/SIPS/TEL URIs into SIP URIs.

Parameters:
requesterId - to use to calculate the the requester ID. Should be null, whitespace-only, or a case variation of "UNAUTHENTICATED" to indicate no requester identity available. Leading and trailing whitespace is ignored.
a - String representation of the P-Asserted-Identity value, or null if such a header isn't appropriate for the request.
assumedUriPrefix - Some Services may have user defined scheme's this parameter scheme is preappened to the RequesterID Some common schemes: "sip:" , "group:"

setPAssertedIdentityHeader

public static javax.servlet.sip.Address setPAssertedIdentityHeader(java.lang.String requesterId,
                                                                   javax.servlet.sip.SipServletRequest request,
                                                                   javax.servlet.sip.SipFactory sipFactory)
                                                            throws java.lang.NullPointerException,
                                                                   UnsupportedPAssertedIdentitySchemeException,
                                                                   PAssertedIdentityParsingException
Add the P-Asserted-Identity header to requests based on the requesterId provided by the ServiceImplContext. Attempts to intelligently determine the conversion between the requester ID and a value allowed in a P-Asserted-Identity header per RFC 3325. This method will remove any existing P-Asserted-Identity header if no identity is provided in the requesterId. Requester ID should be null, whitespace-only, or a case variation of "UNAUTHENTICATED" to indicate no requester identity is available. Though RFC 3325 allows multiple PAssertedID-values in a single header, this method will at most provide a single value.

Parameters:
requesterId - to use to calculate the the requester ID. Leading and trailing whitespace is ignored.
request - in which to set the P-Asserted-Identity header if possible.
sipFactory - to use to construct relevant URIs.
Returns:
The address set in the request's P-Asserted-Identity header, or null if no identity could be determined from the requesterId.
Throws:
java.lang.NullPointerException - if request or sipFactory is null.
UnsupportedPAssertedIdentitySchemeException - if requesterId contains a URI from a scheme other than SIP, SIPS, or TEL. Any existing header will have been removed prior to this exception.
PAssertedIdentityParsingException - if the requesterId to PAssertedID-value conversion goes awry. Any existing header will have been removed prior to this exception.


Copyright © 2003 IBM Corp. All Rights Reserved.