public void setTime(long timeStamp) throws InvalidArgumentException { if (timeStamp < -1) throw new InvalidArgumentException("Illegal timestamp"); this.timeStamp = timeStamp; this.timeStampFloat = -1; }
public void setCSequenceNumber(long cSeqNumber) throws InvalidArgumentException { if (cSeqNumber <= 0 || cSeqNumber > ((long) 1) << 32 - 1) throw new InvalidArgumentException("Bad CSeq # " + cSeqNumber); this.cSeqNumber = cSeqNumber; }
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; }
/** * Set the maxForwards member * @param maxForwards maxForwards parameter to set */ public void setMaxForwards(int maxForwards) throws InvalidArgumentException { if (maxForwards < 0 || maxForwards > 255) throw new InvalidArgumentException( "bad max forwards value " + maxForwards); this.maxForwards = maxForwards; }
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; }
public void setTimeDelay(int delay) throws InvalidArgumentException { if (delay < -1) throw new InvalidArgumentException("Value out of range " + delay); this.delay = delay; this.delayFloat = -1; }
public void setRSequenceNumber(long rSeqNumber) throws InvalidArgumentException { if (rSeqNumber <= 0 || cSeqNumber > ((long) 1) << 32 - 1) throw new InvalidArgumentException("Bad rSeq # " + rSeqNumber); this.rSeqNumber = rSeqNumber; } }
/** * Sets code of WarningHeader * @param code int to set * @throws SipParseException if code is not accepted by implementation */ 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); }
/** * Sets the relative expires value of the SubscriptionStateHeader. The * expires value MUST be greater than zero and MUST be less than 2**31. * * @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; }
public void setSeqNumber(long sequenceNumber) throws InvalidArgumentException { if (sequenceNumber < 0 ) throw new InvalidArgumentException( "JAIN-SIP Exception, CSeq, setSequenceNumber(), " + "the sequence number parameter is < 0 : " + sequenceNumber); else if ( sequenceNumber > ((long)1)<<32 - 1) throw new InvalidArgumentException( "JAIN-SIP Exception, CSeq, setSequenceNumber(), " + "the sequence number parameter is too large : " + sequenceNumber); seqno = Long.valueOf(sequenceNumber); }
/** * Set the contentLength member * @param contentLength int to set */ public void setContentLength(int contentLength) throws InvalidArgumentException { if (contentLength < 0) throw new InvalidArgumentException( "JAIN-SIP Exception" + ", ContentLength, setContentLength(), the contentLength parameter is <0"); this.contentLength = Integer.valueOf(contentLength); }
/** * Set the media authorization token. * * @param token - media authorization token to set * @throws InvalidArgumentException - if token is null or empty */ public void setMediaAuthorizationToken(String token) throws InvalidArgumentException { if (token == null || token.length() == 0) throw new InvalidArgumentException(" the Media-Authorization-Token parameter is null or empty"); this.token = token; }
/** * Set Server Port (port-s parameter) * @param portS - port-s value * @throws InvalidArgumentException - when value is not valid */ public void setPortServer(int portS) throws InvalidArgumentException { if (portS < 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SecurityClient, setPortServer(), the port-s parameter is <0"); setParameter(ParameterNamesIms.PORT_S, portS); }
/** * Set Client SPI (spi-c parameter) * @param spic - spi-c value * @throws InvalidArgumentException */ public void setSPIClient(int spic) throws InvalidArgumentException { if (spic < 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SecurityClient, setSPIClient(), the spi-c parameter is <0"); setParameter(ParameterNamesIms.SPI_C, spic); }
/** * 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)); }
/** * Set Client Port (port-c parameter) * @param portC - port-c value * @throws InvalidArgumentException - when value is not valid */ public void setPortClient(int portC) throws InvalidArgumentException { if (portC < 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SecurityClient, setPortClient(), the port-c parameter is <0"); setParameter(ParameterNamesIms.PORT_C, portC); }
/** * Set Server SPI (spi-s parameter) * @param spis - spi-s value * @throws InvalidArgumentException - when value is not valid */ public void setSPIServer(int spis) throws InvalidArgumentException { if (spis < 0) throw new InvalidArgumentException( "JAIN-SIP " + "Exception, SecurityClient, setSPIServer(), the spi-s parameter is <0"); setParameter(ParameterNamesIms.SPI_S, spis); }
/** * Sets the duration value of the RetryAfterHeader. The retry after value * MUST be greater than zero and MUST be less than 2**31. * * @param duration - the new duration value of this RetryAfterHeader * @throws InvalidArgumentException if supplied value is less than zero. * */ public void setDuration(int duration) throws InvalidArgumentException { if (duration < 0) throw new InvalidArgumentException("the duration parameter is <0"); this.setParameter(DURATION, duration); }
/** * Set the qvalue member * * @param q * double to set */ public void setQValue(float q) throws InvalidArgumentException { if (q < 0.0 || q > 1.0) throw new InvalidArgumentException("qvalue out of range!"); super.setParameter("q", q); }
/** * Set the port part of this ViaHeader to the newly supplied <code>port</code> * parameter. * * @param port - the Integer.valueOf value of the port of this ViaHeader */ public void setPort(int port) throws InvalidArgumentException { if ( port!=-1 && (port<1 || port>65535)) { throw new InvalidArgumentException( "Port value out of range -1, [1..65535]" ); } if (sentBy == null) sentBy = new HostPort(); sentBy.setPort(port); }