Package javax.sip

Examples of javax.sip.InvalidArgumentException


   * @since v1.1
   */
  public MinExpiresHeader createMinExpiresHeader(int minExpires)
    throws InvalidArgumentException {
    if (minExpires < 0)
      throw new InvalidArgumentException("bad minExpires " + minExpires);
    MinExpires min = new MinExpires();
    min.setExpires(minExpires);

    return min;
  }
View Full Code Here


   * pmusgrave
   */
  public ExtensionHeader createMinSEHeader(int expires)
    throws InvalidArgumentException {
    if (expires < 0)
      throw new InvalidArgumentException("bad value " + expires);
    MinSE e = new MinSE();
    e.setExpires(expires);

    return e;
  }
View Full Code Here

    String method)
    throws InvalidArgumentException, ParseException {
    if (method == null)
      throw new NullPointerException("Bad method");
    if (cSeqNumber < 0 || rSeqNumber < 0)
      throw new InvalidArgumentException("bad cseq/rseq arg");
    RAck rack = new RAck();
    rack.setMethod(method);
    rack.setCSequenceNumber(cSeqNumber);
    rack.setRSequenceNumber(rSeqNumber);
View Full Code Here

   * @since v1.1
   */
  public RSeqHeader createRSeqHeader(long sequenceNumber)
    throws InvalidArgumentException {
    if (sequenceNumber < 0)
      throw new InvalidArgumentException(
        "invalid sequenceNumber arg " + sequenceNumber);
    RSeq rseq = new RSeq();
    rseq.setSeqNumber(sequenceNumber);

    return rseq;
View Full Code Here

    String text)
    throws InvalidArgumentException, ParseException {
    if (protocol == null)
      throw new NullPointerException("bad protocol arg");
    if (cause < 0)
      throw new InvalidArgumentException("bad cause");
    Reason reason = new Reason();
    reason.setProtocol(protocol);
    reason.setCause(cause);
    reason.setText(text);
View Full Code Here

   * @return the newly created RetryAfterHeader object.
   */
  public RetryAfterHeader createRetryAfterHeader(int retryAfter)
    throws InvalidArgumentException {
    if (retryAfter < 0)
      throw new InvalidArgumentException("bad retryAfter arg");
    RetryAfter r = new RetryAfter();
    r.setRetryAfter(retryAfter);

    return r;
  }
View Full Code Here

   */
  public PMediaAuthorizationHeader createPMediaAuthorizationHeader(String token)
    throws InvalidArgumentException, ParseException
  {
    if (token == null || token == "")
      throw new InvalidArgumentException("The Media-Authorization-Token parameter is null or empty");


    PMediaAuthorization mediaAuthorization = new PMediaAuthorization();
    mediaAuthorization.setMediaAuthorizationToken(token);

View Full Code Here

   *
   */
  public SessionExpiresHeader createSessionExpiresHeader(int expires)
    throws InvalidArgumentException {
    if (expires < 0)
      throw new InvalidArgumentException("bad value " + expires);
    SessionExpires s = new SessionExpires();
    s.setExpires(expires);

    return s;
  }
View Full Code Here

     
        }
          else
          {
            try {
            throw new InvalidArgumentException("Value can be either reg or unreg");
          } catch (InvalidArgumentException e) {
               e.printStackTrace();
            }
          }
       
View Full Code Here

             {
                String serviceID = urn.split(ParameterNamesIms.SERVICE_ID_LABEL+".")[1];
               
                 if(serviceID.trim().equals(""))
            try {
              throw new InvalidArgumentException("URN should atleast have one sub-service");
            } catch (InvalidArgumentException e) {
             
              e.printStackTrace();
            }
            else
                pps.setSubserviceIdentifiers(urn.split(ParameterNamesIms.SERVICE_ID_LABEL)[1]);
             }
         else if(urn.contains(ParameterNamesIms.APPLICATION_ID_LABEL))
          {
           String appID = urn.split(ParameterNamesIms.APPLICATION_ID_LABEL+".")[1];
           if(appID.trim().equals(""))
          try {
            throw new InvalidArgumentException("URN should atleast have one sub-application");
          } catch (InvalidArgumentException e) {
            e.printStackTrace();
          }
          else
            pps.setApplicationIdentifiers(urn.split(ParameterNamesIms.APPLICATION_ID_LABEL)[1]);
          }
         else
         {
           try {
        throw new InvalidArgumentException("URN is not well formed");
       
      } catch (InvalidArgumentException e) {
        e.printStackTrace();
              }
                }
View Full Code Here

TOP

Related Classes of javax.sip.InvalidArgumentException

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.