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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations