Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unpublished - rights reserved under the Copyright Laws of the United States. Copyright � 2003 Sun Microsystems, Inc. All rights reserved. Copyright � 2005 BEA Systems, Inc. All rights reserved. Use is subject to license terms. This distribution may include materials developed by third parties. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Module Name : JSIP Specification File Name : HeaderFactory.java Author : Phelim O'Doherty HISTORY Version Date Author Comments 1.1 08/10/2002 Phelim O'Doherty 1.2 20/12/2005 Jereon Van Bemmel Added create methods for PUBLISH headers 1.2 20/12/2006 Phelim O'Doherty Added new createCseqHeader with long sequence number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 package javax.sip.header;
 
 import java.util.*;

This interface provides factory methods that allow an application to create Header object from a particular implementation of JAIN SIP. This class is a singleton and can be retrieved from the javax.sip.SipFactory.createHeaderFactory().

Author(s):
BEA Systems, NIST
Version:
1.2
 
 public interface HeaderFactory {

    
Creates a new AcceptEncodingHeader based on the newly supplied encoding value.

Parameters:
encoding the new string containing the encoding value.
Returns:
the newly created AcceptEncodingHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the encoding value.
 
                          throws ParseException;

    
Creates a new AcceptHeader based on the newly supplied contentType and contentSubType values.

Parameters:
contentType the new string content type value.
contentSubType the new string content sub-type value.
Returns:
the newly created AcceptHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the content type or content subtype value.
 
     public AcceptHeader createAcceptHeader(String contentTypeString contentSubType)
                                     throws ParseException;


    
Creates a new AcceptLanguageHeader based on the newly supplied language value.

Parameters:
language the new Locale value of the language
Returns:
the newly created AcceptLanguageHeader object.
 
     public AcceptLanguageHeader createAcceptLanguageHeader(Locale language);

    
Creates a new AlertInfoHeader based on the newly supplied alertInfo value.

Parameters:
alertInfo the new URI value of the alertInfo
Returns:
the newly created AlertInfoHeader object.
 
     public AlertInfoHeader createAlertInfoHeader(URI alertInfo);


    
Creates a new AllowEventsHeader based on the newly supplied event type value.

Parameters:
eventType the new string containing the eventType value.
Returns:
the newly created AllowEventsHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the eventType value.
 
     public AllowEventsHeader createAllowEventsHeader(String eventType)
                                     throws ParseException;

    
Creates a new AllowHeader based on the newly supplied method value.

Parameters:
method the new string containing the method value.
Returns:
the newly created AllowHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the method value.
    public AllowHeader createAllowHeader(String method)
                                    throws ParseException;


    
Creates a new AuthenticationInfoHeader based on the newly supplied response value.

Parameters:
response the new string value of the response.
Returns:
the newly created AuthenticationInfoHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the response value.
                                    throws ParseException;



    
Creates a new AuthorizationHeader based on the newly supplied scheme value.

Parameters:
scheme the new string value of the scheme.
Returns:
the newly created AuthorizationHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the scheme value.
                                    throws ParseException;

    
Creates a new CSeqHeader based on the newly supplied sequence number and method values.

Deprecated:
Since 1.2. Use createCSeqHeader(long,java.lang.String) method with type long.
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:
javax.sip.InvalidArgumentException if supplied sequence number is less than zero.
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the method value.
    public CSeqHeader createCSeqHeader(int sequenceNumberString method)
                             throws ParseExceptionInvalidArgumentException;

 
Creates a new CSeqHeader based on the newly supplied sequence number and method values.

Parameters:
sequenceNumber the new long value of the sequence number.
method the new string value of the method.
Returns:
the newly created CSeqHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied sequence number is less than zero.
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the method value.
Since:
v1.2
    public CSeqHeader createCSeqHeader(long sequenceNumberString method)
                             throws ParseExceptionInvalidArgumentException;


    
Creates a new CallIdHeader based on the newly supplied callId value.

Parameters:
callId the new string value of the call-id.
Returns:
the newly created CallIdHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the callId value.
    public CallIdHeader createCallIdHeader(String callIdthrows ParseException;


    
Creates a new CallInfoHeader based on the newly supplied callInfo value.

Parameters:
callInfo the new URI value of the callInfo.
Returns:
the newly created CallInfoHeader object.
    public CallInfoHeader createCallInfoHeader(URI callInfo);


    
Creates a new ContactHeader based on the newly supplied address value.

Parameters:
address the new Address value of the address.
Returns:
the newly created ContactHeader object.
    public ContactHeader createContactHeader(Address address);

    
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:
  • ContactHeader.getAddress.getUserInfo() == *;
  • ContactHeader.getAddress.isWildCard() == true;
  • ContactHeader.getExpires() == 0;

Returns:
the newly created wildcard ContactHeader.
    public ContactHeader createContactHeader();


    
Creates a new ContentDispositionHeader based on the newly supplied contentDisposition value.

Parameters:
contentDispositionType the new string value of the contentDisposition.
Returns:
the newly created ContentDispositionHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the contentDisposition value.
    public ContentDispositionHeader createContentDispositionHeader(String contentDispositionType)
                                  throws ParseException;

    
Creates a new ContentEncodingHeader based on the newly supplied encoding value.

Parameters:
encoding the new string containing the encoding value.
Returns:
the newly created ContentEncodingHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the encoding value.
                                  throws ParseException;

    
Creates a new ContentLanguageHeader based on the newly supplied contentLanguage value.

Parameters:
contentLanguage the new Locale value of the contentLanguage.
Returns:
the newly created ContentLanguageHeader object.
    public ContentLanguageHeader createContentLanguageHeader(Locale contentLanguage);

    
Creates a new ContentLengthHeader based on the newly supplied contentLength value.

Parameters:
contentLength the new integer value of the contentLength.
Returns:
the newly created ContentLengthHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied contentLength is less than zero.
    public ContentLengthHeader createContentLengthHeader(int contentLength)
                                throws InvalidArgumentException;

    
Creates a new ContentTypeHeader based on the newly supplied contentType and contentSubType values.

Parameters:
contentType the new string content type value.
contentSubType the new string content sub-type value.
Returns:
the newly created ContentTypeHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the content type or content subtype value.
    public ContentTypeHeader createContentTypeHeader(String contentTypeString contentSubType)
                              throws ParseException;

     
Creates a new DateHeader based on the newly supplied date value.

Parameters:
date the new Calender value of the date.
Returns:
the newly created DateHeader object.
    public DateHeader createDateHeader(Calendar date);


    
Creates a new ErrorInfoHeader based on the newly supplied errorInfo value.

Parameters:
errorInfo the new URI value of the errorInfo.
Returns:
the newly created ErrorInfoHeader object.
    public ErrorInfoHeader createErrorInfoHeader(URI errorInfo);

    
Creates a new EventHeader based on the newly supplied eventType value.

Parameters:
eventType the new string value of the eventType.
Returns:
the newly created EventHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the eventType value.
    public EventHeader createEventHeader(String eventTypethrows ParseException;

    
Creates a new ExpiresHeader based on the newly supplied expires value.

Parameters:
expires the new integer value of the expires.
Returns:
the newly created ExpiresHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied expires is less than zero.
    public ExpiresHeader createExpiresHeader(int expires)
                                    throws InvalidArgumentException;

    
Creates a new Header based on the newly supplied name and value values. This method can be used to create ExtensionHeaders.

Parameters:
name the new string name of the Header value.
value the new string value of the Header.
Returns:
the newly created Header object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the name or value values.
See also:
ExtensionHeader
    public Header createHeader(String nameString valuethrows ParseException;

    
Creates a new List of Headers based on a supplied comma seperated list of Header values for a single header name. This method can be used only for SIP headers whose grammar is of the form header = header-name HCOLON header-value *(COMMA header-value) that allows for combining header fields of the same name into a comma-separated list. Note that the Contact header field allows a comma-separated list unless the header field value is "*"

Parameters:
headers the new string comma seperated list of Header values.
Returns:
the newly created List of Header objects.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the headers value or a List of that Header type is not allowed.
    public List createHeaders(String headersthrows ParseException;


    
Creates a new FromHeader based on the newly supplied address and tag values.

Parameters:
address the new Address object of the address.
tag the new string value of the tag.
Returns:
the newly created FromHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the tag value.
    public FromHeader createFromHeader(Address addressString tag)
                       throws ParseException;


    
Creates a new InReplyToHeader based on the newly supplied callId value.

Parameters:
callId the new string containing the callId value.
Returns:
the newly created InReplyToHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the callId value.
                                  throws ParseException;
     
Creates a new MaxForwardsHeader based on the newly supplied maxForwards value.

Parameters:
maxForwards the new integer value of the maxForwards.
Returns:
the newly created MaxForwardsHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied maxForwards is less than zero or greater than 255.
    public MaxForwardsHeader createMaxForwardsHeader(int maxForwards)
                              throws InvalidArgumentException;

    
Creates a new MimeVersionHeader based on the newly supplied mimeVersion values.

Parameters:
majorVersion the new integer value of the majorVersion.
minorVersion the new integer value of the minorVersion.
Returns:
the newly created MimeVersionHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied majorVersion or minorVersion is less than zero.
    public MimeVersionHeader createMimeVersionHeader(int majorVersionint minorVersion)
                              throws InvalidArgumentException;

    
Creates a new MinExpiresHeader based on the newly supplied minExpires value.

Parameters:
minExpires the new integer value of the minExpires.
Returns:
the newly created MinExpiresHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied minExpires is less than zero.
    public MinExpiresHeader createMinExpiresHeader(int minExpires)
                              throws InvalidArgumentException;


    
Creates a new OrganizationHeader based on the newly supplied organization value.

Parameters:
organization the new string value of the organization.
Returns:
the newly created OrganizationHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the organization value.
    public OrganizationHeader createOrganizationHeader(String organization)
                               throws ParseException;

    
Creates a new PriorityHeader based on the newly supplied priority value.

Parameters:
priority the new string value of the priority.
Returns:
the newly created PriorityHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the priority value.
    public PriorityHeader createPriorityHeader(String priority)
                           throws ParseException;

    
Creates a new ProxyAuthenticateHeader based on the newly supplied scheme value.

Parameters:
scheme the new string value of the scheme.
Returns:
the newly created ProxyAuthenticateHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the scheme value.
                                    throws ParseException;

    
Creates a new ProxyAuthorizationHeader based on the newly supplied scheme value.

Parameters:
scheme the new string value of the scheme.
Returns:
the newly created ProxyAuthorizationHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the scheme value.
                                    throws ParseException;

    
Creates a new ProxyRequireHeader based on the newly supplied optionTag value.

Parameters:
optionTag the new string OptionTag value.
Returns:
the newly created ProxyRequireHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the optionTag value.
                                    throws 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:
javax.sip.InvalidArgumentException if supplied rSeqNumber or cSeqNumber is less than zero or greater than than 2**31-1.
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the method value.
    public RAckHeader createRAckHeader(int rSeqNumberint cSeqNumberString method)
                             throws InvalidArgumentExceptionParseException;

    
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:
javax.sip.InvalidArgumentException if supplied sequenceNumber is less than zero or greater than than 2**31-1.
    public RSeqHeader createRSeqHeader(int sequenceNumber)
                             throws InvalidArgumentException;

    
Creates a new ReasonHeader based on the newly supplied reason value.

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:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the protocol or text value.
javax.sip.InvalidArgumentException if supplied cause is less than zero.
    public ReasonHeader createReasonHeader(String protocolint causeString text)
                                    throws InvalidArgumentExceptionParseException;

     
Creates a new RecordRouteHeader based on the newly supplied address value.

Parameters:
address the new Address object of the address.
Returns:
the newly created RecordRouteHeader object.
    public RecordRouteHeader createRecordRouteHeader(Address address);

     
Creates a new ReplyToHeader based on the newly supplied address value.

Parameters:
address the new Address object of the address.
Returns:
the newly created ReplyToHeader object.
    public ReplyToHeader createReplyToHeader(Address address);

     
Creates a new ReferToHeader based on the newly supplied address value.

Parameters:
address the new Address object of the address.
Returns:
the newly created ReferToHeader object.
    public ReferToHeader createReferToHeader(Address address);

    
Creates a new RequireHeader based on the newly supplied optionTag value.

Parameters:
optionTag the new string value containing the optionTag value.
Returns:
the newly created RequireHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the List of optionTag value.
    public RequireHeader createRequireHeader(String optionTag)
                                    throws ParseException;

    
Creates a new RetryAfterHeader based on the newly supplied retryAfter value.

Parameters:
retryAfter the new integer value of the retryAfter.
Returns:
the newly created RetryAfterHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied retryAfter is less than zero.
    public RetryAfterHeader createRetryAfterHeader(int retryAfter)
                             throws InvalidArgumentException;


    
Creates a new RouteHeader based on the newly supplied address value.

Parameters:
address the new Address object of the address.
Returns:
the newly created RouteHeader object.
    public RouteHeader createRouteHeader(Address address);

    
Creates a new ServerHeader based on the newly supplied List of product values.

Parameters:
product the new List of values of the product.
Returns:
the newly created ServerHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the List of product values.
    public ServerHeader createServerHeader(List product)
                                throws ParseException;

   
Creates a new SubjectHeader based on the newly supplied subject value.

Parameters:
subject the new string value of the subject.
Returns:
the newly created SubjectHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the subject value.
    public SubjectHeader createSubjectHeader(String subject)
                                throws ParseException;

    
Creates a new SubscriptionStateHeader based on the newly supplied subscriptionState value.

Parameters:
subscriptionState the new string value of the subscriptionState.
Returns:
the newly created SubscriptionStateHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the subscriptionState value.
                                        throws ParseException;


    
Creates a new SupportedHeader based on the newly supplied optionTag value.

Parameters:
optionTag the new string containing the optionTag value.
Returns:
the newly created SupportedHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the optionTag value.
    public SupportedHeader createSupportedHeader(String optionTag)
                                    throws ParseException;

    
Creates a new TimeStampHeader based on the newly supplied timeStamp value.

Parameters:
timeStamp the new float value of the timeStamp.
Returns:
the newly created TimeStampHeader object.
Throws:
javax.sip.InvalidArgumentException if supplied timeStamp is less than zero.
    public TimeStampHeader createTimeStampHeader(float timeStamp)
                            throws InvalidArgumentException;

    
Creates a new ToHeader based on the newly supplied address and tag values.

Parameters:
address the new Address object of the address.
tag the new string value of the tag, this value may be null.
Returns:
the newly created ToHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the tag value.
    public ToHeader createToHeader(Address addressString tagthrows ParseException;

    
Creates a new UnsupportedHeader based on the newly supplied optionTag value.

Parameters:
optionTag the new string containing the optionTag value.
Returns:
the newly created UnsupportedHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the List of optionTag value.
                              throws ParseException;

    
Creates a new UserAgentHeader based on the newly supplied List of product values.

Parameters:
product the new List of values of the product.
Returns:
the newly created UserAgentHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the List of product values.
    public UserAgentHeader createUserAgentHeader(List product)
                            throws ParseException;

    
Creates a new ViaHeader based on the newly supplied uri and branch values.

Parameters:
host the new string value of the host.
port the new integer value of the port.
transport the new string value of the transport.
branch the new string value of the branch.
Returns:
the newly created ViaHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the host, transport or branch value.
javax.sip.InvalidArgumentException if the supplied port is invalid.
    public ViaHeader createViaHeader(String hostint portString transport,
                 String branchthrows ParseExceptionInvalidArgumentException;

    
Creates a new WWWAuthenticateHeader based on the newly supplied scheme value.

Parameters:
scheme the new string value of the scheme.
Returns:
the newly created WWWAuthenticateHeader object.
Throws:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the scheme values.
                                throws ParseException;

    
Creates a new WarningHeader based on the newly supplied agent, code and comment values.

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:
java.text.ParseException which signals that an error has been reached unexpectedly while parsing the agent or comment values.
javax.sip.InvalidArgumentException if an invalid integer code is given for the WarningHeader.
    public WarningHeader createWarningHeader(String agentint codeString comment)
                          throws InvalidArgumentExceptionParseException;


    
Creates a new SIP-ETag header with the supplied tag value

Parameters:
etag the new tag token
Returns:
the newly created SIP-ETag header
Throws:
java.text.ParseException when an error occurs during parsing of the etag parameter
Since:
1.2
    public SIPETagHeader createSIPETagHeaderString etag ) throws ParseException;

    
Creates a new SIP-If-Match header with the supplied tag value

Parameters:
etag the new tag token
Returns:
the newly created SIP-If-Match header
Throws:
java.text.ParseException when an error occurs during parsing of the etag parameter
Since:
1.2
    public SIPIfMatchHeader createSIPIfMatchHeaderString etag ) throws ParseException;
New to GrepCode? Check out our FAQ X