Package javax.sdp

Examples of javax.sdp.SdpException


     * @param id  the session id.
     * @throws SdpException if the id is <0
     */
    public void setSessionId(long id) throws SdpException {
        if (id < 0)
            throw new SdpException("The is parameter is <0");
        else
            setSessId(id);
    }
View Full Code Here


     * @param version  the session version.
     * @throws SdpException if the version is <0
     */
    public void setSessionVersion(long version) throws SdpException {
        if (version < 0)
            throw new SdpException("The version parameter is <0");
        else
            setSessVersion(version);
    }
View Full Code Here

     * @param addr  string address type.
     * @throws SdpException if the addr is null
     */
    public void setAddress(String addr) throws SdpException {
        if (addr == null)
            throw new SdpException("The addr parameter is null");
        else {
            Host host = getHost();
            if (host == null)
                host = new Host();
            host.setAddress(addr);
View Full Code Here

     * @param type the string network type.
     * @throws SdpException if the type is null
     */
    public void setAddressType(String type) throws SdpException {
        if (type == null)
            throw new SdpException("The type parameter is <0");
        else
            setAddrtype(type);
    }
View Full Code Here

     * @param type  the string network type.
     * @throws SdpException if the type is null
     */
    public void setNetworkType(String type) throws SdpException {
        if (type == null)
            throw new SdpException("The type parameter is <0");
        else
            setNettype(type);
    }
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

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.