NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.header
Class HeaderFactoryImpl

java.lang.Object
  extended by gov.nist.javax.sip.header.HeaderFactoryImpl
All Implemented Interfaces:
HeaderFactoryExt, HeaderFactory

public class HeaderFactoryImpl
extends Object
implements HeaderFactory, HeaderFactoryExt

Implementation of the JAIN SIP HeaderFactory

Since:
1.1
Version:
1.2 $Revision: 1.18 $ $Date: 2009/07/17 18:57:31 $
Author:
M. Ranganathan
, Olivier Deruelle

Constructor Summary
HeaderFactoryImpl()
          Default constructor.
 
Method Summary
 AcceptEncodingHeader createAcceptEncodingHeader(String encoding)
          Creates a new AcceptEncodingHeader based on the newly supplied encoding value.
 AcceptHeader createAcceptHeader(String contentType, String contentSubType)
          Creates a new AcceptHeader based on the newly supplied contentType and contentSubType values.
 AcceptLanguageHeader createAcceptLanguageHeader(Locale language)
          Creates a new AcceptLanguageHeader based on the newly supplied language value.
 AlertInfoHeader createAlertInfoHeader(URI alertInfo)
          Creates a new AlertInfoHeader based on the newly supplied alertInfo value.
 AllowEventsHeader createAllowEventsHeader(String eventType)
          Creates a new AllowEventsHeader based on the newly supplied event type value.
 AllowHeader createAllowHeader(String method)
          Creates a new AllowHeader based on the newly supplied method value.
 AuthenticationInfoHeader createAuthenticationInfoHeader(String response)
          Creates a new AuthenticationInfoHeader based on the newly supplied response value.
 AuthorizationHeader createAuthorizationHeader(String scheme)
          Creates a new AuthorizationHeader based on the newly supplied scheme value.
 CallIdHeader createCallIdHeader(String callId)
          Creates a new CallIdHeader based on the newly supplied callId value.
 CallInfoHeader createCallInfoHeader(URI callInfo)
          Creates a new CallInfoHeader based on the newly supplied callInfo value.
 PChargingVectorHeader createChargingVectorHeader(String icid)
          P-Charging-Vector header
 ContactHeader createContactHeader()
          Creates a new wildcard ContactHeader.
 ContactHeader createContactHeader(Address address)
          Creates a new ContactHeader based on the newly supplied address value.
 ContentDispositionHeader createContentDispositionHeader(String contentDisposition)
          Creates a new ContentDispositionHeader based on the newly supplied contentDisposition value.
 ContentEncodingHeader createContentEncodingHeader(String encoding)
          Creates a new ContentEncodingHeader based on the newly supplied encoding value.
 ContentLanguageHeader createContentLanguageHeader(Locale contentLanguage)
          Creates a new ContentLanguageHeader based on the newly supplied contentLanguage value.
 ContentLengthHeader createContentLengthHeader(int contentLength)
          Creates a new CSeqHeader based on the newly supplied contentLength value.
 ContentTypeHeader createContentTypeHeader(String contentType, String contentSubType)
          Creates a new ContentTypeHeader based on the newly supplied contentType and contentSubType values.
 CSeqHeader createCSeqHeader(int sequenceNumber, String method)
          Deprecated.  
 CSeqHeader createCSeqHeader(long sequenceNumber, String method)
          Creates a new CSeqHeader based on the newly supplied sequence number and method values.
 DateHeader createDateHeader(Calendar date)
          Creates a new DateHeader based on the newly supplied date value.
 ErrorInfoHeader createErrorInfoHeader(URI errorInfo)
          Creates a new ErrorInfoHeader based on the newly supplied errorInfo value.
 EventHeader createEventHeader(String eventType)
          Creates a new EventHeader based on the newly supplied eventType value.
 ExpiresHeader createExpiresHeader(int expires)
          Creates a new ExpiresHeader based on the newly supplied expires value.
 ExtensionHeader createExtensionHeader(String name, String value)
          Creates a new ExtensionHeader based on the newly supplied name and value values.
 FromHeader createFromHeader(Address address, String tag)
          Creates a new FromHeader based on the newly supplied address and tag values.
 Header createHeader(String headerName, String headerValue)
          Create and parse a header.
 List createHeaders(String headers)
          Create and return a list of headers.
 InReplyToHeader createInReplyToHeader(String callId)
          Creates a new InReplyToHeader based on the newly supplied callId value.
 JoinHeader createJoinHeader(String callId, String toTag, String fromTag)
          Create a Join header with a call Id, to and from tag.
 MaxForwardsHeader createMaxForwardsHeader(int maxForwards)
          Creates a new MaxForwardsHeader based on the newly supplied maxForwards value.
 MimeVersionHeader createMimeVersionHeader(int majorVersion, int minorVersion)
          Creates a new MimeVersionHeader based on the newly supplied mimeVersion value.
 MinExpiresHeader createMinExpiresHeader(int minExpires)
          Creates a new MinExpiresHeader based on the newly supplied minExpires value.
 ExtensionHeader createMinSEHeader(int expires)
          Creates a new MinSEHeader based on the newly supplied expires value.
 OrganizationHeader createOrganizationHeader(String organization)
          Creates a new OrganizationHeader based on the newly supplied organization value.
 PAccessNetworkInfoHeader createPAccessNetworkInfoHeader()
          creates a P-Access-Network-Info header
 PAssertedIdentityHeader createPAssertedIdentityHeader(Address address)
          P-Asserted-Identity header
 PAssertedServiceHeader createPAssertedServiceHeader()
           
 PAssociatedURIHeader createPAssociatedURIHeader(Address assocURI)
          Creates a new P-Associated-URI header based on the supplied address
 PathHeader createPathHeader(Address address)
          PATH header
 PCalledPartyIDHeader createPCalledPartyIDHeader(Address address)
          P-Called-Party-ID header
 PChargingFunctionAddressesHeader createPChargingFunctionAddressesHeader()
          P-Charging-Function-Addresses header
 PMediaAuthorizationHeader createPMediaAuthorizationHeader(String token)
          P-Media-Authorization header
 PPreferredIdentityHeader createPPreferredIdentityHeader(Address address)
          P-Preferred-Identity header
 PPreferredServiceHeader createPPreferredServiceHeader()
           
 PProfileKeyHeader createPProfileKeyHeader(Address address)
          added by aayush here:
 PriorityHeader createPriorityHeader(String priority)
          Creates a new PriorityHeader based on the newly supplied priority value.
 PrivacyHeader createPrivacyHeader(String privacyType)
          Privacy header
 ProxyAuthenticateHeader createProxyAuthenticateHeader(String scheme)
          Creates a new ProxyAuthenticateHeader based on the newly supplied scheme value.
 ProxyAuthorizationHeader createProxyAuthorizationHeader(String scheme)
          Creates a new ProxyAuthorizationHeader based on the newly supplied scheme value.
 ProxyRequireHeader createProxyRequireHeader(String optionTag)
          Creates a new ProxyRequireHeader based on the newly supplied optionTag value.
 PServedUserHeader createPServedUserHeader(Address address)
          added by aayush here:
 PUserDatabaseHeader createPUserDatabaseHeader(String databaseName)
          added by aayush here:
 PVisitedNetworkIDHeader createPVisitedNetworkIDHeader()
          P-Visited-Network-ID header
 RAckHeader createRAckHeader(int rSeqNumber, int cSeqNumber, String method)
          Deprecated.  
 RAckHeader createRAckHeader(long rSeqNumber, long cSeqNumber, String method)
          Creates a new RAckHeader based on the newly supplied rSeqNumber, cSeqNumber and method values.
 ReasonHeader createReasonHeader(String protocol, int cause, String text)
          Creates a new ReasonHeader based on the newly supplied reason value.
 RecordRouteHeader createRecordRouteHeader(Address address)
          Creates a new RecordRouteHeader based on the newly supplied address value.
 ReferredByHeader createReferredByHeader(Address address)
          Create a ReferredBy Header.
 ReferToHeader createReferToHeader(Address address)
          Create a ReferTo Header.
 ReplacesHeader createReplacesHeader(String callId, String toTag, String fromTag)
          Create a Replaces header with a call Id, to and from tag.
 ReplyToHeader createReplyToHeader(Address address)
          Creates a new ReplyToHeader based on the newly supplied address value.
 RequireHeader createRequireHeader(String optionTag)
          Creates a new RequireHeader based on the newly supplied optionTag value.
 RetryAfterHeader createRetryAfterHeader(int retryAfter)
          Creates a new RetryAfterHeader based on the newly supplied retryAfter value.
 RouteHeader createRouteHeader(Address address)
          Creates a new RouteHeader based on the newly supplied address value.
 RSeqHeader createRSeqHeader(int sequenceNumber)
          Deprecated.  
 RSeqHeader createRSeqHeader(long sequenceNumber)
          Creates a new RSeqHeader based on the newly supplied sequenceNumber value.
 SecurityClientHeader createSecurityClientHeader()
          Security-Client header
 SecurityServerHeader createSecurityServerHeader()
          Security-Server header
 SecurityVerifyHeader createSecurityVerifyHeader()
          Security-Verify header
 ServerHeader createServerHeader(List product)
          Creates a new ServerHeader based on the newly supplied product value.
 ServiceRouteHeader createServiceRouteHeader(Address address)
          Service-Route header
 SessionExpiresHeader createSessionExpiresHeader(int expires)
          Creates a new SessionExpiresHeader based on the newly supplied expires value.
 SIPETagHeader createSIPETagHeader(String etag)
          Creates a new SIP-ETag header with the supplied tag value
 SIPIfMatchHeader createSIPIfMatchHeader(String etag)
          Creates a new SIP-If-Match header with the supplied tag value
 SubjectHeader createSubjectHeader(String subject)
          Creates a new SubjectHeader based on the newly supplied subject value.
 SubscriptionStateHeader createSubscriptionStateHeader(String subscriptionState)
          Creates a new SubscriptionStateHeader based on the newly supplied subscriptionState value.
 SupportedHeader createSupportedHeader(String optionTag)
          Creates a new SupportedHeader based on the newly supplied optionTag value.
 TimeStampHeader createTimeStampHeader(float timeStamp)
          Creates a new TimeStampHeader based on the newly supplied timeStamp value.
 ToHeader createToHeader(Address address, String tag)
          Creates a new ToHeader based on the newly supplied address and tag values.
 UnsupportedHeader createUnsupportedHeader(String optionTag)
          Creates a new UnsupportedHeader based on the newly supplied optionTag value.
 UserAgentHeader createUserAgentHeader(List product)
          Creates a new UserAgentHeader based on the newly supplied product value.
 ViaHeader createViaHeader(String host, int port, String transport, String branch)
          Creates a new ViaHeader based on the newly supplied uri and branch values.
 WarningHeader createWarningHeader(String agent, int code, String comment)
          Creates a new WarningHeader based on the newly supplied agent, code and comment values.
 WWWAuthenticateHeader createWWWAuthenticateHeader(String scheme)
          Creates a new WWWAuthenticateHeader based on the newly supplied scheme value.
 void setPrettyEncoding(boolean flag)
          Set pretty encoding on / off.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderFactoryImpl

