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

EventHeader

public class EventHeader extends ParametersHeader
Event SIP Header.
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
protected String
eventType
Current event header field value.
public static final String
ID
Idientifier label.
public static final String
NAME
Event header field label.
public static Class
clazz
Class handle.
Constructors Summary
public EventHeader()
Creates a new instance of Event



     
        clazz = new EventHeader().getClass();
    
        super(EVENT);
    
Methods Summary
public java.lang.StringencodeBody()
Encode in canonical form.

return
String

        StringBuffer retval = new StringBuffer();

        if (eventType != null) {
            retval.append(eventType);
            // retval.append(Separators.SP + eventType + Separators.SP);
        }

        retval.append(encodeWithSep());

        return retval.toString();
    
public java.lang.StringgetEventId()
Gets the id of the EventHeader. This method may return null if the "eventId" is not set.

return
the string object identifing the eventId of EventHeader.

        return getParameter(ID);
    
public java.lang.StringgetEventType()
Gets the eventType of the EventHeader.

return
the string object identifing the eventType of EventHeader.

        return eventType;
    
public java.lang.ObjectgetValue()
Gets the event header value.

return
the event header value

        return this.eventType;
    
public booleanmatch(gov.nist.siplite.header.EventHeader matchTarget)
Return true if the given event header matches the supplied one.

param
matchTarget -- event header to match against.
return
true if object matches

        if (matchTarget.eventType == null && this.eventType != null)
            return false;
        else if (matchTarget.eventType != null && this.eventType == null)
            return false;
        else if (this.eventType == null && matchTarget.eventType == null)
            return false;
        else if (getEventId() == null && matchTarget.getEventId() != null)
            return false;
        else if (getEventId() != null && matchTarget.getEventId() == null)
            return false;
        return equalsIgnoreCase(matchTarget.eventType, this.eventType) &&
                ((this.getEventId() == matchTarget.getEventId()) ||
                equalsIgnoreCase(this.getEventId(), matchTarget.getEventId()));
    
public voidsetEventId(java.lang.String eventId)
Sets the id to the newly supplied eventId string.

param
eventId - the new string defining the eventId of this EventHeader
throws
ParseException which signals that an error has been reached unexpectedly while parsing the eventId value.

        if (eventId == null)
            throw new NullPointerException("the eventId parameter is null");
        setParameter(ID, eventId);
    
public voidsetEventType(java.lang.String eventType)
Sets the eventType to the newly supplied eventType string.

param
eventType - the new string defining the eventType supported in this EventHeader
throws
ParseException which signals that an error has been reached unexpectedly while parsing the eventType value.

        if (eventType == null)
            throw new NullPointerException(" the eventType is null");
        this.eventType = eventType;