Package javax.sip

Examples of javax.sip.InvalidArgumentException


        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

        // then send INVITE+ACK later on
        if (!method.equals(Request.INVITE))
            throw new SipException("Dialog was not created with an INVITE" + method);

        if (cseqno <= 0)
            throw new InvalidArgumentException("bad cseq <= 0 ");
        else if (cseqno > ((((long) 1) << 32) - 1))
            throw new InvalidArgumentException("bad cseq > " + ((((long) 1) << 32) - 1));

        if (this.remoteTarget == null) {
            throw new SipException("Cannot create ACK - no remote Target!");
        }
View Full Code Here

         * responses numbered 101 to 199 may be sent reliably. If the request did not include
         * either a Supported or Require header field indicating this feature, the UAS MUST NOT
         * send the provisional response reliably.
         */
        if (statusCode <= 100 || statusCode > 199)
            throw new InvalidArgumentException("Bad status code ");
        SIPRequest request = this.originalRequest;
        if (!request.getMethod().equals(Request.INVITE))
            throw new SipException("Bad method");

        ListIterator<SIPHeader> list = request.getHeaders(SupportedHeader.NAME);
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 (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG)) {
          this.logger.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 (logger.isLoggingEnabled())
          logger.logError(
            "Invalid argument address = " + address + " port = "
                + port + " transport = " + transport);
        throw new InvalidArgumentException(ex.getMessage(), ex);
      }
    }
  }
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()) {
          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

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.