public HeaderFactoryImpl()
Default constructor.

Method Detail

setPrettyEncoding

public void setPrettyEncoding(boolean flag)
Set pretty encoding on / off. This splits up via headers into multiple lines for readability ( better for debugging ).


createAcceptEncodingHeader

public AcceptEncodingHeader createAcceptEncodingHeader(String encoding)
                                                throws ParseException
Creates a new AcceptEncodingHeader based on the newly supplied encoding value.

Specified by:
createAcceptEncodingHeader in interface HeaderFactory
Parameters:
encoding - - the new string containing the encoding value.
Returns:
the newly created AcceptEncodingHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the encoding value.

createAcceptHeader

public AcceptHeader createAcceptHeader(String contentType,
                                       String contentSubType)
                                throws ParseException
Creates a new AcceptHeader based on the newly supplied contentType and contentSubType values.

Specified by:
createAcceptHeader in interface HeaderFactory
Parameters:
contentType - The new string content type value.
contentSubType - The new string content sub-type value.
Returns:
the newly created AcceptHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the content type or content subtype value.

createAcceptLanguageHeader

public AcceptLanguageHeader createAcceptLanguageHeader(Locale language)
Creates a new AcceptLanguageHeader based on the newly supplied language value.

Specified by:
createAcceptLanguageHeader in interface HeaderFactory
Parameters:
language - - the new Locale value of the language
Returns:
the newly created AcceptLanguageHeader object.

createAlertInfoHeader

public AlertInfoHeader createAlertInfoHeader(URI alertInfo)
Creates a new AlertInfoHeader based on the newly supplied alertInfo value.

Specified by:
createAlertInfoHeader in interface HeaderFactory
Parameters:
alertInfo - - the new URI value of the alertInfo
Returns:
the newly created AlertInfoHeader object.
Since:
v1.1

createAllowEventsHeader

public AllowEventsHeader createAllowEventsHeader(String eventType)
                                          throws ParseException
Creates a new AllowEventsHeader based on the newly supplied event type value.

Specified by:
createAllowEventsHeader in interface HeaderFactory
Parameters:
eventType - - the new string containing the eventType value.
Returns:
the newly created AllowEventsHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the eventType value.
Since:
v1.1

createAllowHeader

public AllowHeader createAllowHeader(String method)
                              throws ParseException
Creates a new AllowHeader based on the newly supplied method value.

Specified by:
createAllowHeader in interface HeaderFactory
Parameters:
method - - the new string containing the method value.
Returns:
the newly created AllowHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.

createAuthenticationInfoHeader

public AuthenticationInfoHeader createAuthenticationInfoHeader(String response)
                                                        throws ParseException
Creates a new AuthenticationInfoHeader based on the newly supplied response value.

Specified by:
createAuthenticationInfoHeader in interface HeaderFactory
Parameters:
response - - the new string value of the response.
Returns:
the newly created AuthenticationInfoHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the response value.
Since:
v1.1

createAuthorizationHeader

public AuthorizationHeader createAuthorizationHeader(String scheme)
                                              throws ParseException
Creates a new AuthorizationHeader based on the newly supplied scheme value.

Specified by:
createAuthorizationHeader in interface HeaderFactory
Parameters:
scheme - - the new string value of the scheme.
Returns:
the newly created AuthorizationHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the scheme value.

createCSeqHeader

public CSeqHeader createCSeqHeader(long sequenceNumber,
                                   String method)
                            throws ParseException,
                                   InvalidArgumentException
Creates a new CSeqHeader based on the newly supplied sequence number and method values.

Specified by:
createCSeqHeader in interface HeaderFactory
Parameters:
sequenceNumber - - the new integer value of the sequence number.
method - - the new string value of the method.
Returns:
the newly created CSeqHeader object.
Throws:
InvalidArgumentException - if supplied sequence number is less than zero.
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.

createCSeqHeader

public CSeqHeader createCSeqHeader(int sequenceNumber,
                                   String method)
                            throws ParseException,
                                   InvalidArgumentException
Deprecated. 

For backwards compatibility, also accept int

Specified by:
createCSeqHeader in interface HeaderFactory
Parameters:
sequenceNumber - the new integer value of the sequence number.
method - the new string value of the method.
Returns:
the newly created CSeqHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.
InvalidArgumentException - if supplied sequence number is less than zero.

createCallIdHeader

public CallIdHeader createCallIdHeader(String callId)
                                throws ParseException
Creates a new CallIdHeader based on the newly supplied callId value.

Specified by:
createCallIdHeader in interface HeaderFactory
Parameters:
callId - - the new string value of the call-id.
Returns:
the newly created CallIdHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the callId value.

createCallInfoHeader

public CallInfoHeader createCallInfoHeader(URI callInfo)
Creates a new CallInfoHeader based on the newly supplied callInfo value.

Specified by:
createCallInfoHeader in interface HeaderFactory
Parameters:
callInfo - The new string value of the callInfo.
Returns:
the newly created CallInfoHeader object.

createContactHeader

public ContactHeader createContactHeader(Address address)
Creates a new ContactHeader based on the newly supplied address value.

Specified by:
createContactHeader in interface HeaderFactory
Parameters:
address - - the new Address value of the address.
Returns:
the newly created ContactHeader object.

createContactHeader

