/** set the specified parameter * @param name String to set * @param value Object to set */ public void setParm(String name, Object value) { NameValue nv = new NameValue(name, value); parameters.set(nv); }
/** * Set a given URI parameter. Note - parameter must be properly * encoded before the function is called. * @param name Name of the parameter to set. * @param value value of the parameter to set. */ public void setUriParm(String name, Object value) { NameValue nv = new NameValue(name, value); uriParms.set(nv); }
/** * Sets the value of the stale parameter of the WWWAuthenicateHeader to the * <var>stale</var> parameter value. * * @param stale - * the Boolean.valueOf value of the stale parameter. * @since v1.1 */ public void setStale(boolean stale) { setParameter(new NameValue(ParameterNames.STALE, Boolean.valueOf(stale))); }
/** set the PostDial field * @param p String to set */ public void setPostDial(String p) { NameValue nv = new NameValue(POSTDIAL, p); parameters.set(nv); }
/** * Set a namevalue object in this list. */ public void set(String name, Object value) { NameValue nameValue = new NameValue(name, value); nameValueMap.put(name.toLowerCase(), nameValue); }
/** Sets the value of the specified header fields to be included in a * request constructed from the URI. If the header already had a value it * will be overwritten. * * @param name - a String specifying the header name * @param value - a String specifying the header value */ public void setHeader(String name, String value) { NameValue nv = new NameValue(name, value); qheaders.set(nv); }
/** * Set a namevalue object in this list. */ public void set(String name, Object value) { NameValue nameValue = new NameValue(name, value); this.put(name.toLowerCase(), nameValue); }
public void setParameter(String name, String value) { NameValue nv = new NameValue(name, value); this.parameters.set(nv); }
/** Sets the value of the <code>ttl</code> parameter. The ttl parameter * specifies the time-to-live value when packets are sent using UDP * multicast. This is equivalent to setParameter("ttl", ttl). * * @param ttl - new value of the <code>ttl</code> parameter */ public void setTTLParam(int ttl) { if (ttl <= 0) throw new IllegalArgumentException("Bad ttl value"); if (uriParms != null) { NameValue nv = new NameValue("ttl", Integer.valueOf(ttl)); uriParms.set(nv); } }
/** * Sets the value of the ttl parameter. The ttl parameter specifies the * time-to-live value when packets are sent using UDP multicast. * * @param ttl - new value of the ttl parameter * @throws InvalidArgumentException if supplied value is less than zero or * greater than 255, excluding -1 the default not set value. */ public void setTTL(int ttl) throws InvalidArgumentException { if (ttl < 0 && ttl != -1) throw new InvalidArgumentException( "JAIN-SIP Exception" + ", Via, setTTL(), the ttl parameter is < 0"); setParameter(new NameValue(ParameterNames.TTL, Integer.valueOf(ttl))); }
/** Set the default parameters for this URI. * Do nothing if the parameter is already set to some value. * Otherwise set it to the given value. * @param name Name of the parameter to set. * @param value value of the parameter to set. */ public void setDefaultParm(String name, Object value) { if (uriParms.getValue(name) == null) { NameValue nv = new NameValue(name, value); uriParms.set(nv); } }
/** * Get a name value for a given query header (ie one that comes * after the ?). */ protected NameValue qheader() throws ParseException { String name = lexer.getNextToken('='); lexer.consume(1); String value = hvalue(); return new NameValue(name, value, false); }
/** * Allow for null value when setting the value. * * @param value -- can be null. */ public void setValueAllowNull(String value) { NameValue nameValue = getAttribute(); if (nameValue == null) nameValue = new NameValue(); nameValue.setValueAsObject(value); setAttribute(nameValue); }
/** * Get a name value for a given query header (ie one that comes * after the ?). */ protected NameValue qheader() throws ParseException { String name = lexer.getNextToken('='); lexer.consume(1); String value = hvalue(); return new NameValue(name, value, false); }
/** Set a parameter. */ public void setParameter(String name, String value) throws ParseException { NameValue nv = parameters.getNameValue(name); if (nv != null) { nv.setValueAsObject(value); } else { nv = new NameValue(name, value); if (name.equalsIgnoreCase("methods")) nv.setQuotedValue(); this.parameters.set(nv); } }
/** * Introduced specifically for the P-Charging-Function-Addresses Header and * all other headers that may have multiple header parameters of the same name, but * with multiple possible values. * * Example: P-Charging-Function-Addresses: ccf=[5555::b99:c88:d77:e66]; ccf=[5555::a55:b44:c33:d22]; * ecf=[5555::1ff:2ee:3dd:4cc]; ecf=[5555::6aa:7bb:8cc:9dd] * @param name of the parameter * @param value of the parameter */ public void setMultiParameter(String name, String value) { NameValue nv = new NameValue(); nv.setName(name); nv.setValue(value); duplicates.set(nv); }
/** Sets the value of this attribute. * @param value the - attribute value * @throws SdpException if the value is null. */ public void setValue(String value) throws SdpException { if (value == null) throw new SdpException("The value is null"); else { NameValue nameValue = getAttribute(); if (nameValue == null) nameValue = new NameValue(); nameValue.setValueAsObject(value); setAttribute(nameValue); } }
/** Sets the id of this attribute. * @param name the string name/id of the attribute. * @throws SdpException if the name is null */ public void setName(String name) throws SdpException { if (name == null) throw new SdpException("The name is null"); else { NameValue nameValue = getAttribute(); if (nameValue == null) nameValue = new NameValue(); nameValue.setName(name); setAttribute(nameValue); } }
/** * Set the MADDR parameter . * @param mAddr Host Name to set */ public void setMAddr(String mAddr) { NameValue nameValue = uriParms.getNameValue(MADDR); Host host = new Host(); host.setAddress(mAddr); if (nameValue != null) nameValue.setValueAsObject(host); else { nameValue = new NameValue(MADDR, host); uriParms.set(nameValue); } }
/** * Parses the 'phone-context' parameter in tel: URLs * @throws ParseException */ private NameValue phone_context() throws ParseException { lexer.match('='); char la = lexer.lookAhead(0); Object value; if (la=='+') {// global-number-digits lexer.consume(1);// skip '+' value = "+" + base_phone_number(); } else if ( Lexer.isAlphaDigit(la) ) { Token t = lexer.match( Lexer.ID );// more broad than allowed value = t.getTokenValue(); } else { throw new ParseException( "Invalid phone-context:" + la , -1 ); } return new NameValue( "phone-context", value, false ); }