NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.header
Class ViaList

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.javax.sip.header.SIPObject
              |
              +--gov.nist.javax.sip.header.SIPHeader
                    |
                    +--gov.nist.javax.sip.header.SIPHeaderList
                          |
                          +--gov.nist.javax.sip.header.ViaList
All Implemented Interfaces:
Cloneable, Collection, Header, List, Serializable, SIPHeaderNames

public final class ViaList
extends SIPHeaderList

Keeps a list and a hashtable of via header functions.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.
See Also:
Serialized Form

Field Summary
 
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, MAX_FORWARDS, MIME_VERSION, MIN_EXPIRES, ORGANIZATION, PRIORITY, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, PROXY_REQUIRE, RACK, REASON, RECORD_ROUTE, REPLY_TO, REQUIRE, RETRY_AFTER, ROUTE, RSEQ, SERVER, SUBJECT, SUBSCRIPTION_STATE, SUPPORTED, TIMESTAMP, TO, UNSUPPORTED, USER_AGENT, VIA, WARNING, WWW_AUTHENTICATE
 
Constructor Summary
ViaList()
          Default Constructor.
ViaList(SIPObjectList hl)
          Constructor.
 
Method Summary
 void add(SIPObject viaHdr)
          Add to our linked list and also put it in our table.
 Object clone()
          make a clone of this header list.
 void concatenate(SIPHeaderList otherVia)
          Concatenation function - append the given list to this list.
 void concatenate(SIPHeaderList otherVia, boolean topFlag)
          Concatenation function - concatenates a given via list at either end of this list.
 String debugDump()
          function for debug.
 String debugDump(int indentation)
          string formatting function.
 boolean isAddressOnViaList(String address)
          Is this address on the sent-by list?
 void replace(String objectText, GenericObject replacementObject, boolean matchSubstring)
          Replace an object from this contact list.
 void sprint(String str)
          function for debug
 String toString()
          Return an encoding for this header.
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeaderList
add, add, add, add, addAll, addAll, addFirst, clear, contains, containsAll, encode, equals, first, get, getFirst, getHeaderList, getHeadersAsEncodedStrings, getLast, getMyClass, indexOf, indexOf, isEmpty, isHeaderList, iterator, lastIndexOf, listIterator, listIterator, match, merge, next, next, remove, remove, remove, removeAll, removeAll, removeFirst, removeLast, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from class gov.nist.javax.sip.header.SIPHeader
getHeaderName, getHeaderValue, getName, getValue, setHeaderName
 
Methods inherited from class gov.nist.javax.sip.header.SIPObject
dbgPrint, replace, replace, replace
 
Methods inherited from class gov.nist.core.GenericObject
getClassFromName, getMatcher, isMySubclass, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

ViaList

public ViaList(SIPObjectList hl)
Constructor.

Parameters:
hl - SIPObjectList to set

ViaList

public ViaList()
Default Constructor.

Method Detail

add

public void add(SIPObject viaHdr)
Add to our linked list and also put it in our table.

Parameters:
viaHdr - SIPObject to set.

concatenate

public void concatenate(SIPHeaderList otherVia,
                        boolean topFlag)
                 throws IllegalArgumentException
Concatenation function - concatenates a given via list at either end of this list. The hash tables for quick access to via lists are merged and the lists themselves are merged by using the concatenation method of the superclass. This function supercedes the parent function of the same signature.

Overrides:
concatenate in class SIPHeaderList
Parameters:
otherVia - other list to concatenate with this list.
topFlag - if set to true other list is prepended to us.
Throws:
IllegalArgumentException - if the given header list is not a list of via headers.

clone

public Object clone()
make a clone of this header list. This supercedes the parent function of the same signature.

Specified by:
clone in interface Header
Overrides:
clone in class SIPHeaderList
Returns:
clone of this Header.

concatenate

public void concatenate(SIPHeaderList otherVia)
                 throws IllegalArgumentException
Concatenation function - append the given list to this list.

Overrides:
concatenate in class SIPHeaderList
Parameters:
otherVia - other list to concatenate with this list.
Throws:
IllegalArgumentException - if the given header list is not a list of via headers.

isAddressOnViaList

public boolean isAddressOnViaList(String address)
Is this address on the sent-by list? A proxy server can use this function to aid in loop detection.

Parameters:
address - String to set.
Returns:
true if the Header contains the address.

sprint

public void sprint(String str)
function for debug

Overrides:
sprint in class GenericObject
Parameters:
str - String to set.

debugDump

public String debugDump(int indentation)
string formatting function.

Overrides:
debugDump in class SIPHeaderList
Parameters:
indentation - int to set.
Returns:
string formatting.

debugDump

public String debugDump()
function for debug.

Overrides:
debugDump in class SIPHeaderList
Returns:
String.

toString

public String toString()
Return an encoding for this header.

Specified by:
toString in interface Header
Overrides:
toString in class SIPHeaderList
Returns:
encoded version of the header.

replace

public void replace(String objectText,
                    GenericObject replacementObject,
                    boolean matchSubstring)
Replace an object from this contact list.

Overrides:
replace in class SIPObject
Parameters:
objectText - Encoded form of the object that we want to replace.
replacementObject - object that we want to put in the place of this object.
matchSubstring - flag that indicates whether we want to pick targets on substring matches.

NIST SIP Parser and Stack (v1.2) API

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