public ContactHeader createContactHeader()
Creates a new wildcard ContactHeader. This is used in Register requests to indicate to the server that it should remove all locations the at which the user is currently available. This implies that the following conditions are met:

Specified by:
createContactHeader in interface HeaderFactory
Returns:
the newly created wildcard ContactHeader.

createContentDispositionHeader

public ContentDispositionHeader createContentDispositionHeader(String contentDisposition)
                                                        throws ParseException
Creates a new ContentDispositionHeader based on the newly supplied contentDisposition value.

Specified by:
createContentDispositionHeader in interface HeaderFactory
Parameters:
contentDisposition - - the new string value of the contentDisposition.
Returns:
the newly created ContentDispositionHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the contentDisposition value.
Since:
v1.1

createContentEncodingHeader

public ContentEncodingHeader createContentEncodingHeader(String encoding)
                                                  throws ParseException
Creates a new ContentEncodingHeader based on the newly supplied encoding value.

Specified by:
createContentEncodingHeader in interface HeaderFactory
Parameters:
encoding - - the new string containing the encoding value.
Returns:
the newly created ContentEncodingHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the encoding value.

createContentLanguageHeader

public ContentLanguageHeader createContentLanguageHeader(Locale contentLanguage)
Creates a new ContentLanguageHeader based on the newly supplied contentLanguage value.

Specified by:
createContentLanguageHeader in interface HeaderFactory
Parameters:
contentLanguage - - the new Locale value of the contentLanguage.
Returns:
the newly created ContentLanguageHeader object.
Since:
v1.1

createContentLengthHeader

public ContentLengthHeader createContentLengthHeader(int contentLength)
                                              throws InvalidArgumentException
Creates a new CSeqHeader based on the newly supplied contentLength value.

Specified by:
createContentLengthHeader in interface HeaderFactory
Parameters:
contentLength - - the new integer value of the contentLength.
Returns:
the newly created ContentLengthHeader object.
Throws:
InvalidArgumentException - if supplied contentLength is less than zero.

createContentTypeHeader

public ContentTypeHeader createContentTypeHeader(String contentType,
                                                 String contentSubType)
                                          throws ParseException
Creates a new ContentTypeHeader based on the newly supplied contentType and contentSubType values.

Specified by:
createContentTypeHeader in interface HeaderFactory
Parameters:
contentType - - the new string content type value.
contentSubType - - the new string content sub-type value.
Returns:
the newly created ContentTypeHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the content type or content subtype value.

createDateHeader

public DateHeader createDateHeader(Calendar date)
Creates a new DateHeader based on the newly supplied date value.

Specified by:
createDateHeader in interface HeaderFactory
Parameters:
date - - the new Calender value of the date.
Returns:
the newly created DateHeader object.

createEventHeader

public EventHeader createEventHeader(String eventType)
                              throws ParseException
Creates a new EventHeader based on the newly supplied eventType value.

Specified by:
createEventHeader in interface HeaderFactory
Parameters:
eventType - - the new string value of the eventType.
Returns:
the newly created EventHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the eventType value.
Since:
v1.1

createExpiresHeader

public ExpiresHeader createExpiresHeader(int expires)
                                  throws InvalidArgumentException
Creates a new ExpiresHeader based on the newly supplied expires value.

Specified by:
createExpiresHeader in interface HeaderFactory
Parameters:
expires - - the new integer value of the expires.
Returns:
the newly created ExpiresHeader object.
Throws:
InvalidArgumentException - if supplied expires is less than zero.

createExtensionHeader

public ExtensionHeader createExtensionHeader(String name,
                                             String value)
                                      throws ParseException
Creates a new ExtensionHeader based on the newly supplied name and value values.

Parameters:
name - - the new string name of the ExtensionHeader value.
value - - the new string value of the ExtensionHeader.
Returns:
the newly created ExtensionHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the name or value values.

createFromHeader

public FromHeader createFromHeader(Address address,
                                   String tag)
                            throws ParseException
Creates a new FromHeader based on the newly supplied address and tag values.

Specified by:
createFromHeader in interface HeaderFactory
Parameters:
address - - the new Address object of the address.
tag - - the new string value of the tag.
Returns:
the newly created FromHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the tag value.

createInReplyToHeader

public InReplyToHeader createInReplyToHeader(String callId)
                                      throws ParseException
Creates a new InReplyToHeader based on the newly supplied callId value.

Specified by:
createInReplyToHeader in interface HeaderFactory
Parameters:
callId - - the new string containing the callId value.
Returns:
the newly created InReplyToHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the callId value.
Since:
v1.1

createMaxForwardsHeader

public MaxForwardsHeader createMaxForwardsHeader(int maxForwards)
                                          throws InvalidArgumentException
Creates a new MaxForwardsHeader based on the newly supplied maxForwards value.

Specified by:
createMaxForwardsHeader in interface HeaderFactory
Parameters:
maxForwards - The new integer value of the maxForwards.
Returns:
the newly created MaxForwardsHeader object.
Throws:
InvalidArgumentException - if supplied maxForwards is less than zero or greater than 255.

createMimeVersionHeader

public MimeVersionHeader createMimeVersionHeader(int majorVersion,
                                                 int minorVersion)
                                          throws InvalidArgumentException
Creates a new MimeVersionHeader based on the newly supplied mimeVersion value.

Specified by:
createMimeVersionHeader in interface HeaderFactory
Parameters:
majorVersion - - the new integer value of the majorVersion.
minorVersion - - the new integer value of the minorVersion.
Returns:
the newly created MimeVersionHeader object.
Throws:
InvalidArgumentException - if supplied mimeVersion is less than zero.
Since:
v1.1

