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

gov.nist.javax.sip.header
Class CSeq

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sip.header.SIPObject
          extended by gov.nist.javax.sip.header.SIPHeader
              extended by gov.nist.javax.sip.header.CSeq
All Implemented Interfaces:
HeaderExt, SIPHeaderNames, Serializable, Cloneable, CSeqHeader, Header

public class CSeq
extends SIPHeader
implements CSeqHeader

CSeq SIP Header.

Since:
1.1
Version:
1.2 $Revision: 1.9 $ $Date: 2009/07/17 18:57:27 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.sip.header.CSeqHeader
NAME
 
Fields inherited from interface gov.nist.javax.sip.header.SIPHeaderNames
ACCEPT, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALERT_INFO, ALLOW, ALLOW_EVENTS, AUTHENTICATION_INFO, AUTHORIZATION, CALL_ID, CALL_INFO, CONTACT, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, CSEQ, DATE, ERROR_INFO, EVENT, EXPIRES, FROM, IN_REPLY_TO, JOIN, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, MIN_SE, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REFERRED_BY, REPLACES, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SESSION_EXPIRES, SIP_ETAG, SIP_IF_MATCH, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
CSeq()
          Constructor.
CSeq(long seqno, String method)
          Constructor given the sequence number and method.
 
Method Summary
 String encode()
          Return canonical encoded header.
 String encodeBody()
          Return canonical header content.
 boolean equals(Object other)
          Compare two cseq headers for equality.
 String getMethod()
          Get the method.
 long getSeqNumber()
          Gets the sequence number of this CSeqHeader.
 int getSequenceNumber()
          Gets the sequence number of this CSeqHeader.
 void setMethod(String meth)
          Sets the method of CSeqHeader
 void setSeqNumber(long sequenceNumber)
          Sets the sequence number value of the CSeqHeader.
 void setSequenceNumber(int sequenceNumber)
          For backwards compatibility
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
encode, getHeaderName, getHeaderValue, getName, getValue, hashCode, isHeaderList, setHeaderName, toString
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
dbgPrint, debugDump, debugDump, match
 
Methods inherited from class gov.nist.core.GenericObject
clone, getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sip.header.Header
clone, getName, hashCode, toString
 

Constructor Detail

CSeq

public CSeq()
Constructor.


CSeq

public CSeq(long seqno,
            String method)
Constructor given the sequence number and method.

Parameters:
seqno - is the sequence number to assign.
method - is the method string.
Method Detail

equals

public boolean equals(Object other)
Compare two cseq headers for equality.

Specified by:
equals in interface CSeqHeader
Specified by:
equals in interface Header
Overrides:
equals in class SIPObject
Parameters:
other - Object to compare against.
Returns:
true if the two cseq headers are equals, false otherwise.

encode

public String encode()
Return canonical encoded header.

Overrides:
encode in class SIPHeader
Returns:
String with canonical encoded header.

encodeBody

public String encodeBody()
Return canonical header content. (encoded header except headerName:)

Returns:
encoded string.

getMethod

public String getMethod()
Get the method.

Specified by:
getMethod in interface CSeqHeader
Returns:
String the method.

setSeqNumber

public void setSeqNumber(long sequenceNumber)
                  throws InvalidArgumentException
Description copied from interface: CSeqHeader
Sets the sequence number value of the CSeqHeader.

Specified by:
setSeqNumber in interface CSeqHeader
Parameters:
sequenceNumber - - the new sequence number of this CSeqHeader
Throws:
InvalidArgumentException - if supplied value is less than zero.

setSequenceNumber

public void setSequenceNumber(int sequenceNumber)
                       throws InvalidArgumentException
For backwards compatibility

Specified by:
setSequenceNumber in interface CSeqHeader
Parameters:
sequenceNumber - - the new sequence number of this CSeqHeader
Throws:
InvalidArgumentException - if supplied value is less than zero.

setMethod

public void setMethod(String meth)
               throws ParseException
Description copied from interface: CSeqHeader
Sets the method of CSeqHeader

Specified by:
setMethod in interface CSeqHeader
Parameters:
meth - - the method of the Request of this CSeqHeader
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method value.

getSequenceNumber

public int getSequenceNumber()
Description copied from interface: CSeqHeader
Gets the sequence number of this CSeqHeader.

Specified by:
getSequenceNumber in interface CSeqHeader
Returns:
sequence number of the CSeqHeader

getSeqNumber

public long getSeqNumber()
Description copied from interface: CSeqHeader
Gets the sequence number of this CSeqHeader.

Specified by:
getSeqNumber in interface CSeqHeader
Returns:
sequence number of the CSeqHeader

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.