Package javax.sip

Examples of javax.sip.InvalidArgumentException


     * @throws InvalidArgumentException if supplied value is less than zero or
     * greater than 255, excluding -1 the default not set value.
     */
    public void setTTL(int ttl) throws InvalidArgumentException {
        if (ttl < 0 && ttl != -1)
            throw new InvalidArgumentException(
                "JAIN-SIP Exception"
                    + ", Via, setTTL(), the ttl parameter is < 0");
        setParameter(new NameValue(ParameterNames.TTL, Integer.valueOf(ttl)));
    }
View Full Code Here




    public void setTimeStamp(float timeStamp) throws InvalidArgumentException {
        if (timeStamp < 0)
            throw new InvalidArgumentException(
                    "JAIN-SIP Exception, TimeStamp, "
                            + "setTimeStamp(), the timeStamp parameter is <0");
        this.timeStamp = -1;
        this.timeStampFloat = timeStamp;
    }
View Full Code Here

     *             <code>-1</code>.
     */

    public void setDelay(float delay) throws InvalidArgumentException {
        if (delay < 0 && delay != -1)
            throw new InvalidArgumentException(
                    "JAIN-SIP Exception, TimeStamp, "
                            + "setDelay(), the delay parameter is <0");
        this.delayFloat = delay;
        this.delay = -1;
    }
View Full Code Here

    }

    public void setTime(long timeStamp) throws InvalidArgumentException {
        if (timeStamp < -1)
            throw new InvalidArgumentException("Illegal timestamp");
        this.timeStamp = timeStamp;
        this.timeStampFloat = -1;

    }
View Full Code Here

    }

    public void setTimeDelay(int delay) throws InvalidArgumentException {
        if (delay < -1)
            throw new InvalidArgumentException("Value out of range " + delay);
        this.delay = delay;
        this.delayFloat = -1;

    }
View Full Code Here

     * set the Q-value parameter
     * @param qValue float to set
     */
    public void setQValue(float qValue) throws InvalidArgumentException {
        if (qValue != -1 && (qValue < 0 || qValue > 1))
            throw new InvalidArgumentException(
                "JAIN-SIP Exception, Contact, setQValue(), "
                    + "the qValue is not between 0 and 1");
        this.parameters.set(Q, Float.valueOf(qValue));
    }
View Full Code Here

      throw new NullPointerException(
          "Address for listening point is null!");
    if (transport == null)
      throw new NullPointerException("null transport");
    if (port <= 0)
      throw new InvalidArgumentException("bad port");

    if (!transport.equalsIgnoreCase("UDP")
        && !transport.equalsIgnoreCase("TLS")
        && !transport.equalsIgnoreCase("TCP")
        && !transport.equalsIgnoreCase("SCTP"))
      throw new TransportNotSupportedException("bad transport "
          + transport);

    /** Reusing an old stack instance */
    if (!this.isAlive()) {
      this.toExit = false;
      this.reInitialize();
    }

    String key = ListeningPointImpl.makeKey(address, port, transport);

    ListeningPointImpl lip = (ListeningPointImpl) listeningPoints.get(key);
    if (lip != null) {
      return lip;
    } else {
      try {
        InetAddress inetAddr = InetAddress.getByName(address);
        MessageProcessor messageProcessor = this
            .createMessageProcessor(inetAddr, port, transport);
        if (this.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
          this.getStackLogger().logDebug(
              "Created Message Processor: " + address
                  + " port = " + port + " transport = "
                  + transport);
        }
        lip = new ListeningPointImpl(this, port, transport);
        lip.messageProcessor = messageProcessor;
        messageProcessor.setListeningPoint(lip);
        this.listeningPoints.put(key, lip);
        // start processing messages.
        messageProcessor.start();
        return (ListeningPoint) lip;
      } catch (java.io.IOException ex) {
        if (isLoggingEnabled())
          getStackLogger().logError(
            "Invalid argument address = " + address + " port = "
                + port + " transport = " + transport);
        throw new InvalidArgumentException(ex.getMessage(), ex);
      }
    }
  }
View Full Code Here

    }

    public void setSeqNumber(long sequenceNumber) throws InvalidArgumentException {

            if (sequenceNumber <= 0 ||sequenceNumber > ((long)1)<<32 - 1)
                throw new InvalidArgumentException(
                    "Bad seq number " + sequenceNumber);
            this.sequenceNumber = sequenceNumber;

    }
View Full Code Here

     */
    public void setCode(int code) throws InvalidArgumentException {
        if (code >99  && code < 1000) { // check this is a 3DIGIT code
            this.code = code;
        } else
            throw new InvalidArgumentException(
                "Code parameter in the Warning header is invalid: code="
                    + code);
    }
View Full Code Here

    * @param expires - the new expires value of this SubscriptionStateHeader.
    * @throws InvalidArgumentException if supplied value is less than zero.
    */
    public void setExpires(int expires) throws InvalidArgumentException {
        if (expires < 0)
            throw new InvalidArgumentException(
                "JAIN-SIP "
                    + "Exception, SubscriptionState, setExpires(), the expires parameter is  < 0");
        this.expires = expires;
    }
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.