createMinExpiresHeader

public MinExpiresHeader createMinExpiresHeader(int minExpires)
                                        throws InvalidArgumentException
Creates a new MinExpiresHeader based on the newly supplied minExpires value.

Specified by:
createMinExpiresHeader in interface HeaderFactory
Parameters:
minExpires - - the new integer value of the minExpires.
Returns:
the newly created MinExpiresHeader object.
Throws:
InvalidArgumentException - if supplied minExpires is less than zero.
Since:
v1.1

createMinSEHeader

public ExtensionHeader createMinSEHeader(int expires)
                                  throws InvalidArgumentException
Creates a new MinSEHeader based on the newly supplied expires value.

Parameters:
expires - - the new integer value of the expires.
Returns:
the newly created ExpiresHeader object. TODO: Once interfaces are in javax, change the type to MinSEHeader and add to HeaderFactory. - pmusgrave pmusgrave
Throws:
InvalidArgumentException - if supplied expires is less than zero.

createOrganizationHeader

public OrganizationHeader createOrganizationHeader(String organization)
                                            throws ParseException
Creates a new OrganizationHeader based on the newly supplied organization value.

Specified by:
createOrganizationHeader in interface HeaderFactory
Parameters:
organization - - the new string value of the organization.
Returns:
the newly created OrganizationHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the organization value.

createPriorityHeader

public PriorityHeader createPriorityHeader(String priority)
                                    throws ParseException
Creates a new PriorityHeader based on the newly supplied priority value.

Specified by:
createPriorityHeader in interface HeaderFactory
Parameters:
priority - - the new string value of the priority.
Returns:
the newly created PriorityHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the priority value.

createProxyAuthenticateHeader

public ProxyAuthenticateHeader createProxyAuthenticateHeader(String scheme)
                                                      throws ParseException
Creates a new ProxyAuthenticateHeader based on the newly supplied scheme value.

Specified by:
createProxyAuthenticateHeader in interface HeaderFactory
Parameters:
scheme - - the new string value of the scheme.
Returns:
the newly created ProxyAuthenticateHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the scheme value.

createProxyAuthorizationHeader

public ProxyAuthorizationHeader createProxyAuthorizationHeader(String scheme)
                                                        throws ParseException
Creates a new ProxyAuthorizationHeader based on the newly supplied scheme value.

Specified by:
createProxyAuthorizationHeader in interface HeaderFactory
Parameters:
scheme - - the new string value of the scheme.
Returns:
the newly created ProxyAuthorizationHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the scheme value.

createProxyRequireHeader

public ProxyRequireHeader createProxyRequireHeader(String optionTag)
                                            throws ParseException
Creates a new ProxyRequireHeader based on the newly supplied optionTag value.

Specified by:
createProxyRequireHeader in interface HeaderFactory
Parameters:
optionTag - - the new string OptionTag value.
Returns:
the newly created ProxyRequireHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the optionTag value.

createRAckHeader

public RAckHeader createRAckHeader(long rSeqNumber,
                                   long cSeqNumber,
                                   String method)
                            throws InvalidArgumentException,
                                   ParseException
Creates a new RAckHeader based on the newly supplied rSeqNumber, cSeqNumber and method values.

Parameters:
rSeqNumber - - the new integer value of the rSeqNumber.
cSeqNumber - - the new integer value of the cSeqNumber.
method - - the new string value of the method.
Returns:
the newly created RAckHeader object.
Throws:
InvalidArgumentException - if supplied rSeqNumber or cSeqNumber is less than zero or greater than than 2**31-1.
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.
Since:
v1.1

createRAckHeader

public RAckHeader createRAckHeader(int rSeqNumber,
                                   int cSeqNumber,
                                   String method)
                            throws InvalidArgumentException,
                                   ParseException
Deprecated. 

Description copied from interface: HeaderFactory
Creates a new RAckHeader based on the newly supplied rSeqNumber, cSeqNumber and method values.

Specified by:
createRAckHeader in interface HeaderFactory
Parameters:
rSeqNumber - the new integer value of the rSeqNumber.
cSeqNumber - the new integer value of the cSeqNumber.
method - the new string value of the method.
Returns:
the newly created RAckHeader object.
Throws:
InvalidArgumentException - if supplied rSeqNumber or cSeqNumber is less than zero or greater than than 2**31-1.
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.
See Also:
HeaderFactory.createRAckHeader(int, int, java.lang.String)

createRSeqHeader

public RSeqHeader createRSeqHeader(int sequenceNumber)
                            throws InvalidArgumentException
Deprecated. 

Description copied from interface: HeaderFactory
Creates a new RSeqHeader based on the newly supplied sequenceNumber value.

Specified by:
createRSeqHeader in interface HeaderFactory
Parameters:
sequenceNumber - the new integer value of the sequenceNumber.
Returns:
the newly created RSeqHeader object.
Throws:
InvalidArgumentException - if supplied sequenceNumber is less than zero or greater than than 2**31-1.
See Also:
HeaderFactory.createRSeqHeader(int)

createRSeqHeader

public RSeqHeader createRSeqHeader(long sequenceNumber)
                            throws InvalidArgumentException
Creates a new RSeqHeader based on the newly supplied sequenceNumber value.

Parameters:
sequenceNumber - - the new integer value of the sequenceNumber.
Returns:
the newly created RSeqHeader object.
Throws:
InvalidArgumentException - if supplied sequenceNumber is less than zero or greater than than 2**31-1.
Since:
v1.1

createReasonHeader

