jain.protocol.ip.sip.header
Class PriorityHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.RequestHeader
              |
              +--jain.protocol.ip.sip.header.PriorityHeader

public final class PriorityHeader
extends RequestHeader

This class represents the Priority request-header. The PriorityHeader indicates the urgency of the RequestMessage as perceived by the client.

The priority value may be one of the following:

It is recommended that the value of PRIORITY_EMERGENCY only be used when life, limb or property are in imminent danger.

Version:
0.6

Field Summary
static int PRIORITY_EMERGENCY
           
static int PRIORITY_NON_URGENT
           
static int PRIORITY_NORMAL
           
static int PRIORITY_URGENT
           
static java.lang.String token
          Token of PriorityHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
PriorityHeader(int priority)
          Creates a PriorityHeader based on given priority
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of PriorityHeader
 boolean equals(PriorityHeader priorityHeader)
          Indicates whether some other PriorityHeader is "equal to" this one
 int getPriority()
          Gets priority of PriorityHeader
 java.lang.String getValue()
          Gets value of PriorityHeader
 boolean isEmergency()
          Returns boolean value indicating if priority of PriorityHeader is PRIORITY_EMERGENCY
 boolean isNonUrgent()
          Returns boolean value indicating if priority of PriorityHeader is PRIORITY_NON_URGENT
 boolean isNormal()
          Returns boolean value indicating if priority of PriorityHeader is PRIORITY_NORMAL
 boolean isUrgent()
          Returns boolean value indicating if priority of PriorityHeader is PRIORITY_URGENT
 void setEmergency()
          Sets priority of PriorityHeader to PRIORITY_EMERGENCY
 void setNonUrgent()
          Sets priority of PriorityHeader to PRIORITY_NON_URGENT
 void setNormal()
          Sets priority of PriorityHeader to PRIORITY_NORMAL
 void setPriority(int priority)
          Set priority of PriorityHeader
 void setUrgent()
          Sets priority of PriorityHeader to PRIORITY_URGENT
 
Methods inherited from class jain.protocol.ip.sip.header.Header
equals, getHeaderType, getToken, setValue, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIORITY_EMERGENCY

public static final int PRIORITY_EMERGENCY

PRIORITY_URGENT

public static final int PRIORITY_URGENT

PRIORITY_NORMAL

public static final int PRIORITY_NORMAL

PRIORITY_NON_URGENT

public static final int PRIORITY_NON_URGENT

token

public static final java.lang.String token
Token of PriorityHeader
Constructor Detail

PriorityHeader

public PriorityHeader(int priority)
               throws java.lang.IllegalArgumentException
Creates a PriorityHeader based on given priority
Parameters:
priority - priority
Throws:
java.lang.IllegalArgumentException - if priority is not one of the four priority values defined in this class
Method Detail

isEmergency

public boolean isEmergency()
Returns boolean value indicating if priority of PriorityHeader is PRIORITY_EMERGENCY
Returns:
boolean value indicating if priority of PriorityHeader is PRIORITY_EMERGENCY

isUrgent

public boolean isUrgent()
Returns boolean value indicating if priority of PriorityHeader is PRIORITY_URGENT
Returns:
boolean value indicating if priority of PriorityHeader is PRIORITY_URGENT

isNormal

public boolean isNormal()
Returns boolean value indicating if priority of PriorityHeader is PRIORITY_NORMAL
Returns:
boolean value indicating if priority of PriorityHeader is PRIORITY_NORMAL

isNonUrgent

public boolean isNonUrgent()
Returns boolean value indicating if priority of PriorityHeader is PRIORITY_NON_URGENT
Returns:
boolean value indicating if priority of PriorityHeader is PRIORITY_NON_URGENT

getPriority

public int getPriority()
Gets priority of PriorityHeader
Returns:
priority of PriorityHeader

setEmergency

public void setEmergency()
Sets priority of PriorityHeader to PRIORITY_EMERGENCY

setUrgent

public void setUrgent()
Sets priority of PriorityHeader to PRIORITY_URGENT

setNormal

public void setNormal()
Sets priority of PriorityHeader to PRIORITY_NORMAL

setNonUrgent

public void setNonUrgent()
Sets priority of PriorityHeader to PRIORITY_NON_URGENT

setPriority

public void setPriority(int priority)
                 throws java.lang.IllegalArgumentException
Set priority of PriorityHeader
Parameters:
priority - priority
Throws:
java.lang.IllegalArgumentException - if priority is not one of the four priority values defined in this class

getValue

public java.lang.String getValue()
Gets value of PriorityHeader
Overrides:
getValue in class Header
Returns:
value of PriorityHeader

clone

public java.lang.Object clone()
Creates and returns a copy of PriorityHeader
Overrides:
clone in class Header

equals

public boolean equals(PriorityHeader priorityHeader)
Indicates whether some other PriorityHeader is "equal to" this one
Parameters:
priorityHeader - the PriorityHeader with which to compare


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems