NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sdp.fields
Class PreconditionFields

java.lang.Object
  extended by gov.nist.javax.sdp.fields.PreconditionFields

public class PreconditionFields
extends Object

Precondition fields (segmented / end-to-end).

For one media description, precondition attributes should be only of one type (segmented or end-to-end)

3GPP TS 24.299,

IETF RFC3312 + RFC4032 (Precondition Mechanism).

Author:
Miguel Freitas (IT) PT-Inovacao

Field Summary
static String[] DIRECTION
           
static int DIRECTION_NONE
           
static int DIRECTION_RECV
           
static int DIRECTION_SEND
           
static int DIRECTION_SENDRECV
           
static String[] PRECONDITION
           
static int PRECONDITION_QOS
           
static String[] STATUS
           
static int STATUS_E2E
           
static int STATUS_LOCAL
           
static int STATUS_REMOTE
           
static String[] STRENGTH
           
static int STRENGTH_FAILURE
           
static int STRENGTH_MANDATORY
           
static int STRENGTH_NONE
           
static int STRENGTH_OPTIONAL
           
static int STRENGTH_UNKNOWN
           
 
Constructor Summary
PreconditionFields()
          Constructor
 
Method Summary
 Vector getPreconditionConfirmStatus()
          Get the attribute fields with the name "conf" for confirmation precondition.
 Vector getPreconditionCurr(String status)
          Get the attribute fields with the name "curr" for current precondition.
 Vector getPreconditionDes(String status)
          Get the attribute fields with the name "des" for desired precondition There can be more than one current precondition line for a status-type (with different direction-tag values), specially if strength-tag is different
 Vector getPreconditions()
          Get Precondition
 int getPreconditionSize()
          Get the number of Precondition attributes
 void setPreconditionConfirmStatus(String precondConfValue)
          Set attribute line for confirmation precondition request, given a string value encoded like the "conf" attribute value
 void setPreconditionConfirmStatus(String status, String direction)
          IETF RFC3312 "The confirmation status attribute carries threshold conditions for a media stream.
 void setPreconditionCurr(String precondCurrValue)
          Set attribute line for current precondition state, given a string value encoded like the "curr" attribute value
 void setPreconditionCurr(String status, String directionTag)
          Set the value of the attributes with the name "curr" for current precondition.
 void setPreconditionDes(String precondDesValue)
          Set attribute line for desired precondition state, given a string value encoded like the "des" attribute value
 void setPreconditionDes(String strength, String status, String direction)
          Set the value of the attributes with the name "des" for desired precondition.
 void setPreconditions(Vector preconditions)
          Set Preconditions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRENGTH_UNKNOWN

public static final int STRENGTH_UNKNOWN
See Also:
Constant Field Values

STRENGTH_FAILURE

public static final int STRENGTH_FAILURE
See Also:
Constant Field Values

STRENGTH_NONE

public static final int STRENGTH_NONE
See Also:
Constant Field Values

STRENGTH_OPTIONAL

public static final int STRENGTH_OPTIONAL
See Also:
Constant Field Values

STRENGTH_MANDATORY

public static final int STRENGTH_MANDATORY
See Also:
Constant Field Values

STRENGTH

public static final String[] STRENGTH

DIRECTION_NONE

public static final int DIRECTION_NONE
See Also:
Constant Field Values

DIRECTION_SEND

public static final int DIRECTION_SEND
See Also:
Constant Field Values

DIRECTION_RECV

public static final int DIRECTION_RECV
See Also:
Constant Field Values

DIRECTION_SENDRECV

public static final int DIRECTION_SENDRECV
See Also:
Constant Field Values

DIRECTION

public static final String[] DIRECTION

STATUS_E2E

public static final int STATUS_E2E
See Also:
Constant Field Values

STATUS_LOCAL

public static final int STATUS_LOCAL
See Also:
Constant Field Values

STATUS_REMOTE

public static final int STATUS_REMOTE
See Also:
Constant Field Values

STATUS

public static final String[] STATUS

PRECONDITION_QOS

public static final int PRECONDITION_QOS
See Also:
Constant Field Values

PRECONDITION

public static final String[] PRECONDITION
Constructor Detail

PreconditionFields

public PreconditionFields()
Constructor

