Package javax.sdp

Examples of javax.sdp.SdpException


     * @throws SdpException -- if precondition attributes is null
     */
    public void setPreconditions(Vector preconditions) throws SdpException
    {
        if (preconditions == null)
            throw new SdpException("Precondition attributes are null");
        else
            preconditionAttributes = preconditions;
    }
View Full Code Here


     * @throws SdpException
     */
    public void setPreconditionCurr(String precondCurrValue) throws SdpException
    {
        if (precondCurrValue == null)
            throw new SdpException("The Precondition \"curr\" attribute value is null");
        else if (preconditionAttributes == null)
            throw new SdpException("The Precondition Attributes is null");
        else
        {
            try
            {
                /* split the "curr" attribute value into words
                 *      attributes[0] = "qos"
                 *      attributes[1] = status-type   (e2e/local/remote)
                 *      attributes[2] = direction-tag (none/send/recv/sendrecv)
                 *
                 * split() - regular expression:
                 *      \s -> a whitespace character [ \t\n\x0B\f\r]
                 *      \b -> a word boundary
                 */
                String[] attributes = precondCurrValue.split(" ");


                // which is this length?! of the string or the []?
                /*
                if (attributes.length < 3)
                {
                    throw new SdpException
                        ("The Precondition \"curr\" attribute value mal-formed (<3words)");
                }*/

                setPreconditionCurr(attributes[1],      // status-type
                                    attributes[2]       // direction-tag
                                );
            }
            catch (ArrayIndexOutOfBoundsException ex)
            {
                throw new SdpException
                    ("Error spliting the \"curr\" attribute into words", ex);
            }
        }
    }
View Full Code Here

     */
    public void setPreconditionCurr(String status, String directionTag)
        throws SdpException
    {
        if (status == null)
            throw new SdpException("The status-type is null");
        if (directionTag == null)
            throw new SdpException("The direction-tag is null");

        if (preconditionAttributes == null)
            throw new SdpException("Precondition Attributes is null");

        int i = 0;
        // search for attributes "curr"
        for (i = 0; i < preconditionAttributes.size(); i++)
        {
View Full Code Here

     * @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);
            }
        }
    }
View Full Code Here

     */
    public void setPreconditionDes(String strength, String status, String direction)
        throws SdpException
    {
        if (strength == null)
            throw new SdpException("The strength-tag is null");
        if (status == null)
            throw new SdpException("The status-type is null");
        if (direction == null)
            throw new SdpException("The direction-tag is null");

        if (preconditionAttributes == null)
            throw new SdpException("Precondition Attributes is null");

        int i = 0;
        // search for attributes "des"
        for (i = 0; i < preconditionAttributes.size(); i++)
        {
View Full Code Here

     */
    public void setPreconditionConfirmStatus(String precondConfValue)
        throws SdpException
    {
        if (precondConfValue == null || precondConfValue.length()==0)
            throw new SdpException("The Precondition \"conf\" attribute value is null");
        else if (preconditionAttributes == null)
            throw new SdpException("The Precondition Attributes is null");
        else
        {
            /* split the "conf" attribute value into words
             *      attributes[0] = "qos"
             *      attributes[1] = status-type   (e2e/local/remote)
             *      attributes[2] = direction-tag (none/send/recv/sendrecv)
             */
            try
            {
                String[] attributes = precondConfValue.split(" ");

                setPreconditionConfirmStatus(
                                    attributes[1],      // status-type
                                    attributes[2]       // direction-tag
                                );
            }
            catch (ArrayIndexOutOfBoundsException ex)
            {
                throw new SdpException
                    ("Error spliting the \"conf\" attribute into words", ex);
            }
        }
    }
View Full Code Here

     */
    public void setPreconditionConfirmStatus(String status, String direction)
        throws SdpException
    {
        if (status == null || direction.length()==0)
            throw new SdpException("The status-type is null");
        if (direction == null || direction.length()==0)
            throw new SdpException("The direction-tag is null");

        if (preconditionAttributes == null)
            throw new SdpException("Precondition Attributes is null");

        int i = 0;
        // search for attributes "conf"
        for (i = 0; i < preconditionAttributes.size(); i++)
        {
View Full Code Here

     */
    public Vector getPreconditionCurr(String status)
        throws SdpException, SdpParseException
    {
        if (status == null)
            throw new SdpException("The status-type is null");

        if (preconditionAttributes == null)
            return null;
        else
        {
View Full Code Here

     */
    public Vector getPreconditionDes(String status)
        throws SdpException, SdpParseException
    {
        if (status == null)
            throw new SdpException("The status-type is null");

        if (preconditionAttributes == null)
            return null;
        else
        {
View Full Code Here

     * @param user the string username.
     * @throws SdpException if the parameter is null
     */
    public void setUsername(String user) throws SdpException {
        if (user == null)
            throw new SdpException("The user parameter is null");
        else {
            this.username = user;
        }
    }
View Full Code Here

TOP

Related Classes of javax.sdp.SdpException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.