/** * Sets the value of the <code>maddr</code> parameter of this ViaHeader. The * maddr parameter indicates the server address to be contacted for this * user, overriding any address derived from the host field. * * @param mAddr new value of the <code>maddr</code> parameter * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the mAddr value. */ public void setMAddr(String mAddr) throws ParseException { if (mAddr == null) throw new NullPointerException( "JAIN-SIP Exception, " + "Via, setMAddr(), the mAddr parameter is null."); Host host = new Host(); host.setAddress(mAddr); NameValue nameValue = new NameValue(ParameterNames.MADDR, host); setParameter(nameValue); }
/** Sets the type of the address for this Connection. * @param addr string address type. * @throws SdpException if the addr is null */ public void setAddress(String addr) throws SdpException { if (addr == null) throw new SdpException("The addr parameter is null"); else { Host host = getHost(); if (host == null) host = new Host(); host.setAddress(addr); setAddress(host); } }
/** * 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); } }
/** Sets the type of the address for this Connection. * @param addr to set * @throws SdpException if the type is null */ public void setAddress(String addr) throws SdpException { if (addr == null) throw new SdpException("the addr is null"); else { if (address == null) { address = new ConnectionAddress(); Host host = new Host(addr); address.setAddress(host); } else { Host host = address.getAddress(); if (host == null) { host = new Host(addr); address.setAddress(host); } else host.setAddress(addr); } setAddress(address); } }