Method Detail

getPreconditionSize

public int getPreconditionSize()
Get the number of Precondition attributes

Returns:
int size of segmented precondition vector of attribute fields

getPreconditions

public Vector getPreconditions()
Get Precondition

Returns:
Vector of attribute fields (segmented precondition)

setPreconditions

public void setPreconditions(Vector preconditions)
                      throws SdpException
Set Preconditions

Parameters:
preconditions - - vector with precondition attributes
Throws:
SdpException - -- if precondition attributes is null

setPreconditionCurr

public void setPreconditionCurr(String precondCurrValue)
                         throws SdpException

Set attribute line for current precondition state, given a string value encoded like the "curr" attribute value

Parameters:
precondCurrValue - - a string with the value for a "curr" attribute
Throws:
SdpException

setPreconditionCurr

public void setPreconditionCurr(String status,
                                String directionTag)
                         throws SdpException

Set the value of the attributes with the name "curr" for current precondition.

- eg: a=curr:qos local none

If there is an attribute "curr" for the same status-type, the direction-tag is updated with the one supplied.

Parameters:
status - - (local, remote, e2e)
directionTag - - (none, send, recv, sendrecv)
Throws:
SdpParseException
SdpException

setPreconditionDes

public void setPreconditionDes(String precondDesValue)
                        throws SdpException

Set attribute line for desired precondition state, given a string value encoded like the "des" attribute value

Parameters:
precondDesValue - - a string with the value for a "des" attribute
Throws:
SdpException

setPreconditionDes

public void setPreconditionDes(String strength,
                               String status,
                               String direction)
                        throws SdpException

Set the value of the attributes with the name "des" for desired precondition.

- eg: a=des:qos mandatory remote sendrecv

There can be more than one desired precondition line for a status-type, specially if strength-tag is different.

If there is an attribute "des" for the same status-type, the strength-tag and direction-tag are updated with the ones supplied.

IETF RFC4032: strength should only be downgraded within SDP offers

Parameters:
strength - - (none, optional,
status - - (local, remote, e2e)
direction - - (none, send, recv, sendrecv)
Throws:
SdpParseException
SdpException

setPreconditionConfirmStatus

public void setPreconditionConfirmStatus(String precondConfValue)
                                  throws SdpException

Set attribute line for confirmation precondition request, given a string value encoded like the "conf" attribute value

Parameters:
precondConfValue - - a string with the value for a "conf" attribute
Throws:
SdpException

setPreconditionConfirmStatus

public void setPreconditionConfirmStatus(String status,
                                         String direction)
                                  throws SdpException

IETF RFC3312

"The confirmation status attribute carries threshold conditions for a media stream. When the status of network resources reach these conditions, the peer UA will send an update of the session description".

- eg: a=conf:qos remote sendrecv

Parameters:
status - - (e2e, local, remote)
direction - - (none, send, recv, sendrecv)
Throws:
SdpException - -- if param are null

getPreconditionCurr

public Vector getPreconditionCurr(String status)
                           throws SdpException,
                                  SdpParseException

Get the attribute fields with the name "curr" for current precondition.

One attribute field per status-type. (eg: a=curr:qos local none)

Parameters:
status - - (local, remote, e2e)
Returns:
a vector with the attribute field that match status-type (with only one element or null if none exists)
Throws:
SdpParseException
SdpException

getPreconditionDes

public Vector getPreconditionDes(String status)
                          throws SdpException,
                                 SdpParseException

Get the attribute fields with the name "des" for desired precondition

There can be more than one current precondition line for a status-type (with different direction-tag values), specially if strength-tag is different

Parameters:
status - - (local, remote, e2e)
Returns:
a vector with the attribute fields that match location-tag
Throws:
SdpParseException
SdpException

getPreconditionConfirmStatus

public Vector getPreconditionConfirmStatus()
                                    throws SdpException

Get the attribute fields with the name "conf" for confirmation precondition.

IETF RFC3312

"The confirmation status attribute carries threshold conditions for a media stream. When the status of network resources reach these conditions, the peer UA will send an update of the session description".

(eg: a=conf:qos remote sendrecv)

Returns:
a vector with the "conf" attribute fields
Throws:
SdpException

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

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