public ReasonHeader createReasonHeader(String protocol,
                                       int cause,
                                       String text)
                                throws InvalidArgumentException,
                                       ParseException
Creates a new ReasonHeader based on the newly supplied reason value.

Specified by:
createReasonHeader in interface HeaderFactory
Parameters:
protocol - - the new string value of the protocol.
cause - - the new integer value of the cause.
text - - the new string value of the text.
Returns:
the newly created ReasonHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the protocol, cause or text value.
InvalidArgumentException - if supplied cause is less than zero.
Since:
v1.1

createRecordRouteHeader

public RecordRouteHeader createRecordRouteHeader(Address address)
Creates a new RecordRouteHeader based on the newly supplied address value.

Specified by:
createRecordRouteHeader in interface HeaderFactory
Parameters:
address - - the new Address object of the address.
Returns:
the newly created RecordRouteHeader object.

createReplyToHeader

public ReplyToHeader createReplyToHeader(Address address)
Creates a new ReplyToHeader based on the newly supplied address value.

Specified by:
createReplyToHeader in interface HeaderFactory
Parameters:
address - - the new Address object of the address.
Returns:
the newly created ReplyToHeader object.
Since:
v1.1

createRequireHeader

public RequireHeader createRequireHeader(String optionTag)
                                  throws ParseException
Creates a new RequireHeader based on the newly supplied optionTag value.

Specified by:
createRequireHeader in interface HeaderFactory
Parameters:
optionTag - - the new string value containing the optionTag value.
Returns:
the newly created RequireHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the List of optionTag value.

createRetryAfterHeader

public RetryAfterHeader createRetryAfterHeader(int retryAfter)
                                        throws InvalidArgumentException
Creates a new RetryAfterHeader based on the newly supplied retryAfter value.

Specified by:
createRetryAfterHeader in interface HeaderFactory
Parameters:
retryAfter - - the new integer value of the retryAfter.
Returns:
the newly created RetryAfterHeader object.
Throws:
InvalidArgumentException - if supplied retryAfter is less than zero.

createRouteHeader

public RouteHeader createRouteHeader(Address address)
Creates a new RouteHeader based on the newly supplied address value.

Specified by:
createRouteHeader in interface HeaderFactory
Parameters:
address - - the new Address object of the address.
Returns:
the newly created RouteHeader object.

createServerHeader

public ServerHeader createServerHeader(List product)
                                throws ParseException
Creates a new ServerHeader based on the newly supplied product value.

Specified by:
createServerHeader in interface HeaderFactory
Parameters:
product - - the new list value of the product.
Returns:
the newly created ServerHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the product value.

createSubjectHeader

public SubjectHeader createSubjectHeader(String subject)
                                  throws ParseException
Creates a new SubjectHeader based on the newly supplied subject value.

Specified by:
createSubjectHeader in interface HeaderFactory
Parameters:
subject - - the new string value of the subject.
Returns:
the newly created SubjectHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the subject value.

createSubscriptionStateHeader

public SubscriptionStateHeader createSubscriptionStateHeader(String subscriptionState)
                                                      throws ParseException
Creates a new SubscriptionStateHeader based on the newly supplied subscriptionState value.

Specified by:
createSubscriptionStateHeader in interface HeaderFactory
Parameters:
subscriptionState - - the new string value of the subscriptionState.
Returns:
the newly created SubscriptionStateHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the subscriptionState value.
Since:
v1.1

createSupportedHeader

public SupportedHeader createSupportedHeader(String optionTag)
                                      throws ParseException
Creates a new SupportedHeader based on the newly supplied optionTag value.

Specified by:
createSupportedHeader in interface HeaderFactory
Parameters:
optionTag - - the new string containing the optionTag value.
Returns:
the newly created SupportedHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the optionTag value.

createTimeStampHeader

public TimeStampHeader createTimeStampHeader(float timeStamp)
                                      throws InvalidArgumentException
Creates a new TimeStampHeader based on the newly supplied timeStamp value.

Specified by:
createTimeStampHeader in interface HeaderFactory
Parameters:
timeStamp - - the new float value of the timeStamp.
Returns:
the newly created TimeStampHeader object.
Throws:
InvalidArgumentException - if supplied timeStamp is less than zero.

createToHeader

public ToHeader createToHeader(Address address,
                               String tag)
                        throws ParseException
Creates a new ToHeader based on the newly supplied address and tag values.

Specified by:
createToHeader in interface HeaderFactory
Parameters:
address - - the new Address object of the address.
tag - - the new string value of the tag.
Returns:
the newly created ToHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the tag value.

createUnsupportedHeader

public UnsupportedHeader createUnsupportedHeader(String optionTag)
                                          throws ParseException
Creates a new UnsupportedHeader based on the newly supplied optionTag value.

Specified by:
createUnsupportedHeader in interface HeaderFactory
Parameters:
optionTag - - the new string containing the optionTag value.
Returns:
the newly created UnsupportedHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the List of optionTag value.

createUserAgentHeader

public UserAgentHeader createUserAgentHeader(List product)
                                      throws ParseException
Creates a new UserAgentHeader based on the newly supplied product value.

Specified by:
createUserAgentHeader in interface HeaderFactory
Parameters:
product - - the new list value of the product.
Returns:
the newly created UserAgentHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the product value.

createViaHeader

public ViaHeader createViaHeader(String host,
                                 int port,
                                 String transport,
                                 String branch)
                          throws ParseException,
                                 InvalidArgumentException
Creates a new ViaHeader based on the newly supplied uri and branch values.

