use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.
the class HeaderFactoryImpl method createSessionExpiresHeader.
/**
* Creates a new SessionExpiresHeader 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 SessionExpiresHeader object.
*
*/
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;
}
use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.
the class HeaderFactoryImpl method createPMediaAuthorizationHeader.
/**
* P-Media-Authorization header
* @param token - token string
* @return newly created P-Media-Authorizarion header
* @throws InvalidArgumentException
* @throws ParseException
*/
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);
return mediaAuthorization;
}
use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.
the class HeaderFactoryImpl method createExpiresHeader.
/**
* Creates a new ExpiresHeader 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.
*/
public ExpiresHeader createExpiresHeader(int expires) throws InvalidArgumentException {
if (expires < 0)
throw new InvalidArgumentException("bad value " + expires);
Expires e = new Expires();
e.setExpires(expires);
return e;
}
use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.
the class HeaderFactoryImpl method createMaxForwardsHeader.
/**
* Creates a new MaxForwardsHeader based on the newly
* supplied maxForwards value.
*
* @param maxForwards The new integer value of the maxForwards.
* @throws InvalidArgumentException if supplied maxForwards is less
* than zero or greater than 255.
* @return the newly created MaxForwardsHeader object.
*/
public MaxForwardsHeader createMaxForwardsHeader(int maxForwards) throws InvalidArgumentException {
if (maxForwards < 0 || maxForwards > 255)
throw new InvalidArgumentException("bad maxForwards arg " + maxForwards);
MaxForwards m = new MaxForwards();
m.setMaxForwards(maxForwards);
return m;
}
use of javax.sip.InvalidArgumentException in project XobotOS by xamarin.
the class HeaderFactoryImpl method createCSeqHeader.
/**
* Creates a new CSeqHeader based on the newly supplied sequence number and
* method values.
*
* @param sequenceNumber - the new integer value of the sequence number.
* @param method - the new string value of the method.
* @throws InvalidArgumentException if supplied sequence number is less
* than zero.
* @throws ParseException which signals that an error has been reached
* unexpectedly while parsing the method value.
* @return the newly created CSeqHeader object.
*/
public CSeqHeader createCSeqHeader(long sequenceNumber, String method) throws ParseException, InvalidArgumentException {
if (sequenceNumber < 0)
throw new InvalidArgumentException("bad arg " + sequenceNumber);
if (method == null)
throw new NullPointerException("null arg method");
CSeq cseq = new CSeq();
cseq.setMethod(method);
cseq.setSeqNumber(sequenceNumber);
return cseq;
}
Aggregations