Search in sources :

Example 6 with InvalidArgumentException

use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.

the class TimeStamp method setTimeStamp.

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;
}
Also used : InvalidArgumentException(javax.sip.InvalidArgumentException)

Example 7 with InvalidArgumentException

use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.

the class HeaderFactoryImpl method createMinSEHeader.

/**
     * Creates a new MinSEHeader based on the newly supplied expires value.
     *
     * @param expires - the new integer value of the expires.
     * @throws InvalidArgumentException if supplied expires is less
     * than zero.
     * @return the newly created ExpiresHeader object.
     *
     * TODO: Once interfaces are in javax, change the type to MinSEHeader
     * and add to HeaderFactory. - pmusgrave
     *
     * 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;
}
Also used : InvalidArgumentException(javax.sip.InvalidArgumentException)

Example 8 with InvalidArgumentException

use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.

the class HeaderFactoryImpl method createRSeqHeader.

/**
     * Creates a new RSeqHeader based on the newly supplied sequenceNumber value.
     *
     * @param sequenceNumber - the new integer value of the sequenceNumber.
     * @throws InvalidArgumentException if supplied sequenceNumber is
     * less than zero or greater than than 2**31-1.
     * @return the newly created RSeqHeader object.
     * @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;
}
Also used : InvalidArgumentException(javax.sip.InvalidArgumentException)

Example 9 with InvalidArgumentException

use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.

the class HeaderFactoryImpl method createMimeVersionHeader.

/**
     * Creates a new MimeVersionHeader based on the newly
     * supplied mimeVersion value.
     *
     * @param majorVersion - the new integer value of the majorVersion.
     * @param minorVersion - the new integer value of the minorVersion.
     * @throws InvalidArgumentException if supplied mimeVersion is less
     * than zero.
     * @return the newly created MimeVersionHeader object.
     * @since v1.1
     */
public MimeVersionHeader createMimeVersionHeader(int majorVersion, int minorVersion) throws InvalidArgumentException {
    if (majorVersion < 0 || minorVersion < 0)
        throw new javax.sip.InvalidArgumentException("bad major/minor version");
    MimeVersion m = new MimeVersion();
    m.setMajorVersion(majorVersion);
    m.setMinorVersion(minorVersion);
    return m;
}
Also used : InvalidArgumentException(javax.sip.InvalidArgumentException)

Example 10 with InvalidArgumentException

use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.

the class HeaderFactoryImpl method createMinExpiresHeader.

/**
     * Creates a new MinExpiresHeader based on the newly supplied minExpires value.
     *
     * @param minExpires - the new integer value of the minExpires.
     * @throws InvalidArgumentException if supplied minExpires is less
     * than zero.
     * @return the newly created MinExpiresHeader object.
     * @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;
}
Also used : InvalidArgumentException(javax.sip.InvalidArgumentException)

Aggregations

InvalidArgumentException (javax.sip.InvalidArgumentException)38 ParseException (java.text.ParseException)10 IOException (java.io.IOException)9 SipException (javax.sip.SipException)9 SipURI (javax.sip.address.SipURI)7 SIPRequest (gov.nist.javax.sip.message.SIPRequest)6 Via (gov.nist.javax.sip.header.Via)5 From (gov.nist.javax.sip.header.From)4 To (gov.nist.javax.sip.header.To)4 DialogDoesNotExistException (javax.sip.DialogDoesNotExistException)4 ObjectInUseException (javax.sip.ObjectInUseException)4 TransactionDoesNotExistException (javax.sip.TransactionDoesNotExistException)4 CSeq (gov.nist.javax.sip.header.CSeq)3 ClientTransaction (javax.sip.ClientTransaction)3 Hop (javax.sip.address.Hop)3 Request (javax.sip.message.Request)3 ListeningPointImpl (gov.nist.javax.sip.ListeningPointImpl)2 MaxForwards (gov.nist.javax.sip.header.MaxForwards)2 SIPHeader (gov.nist.javax.sip.header.SIPHeader)2 TimeStamp (gov.nist.javax.sip.header.TimeStamp)2