Specified by:
createViaHeader in interface HeaderFactory
Parameters:
host - the new host value of uri.
port - the new port value of uri.
transport - the new transport value of uri.
branch - the new string value of the branch.
Returns:
the newly created ViaHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the branch value.
InvalidArgumentException - if the supplied port is invalid.

createWWWAuthenticateHeader

public WWWAuthenticateHeader createWWWAuthenticateHeader(String scheme)
                                                  throws ParseException
Creates a new WWWAuthenticateHeader based on the newly supplied scheme value.

Specified by:
createWWWAuthenticateHeader in interface HeaderFactory
Parameters:
scheme - - the new string value of the scheme.
Returns:
the newly created WWWAuthenticateHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the scheme values.

createWarningHeader

public WarningHeader createWarningHeader(String agent,
                                         int code,
                                         String comment)
                                  throws ParseException,
                                         InvalidArgumentException
Creates a new WarningHeader based on the newly supplied agent, code and comment values.

Specified by:
createWarningHeader in interface HeaderFactory
Parameters:
agent - - the new string value of the agent.
code - - the new boolean integer of the code.
comment - - the new string value of the comment.
Returns:
the newly created WarningHeader object.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the agent or comment values.
InvalidArgumentException - if an invalid integer code is given for the WarningHeader.

createErrorInfoHeader

public ErrorInfoHeader createErrorInfoHeader(URI errorInfo)
Creates a new ErrorInfoHeader based on the newly supplied errorInfo value.

Specified by:
createErrorInfoHeader in interface HeaderFactory
Parameters:
errorInfo - - the new URI value of the errorInfo.
Returns:
the newly created ErrorInfoHeader object.

createHeader

public Header createHeader(String headerName,
                           String headerValue)
                    throws ParseException
Create and parse a header.

Specified by:
createHeader in interface HeaderFactory
Parameters:
headerName - -- header name for the header to parse.
headerValue - -- header value for the header to parse.
Returns:
the parsed sip header
Throws:
ParseException
See Also:
ExtensionHeader

createHeaders

public List createHeaders(String headers)
                   throws ParseException
Create and return a list of headers.

Specified by:
createHeaders in interface HeaderFactory
Parameters:
headers - -- list of headers.
Returns:
a List containing the headers.
Throws:
ParseException - -- if a parse exception occurs or a List of that type of header is not alowed.

createReferToHeader

public ReferToHeader createReferToHeader(Address address)
Create a ReferTo Header.

Specified by:
createReferToHeader in interface HeaderFactory
Parameters:
address - -- address for the header.
Returns:
the newly created ReferToHeader object.

createReferredByHeader

public ReferredByHeader createReferredByHeader(Address address)
Create a ReferredBy Header. pmusgrave

Specified by:
createReferredByHeader in interface HeaderFactoryExt
Parameters:
address - -- address for the header. TODO: Once interfaces are in javax, change the type to MinSEHeader and add to HeaderFactory. - pmusgrave

createReplacesHeader

public ReplacesHeader createReplacesHeader(String callId,
                                           String toTag,
                                           String fromTag)
                                    throws ParseException
Create a Replaces header with a call Id, to and from tag. TODO: Once interfaces are in javax, change the type to MinSEHeader and add to HeaderFactory. - pmusgrave pmusgrave

Specified by:
createReplacesHeader in interface HeaderFactoryExt
Parameters:
callId - - the call id to use.
toTag - - the to tag to use.
fromTag - - the fromTag to use.
Throws:
ParseException

createJoinHeader

public JoinHeader createJoinHeader(String callId,
                                   String toTag,
                                   String fromTag)
                            throws ParseException
Create a Join header with a call Id, to and from tag.

Specified by:
createJoinHeader in interface HeaderFactoryExt
Parameters:
callId - - the call id to use.
toTag - - the to tag to use.
fromTag - - the fromTag to use.
Throws:
ParseException

createSIPETagHeader

public SIPETagHeader createSIPETagHeader(String etag)
                                  throws ParseException
Description copied from interface: HeaderFactory
Creates a new SIP-ETag header with the supplied tag value

Specified by:
createSIPETagHeader in interface HeaderFactory
Parameters:
etag - the new tag token
Returns:
the newly created SIP-ETag header
Throws:
ParseException - when an error occurs during parsing of the etag parameter

createSIPIfMatchHeader

public SIPIfMatchHeader createSIPIfMatchHeader(String etag)
                                        throws ParseException
Description copied from interface: HeaderFactory
Creates a new SIP-If-Match header with the supplied tag value

Specified by:
createSIPIfMatchHeader in interface HeaderFactory
Parameters:
etag - the new tag token
Returns:
the newly created SIP-If-Match header
Throws:
ParseException - when an error occurs during parsing of the etag parameter

createPAccessNetworkInfoHeader

public PAccessNetworkInfoHeader createPAccessNetworkInfoHeader()
creates a P-Access-Network-Info header

Specified by:
createPAccessNetworkInfoHeader in interface HeaderFactoryExt
Returns:
newly created P-Access-Network-Info header

createPAssertedIdentityHeader

public PAssertedIdentityHeader createPAssertedIdentityHeader(Address address)
                                                      throws NullPointerException,
                                                             ParseException
P-Asserted-Identity header

Specified by:
createPAssertedIdentityHeader in interface HeaderFactoryExt
Parameters:
address - - Address
Returns:
newly created P-Asserted-Identity header
Throws:
ParseException
NullPointerException

createPAssociatedURIHeader

public PAssociatedURIHeader createPAssociatedURIHeader(Address assocURI)
Creates a new P-Associated-URI header based on the supplied address

