| java.lang.Object javax.microedition.sip.SipHeader
SipHeader | public class SipHeader (Code) | | SipHeader provides generic SIP header parser helper. This class can be used
to parse bare String header values that are read from SIP message using e.g.
SipConnection.getHeader() method. It should be noticed that SipHeader
is separate helper class and not mandatory to use for creating SIP
connections.
See Also: JSR180 See Also: spec, v 1.0.1, p 47-51 |
Constructor Summary | |
public | SipHeader(String name, String value) Constructs a SipHeader from name value pair. |
SipHeader | public SipHeader(String name, String value) throws IllegalArgumentException(Code) | | Constructs a SipHeader from name value pair. For example:
name = Contact
value = <sip:UserB@192.168.200.201>;expires=3600
Parameters: name - name of the header (Contact, Call-ID, ...) Parameters: value - full header value as String throws: IllegalArgumentException - if the header value orname are invalid |
getHeaderValue | public java.lang.String getHeaderValue()(Code) | | Returns the full header value including parameters.
For example Alice <sip:alice@atlanta.com>;tag=1928301774
full header value including parameters |
getName | public java.lang.String getName()(Code) | | Returns the name of this header
the name of this header as String |
getParameter | public java.lang.String getParameter(java.lang.String name)(Code) | | Returns the value of one header parameter.
For example, from value <sip:UserB@192.168.200.201>;expires=3600
the method call getParameter(expires) will return 3600.
Parameters: name - name of the header parameter value of header parameter. returns empty string for a parameterwithout value and null if the parameter does not exist. |
getParameterNames | public java.lang.String[] getParameterNames()(Code) | | Returns the names of header parameters. Returns null if there are no
header parameters.
names of the header parameters. Returns null if there areno parameters. |
getValue | public java.lang.String getValue()(Code) | | Returns the header value without header parameters.
For example for header
<sip:UserB@192.168.200.201>;expires=3600 method
returns <sip:UserB@192.168.200.201>
In the case of an authorization or authentication header getValue()
returns only the authentication scheme e.g. Digest.
header value without header parameters |
removeParameter | public void removeParameter(java.lang.String name)(Code) | | Removes the header parameter, if it is found in this header.
Parameters: name - name of the header parameter |
setParameter | public void setParameter(java.lang.String name, java.lang.String value) throws IllegalArgumentException(Code) | | Sets value of header parameter. If parameter does not exist it
will be added.
For example, for header value <sip:UserB@192.168.200.201>
calling setParameter(expires, 3600) will construct header value
<sip:UserB@192.168.200.201>;expires=3600.
If the value is null, the parameter is interpreted as a parameter
without value.
Parameters: name - name of the header parameter Parameters: value - value of the parameter throws: IllegalArgumentException - if the parameter name orvalue are invalid |
setValue | public void setValue(java.lang.String value) throws IllegalArgumentException(Code) | | Sets the header value as String without parameters.
For example <sip:UserB@192.168.200.201>.
The existing (if any) header parameter values are not modified.
For the authorization and authentication header this method sets
the authentication scheme e.g. Digest.
Parameters: value - the header value throws: IllegalArgumentException - if the value is invalid or there isparameters included. |
toString | public java.lang.String toString()(Code) | | Returns the String representation of the header according to
header type.
For example:
From: Alice <sip:alice@atlanta.com>;tag=1928301774
WWW-Authenticate: Digest realm=atlanta.com,
domain=sip:boxesbybob.com, qop=auth,
nonce=f84f1cec41e6cbe5aea9c8e88d359,
opaque=, stale=FALSE, algorithm=MD5
encoded string of object contents |
|
|