FileDocCategorySizeDatePackage
CallIdHeader.javaAPI DocphoneME MR2 API (J2ME)4614Wed May 02 18:00:42 BST 2007gov.nist.siplite.header

CallIdHeader

public class CallIdHeader extends ParameterLessHeader
Call ID Header This code is in the public domain. IMPL_NOTE: think about removing the specific parser for CallIdHeader.

Fields Summary
public static final String
NAME
Caller ID header label.
public static Class
clazz
Handle to class.
protected CallIdentifier
callIdentifier
Caller Identifier field.
Constructors Summary
public CallIdHeader()
Default constructor.

    
    
     
        clazz = new CallIdHeader().getClass();
    
        super(CALL_ID);
    
Methods Summary
public java.lang.Objectclone()
Clone - do a deep copy.

return
Object CallIdHeader

        CallIdHeader retval = new CallIdHeader();
        if (this.callIdentifier != null)
            retval.callIdentifier = (CallIdentifier)this.callIdentifier.clone();
        return retval;
    
public java.lang.Stringencode()
Gets the encoded version of this id.

return
String.

        return headerName + Separators.COLON + Separators.SP +
                callIdentifier.encode() + Separators.NEWLINE;
    
public java.lang.StringencodeBody()
Encodes the body part of this header (leave out the hdrName).

return
String encoded body part of the header.

        if (callIdentifier == null)
            return "";
        else return callIdentifier.encode();
    
public booleanequals(java.lang.Object other)
Compares two call ids for equality.

param
other Object to set
return
true if the two call ids are equals, false otherwise

        if (! this.getClass().equals(other.getClass())) {
            return false;
        }
        CallIdHeader that = (CallIdHeader) other;
        
        return this.callIdentifier.equals(that.callIdentifier);
    
public java.lang.StringgetCallId()
Gets the Caller Id field. This does the same thing as encodeBody.

return
String the encoded body part of the

        return encodeBody();
    
public CallIdentifiergetCallIdentifer()
Gets the call Identifer member.

return
CallIdentifier

        return callIdentifier;
    
public java.lang.ObjectgetValue()
Gets the caller id header value.

return
the caller id value

        return callIdentifier;
        
    
public voidsetCallId(java.lang.String cid)
Sets the CallId field

param
cid String to set. This is the body part of the Call-Id header. It must have the form localId@host or localId.
throws
IllegalArgumentException if cid is null, not a token, or is not a token@token.

        callIdentifier = new CallIdentifier(cid);
    
public voidsetCallIdentifier(CallIdentifier cid)
Sets the callIdentifier member.

param
cid CallIdentifier to set (localId@host).

        callIdentifier = cid;
    
public voidsetHeaderValue(java.lang.String value)
Sets the header value field.

param
value is the value field to set.
throws
IllegalArgumentException if the value is invalid.

        setCallId(value);