Specified by:
createPAssociatedURIHeader in interface HeaderFactoryExt
Parameters:
assocURI - - Address
Returns:
newly created P-Associated-URI header
Throws:
NullPointerException - if the supplied address is null
ParseException

createPCalledPartyIDHeader

public PCalledPartyIDHeader createPCalledPartyIDHeader(Address address)
P-Called-Party-ID header

Specified by:
createPCalledPartyIDHeader in interface HeaderFactoryExt
Parameters:
address - - Address
Returns:
newly created P-Called-Party-ID header
Throws:
NullPointerException
ParseException

createPChargingFunctionAddressesHeader

public PChargingFunctionAddressesHeader createPChargingFunctionAddressesHeader()
P-Charging-Function-Addresses header

Specified by:
createPChargingFunctionAddressesHeader in interface HeaderFactoryExt
Returns:
newly created P-Charging-Function-Addresses header

createChargingVectorHeader

public PChargingVectorHeader createChargingVectorHeader(String icid)
                                                 throws ParseException
P-Charging-Vector header

Specified by:
createChargingVectorHeader in interface HeaderFactoryExt
Parameters:
icid - - icid string
Returns:
newly created P-Charging-Vector header
Throws:
NullPointerException
ParseException

createPMediaAuthorizationHeader

public PMediaAuthorizationHeader createPMediaAuthorizationHeader(String token)
                                                          throws InvalidArgumentException,
                                                                 ParseException
P-Media-Authorization header

Specified by:
createPMediaAuthorizationHeader in interface HeaderFactoryExt
Parameters:
token - - token string
Returns:
newly created P-Media-Authorizarion header
Throws:
InvalidArgumentException
ParseException

createPPreferredIdentityHeader

public PPreferredIdentityHeader createPPreferredIdentityHeader(Address address)
P-Preferred-Identity header

Specified by:
createPPreferredIdentityHeader in interface HeaderFactoryExt
Parameters:
address - - Address
Returns:
newly created P-Preferred-Identity header
Throws:
NullPointerException

createPVisitedNetworkIDHeader

public PVisitedNetworkIDHeader createPVisitedNetworkIDHeader()
P-Visited-Network-ID header

Specified by:
createPVisitedNetworkIDHeader in interface HeaderFactoryExt
Returns:
newly created P-Visited-Network-ID header

createPathHeader

public PathHeader createPathHeader(Address address)
PATH header

Specified by:
createPathHeader in interface HeaderFactoryExt
Parameters:
address - - Address
Returns:
newly created Path header
Throws:
NullPointerException
ParseException

createPrivacyHeader

public PrivacyHeader createPrivacyHeader(String privacyType)
Privacy header

Specified by:
createPrivacyHeader in interface HeaderFactoryExt
Parameters:
privacyType - - privacy type string
Returns:
newly created Privacy header
Throws:
NullPointerException

createServiceRouteHeader

public ServiceRouteHeader createServiceRouteHeader(Address address)
Service-Route header

Specified by:
createServiceRouteHeader in interface HeaderFactoryExt
Parameters:
address - - Address
Returns:
newly created Service-Route header
Throws:
NullPointerException

createSecurityServerHeader

public SecurityServerHeader createSecurityServerHeader()
Security-Server header

Specified by:
createSecurityServerHeader in interface HeaderFactoryExt
Returns:
newly created Security-Server header

createSecurityClientHeader

public SecurityClientHeader createSecurityClientHeader()
Security-Client header

Specified by:
createSecurityClientHeader in interface HeaderFactoryExt
Returns:
newly created Security-Client header

createSecurityVerifyHeader

public SecurityVerifyHeader createSecurityVerifyHeader()
Security-Verify header

Specified by:
createSecurityVerifyHeader in interface HeaderFactoryExt
Returns:
newly created Security-Verify header

createPUserDatabaseHeader

public PUserDatabaseHeader createPUserDatabaseHeader(String databaseName)
added by aayush here:

Specified by:
createPUserDatabaseHeader in interface HeaderFactoryExt
Returns:
the newly create P-User-Database header. Please note that this is not a SIP/TEL uri. It is a DIAMETER AAA URI.

createPProfileKeyHeader

public PProfileKeyHeader createPProfileKeyHeader(Address address)
added by aayush here:

Specified by:
createPProfileKeyHeader in interface HeaderFactoryExt
Returns:
The newly created P-Profile-Key header.

createPServedUserHeader

public PServedUserHeader createPServedUserHeader(Address address)
added by aayush here:

Specified by:
createPServedUserHeader in interface HeaderFactoryExt
Parameters:
address - of the served user.
Returns:
The newly created P-Served-User header.

createPPreferredServiceHeader

public PPreferredServiceHeader createPPreferredServiceHeader()
Specified by:
createPPreferredServiceHeader in interface HeaderFactoryExt
Returns:
The newly created P-Preferred-Service header.

createPAssertedServiceHeader

public PAssertedServiceHeader createPAssertedServiceHeader()
Specified by:
createPAssertedServiceHeader in interface HeaderFactoryExt
Returns:
The newly created P-Asserted-Service header.

createSessionExpiresHeader

public SessionExpiresHeader createSessionExpiresHeader(int expires)
                                                throws InvalidArgumentException
Creates a new SessionExpiresHeader based on the newly supplied expires value.

Specified by:
createSessionExpiresHeader in interface HeaderFactoryExt
Parameters:
expires - - the new integer value of the expires.
Returns:
the newly created SessionExpiresHeader object.
Throws:
InvalidArgumentException - if supplied expires is less than zero.

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.