* @throws SdpException
*/
public void setPreconditionDes(String precondDesValue) throws SdpException
{
if (precondDesValue == null)
throw new SdpException("The Precondition \"des\" attribute value is null");
else if (preconditionAttributes == null)
throw new SdpException("The Precondition Attributes is null");
else
{
/* split the "des" attribute value into words
* attributes[0] = "qos"
* attributes[1] = strength-tag (unknown/failure/none/optional/mandatory)
* attributes[2] = status-type (e2e/local/remote)
* attributes[3] = direction-tag (none/send/recv/sendrecv)
*
* split() - regular expression:
* \s -> a whitespace character [ \t\n\x0B\f\r]
* \b -> a word boundary
*/
try
{
String[] attributes = precondDesValue.split(" ");
// which is this length?! of the string or the []?
/*
if (attributes.length < 4)
{
throw new SdpException
("The Precondition \"des\" attribute value mal-formed (<4words)");
}*/
setPreconditionDes( attributes[1], // strength-tag
attributes[2], // status-type
attributes[3] // direction-tag
);
}
catch (ArrayIndexOutOfBoundsException ex)
{
throw new SdpException
("Error spliting the \"des\" attribute into words", ex);
}
}
}