use of gov.nist.core.Host in project XobotOS by xamarin.
the class Via method setMAddr.
/**
* 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);
}
use of gov.nist.core.Host in project XobotOS by xamarin.
the class Via method setHost.
/**
* Set the host part of this ViaHeader to the newly supplied <code>host</code>
* parameter.
*
* @throws ParseException which signals that an error has been reached
* unexpectedly while parsing the host value.
*/
public void setHost(String host) throws ParseException {
if (sentBy == null)
sentBy = new HostPort();
try {
Host h = new Host(host);
sentBy.setHost(h);
} catch (Exception e) {
throw new NullPointerException(" host parameter is null");
}
}
use of gov.nist.core.Host in project XobotOS by xamarin.
the class MessageChannel method getViaHostPort.
/**
* Get the via header host:port structure. This is extracted from the topmost via header of
* the request.
*
* @return a host:port structure
*/
public HostPort getViaHostPort() {
HostPort retval = new HostPort();
retval.setHost(new Host(this.getViaHost()));
retval.setPort(this.getViaPort());
return retval;
}
use of gov.nist.core.Host in project XobotOS by xamarin.
the class MessageChannel method getHostPort.
/**
* Get the hostport structure of this message channel.
*/
public HostPort getHostPort() {
HostPort retval = new HostPort();
retval.setHost(new Host(this.getHost()));
retval.setPort(this.getPort());
return retval;
}
use of gov.nist.core.Host in project XobotOS by xamarin.
the class MessageProcessor method setSentBy.
/**
* Set the sentby string. This is used for stamping outgoing messages sent
* from this listening point.
*
* @param sentBy
*/
public void setSentBy(String sentBy) throws ParseException {
int ind = sentBy.indexOf(":");
if (ind == -1) {
this.sentByHostPort = new HostPort();
this.sentByHostPort.setHost(new Host(sentBy));
} else {
this.sentByHostPort = new HostPort();
this.sentByHostPort.setHost(new Host(sentBy.substring(0, ind)));
String portStr = sentBy.substring(ind + 1);
try {
int port = Integer.parseInt(portStr);
this.sentByHostPort.setPort(port);
} catch (NumberFormatException ex) {
throw new ParseException("Bad format encountered at ", ind);
}
}
this.sentBySet = true;
this.sentBy = sentBy;
}
Aggregations