Methods Summary |
---|
public AuthorizationHeader | createAuthorizationHeader(java.lang.String scheme)Creates a new AuthorizationHeader based on the newly supplied
scheme value.
if (scheme == null)
throw new NullPointerException("null arg scheme ");
AuthorizationHeader auth = new AuthorizationHeader();
auth.setScheme(scheme);
return auth;
|
public CSeqHeader | createCSeqHeader(int sequenceNumber, java.lang.String method)Creates a new CSeqHeader based on the newly supplied sequence number and
method values.
if (sequenceNumber < 0)
throw new IllegalArgumentException
("bad arg " + sequenceNumber);
if (method == null)
throw new NullPointerException("null arg method");
CSeqHeader cseq = new CSeqHeader();
cseq.setMethod(method);
cseq.setSequenceNumber(sequenceNumber);
return cseq;
|
public CallIdHeader | createCallId(java.lang.String callId)Creates a new CallIdHeader based on the newly supplied callId value.
if (callId == null)
throw new NullPointerException("null arg callId");
CallIdHeader c = new CallIdHeader();
c.setCallId(callId);
return c;
|
public ContactHeader | createContactHeader(Address address)Creates a new ContactHeader based on the newly supplied address value.
if (address == null)
throw new NullPointerException("null arg address");
ContactHeader contact = new ContactHeader();
contact.setAddress(address);
return contact;
|
public ContactHeader | createContactHeader()Creates a new wildcard ContactHeader. This is used in Register requests
to indicate to the server that it should remove all locations the
at which the user is currently available. This implies that the
following conditions are met:
ContactHeader.getAddress.getAddress.getUserInfo() == *;
ContactHeader.getAddress.getAddress.isWildCard() == true;
ContactHeader.getExpiresHeader() == 0;
ContactHeader contact = new ContactHeader();
contact.setWildCardFlag(true);
contact.setExpires(0);
return contact;
|
public ContentLengthHeader | createContentLengthHeader(int contentLength)Creates a new CSeqHeader based on the newly supplied contentLength value.
if (contentLength < 0)
throw new IllegalArgumentException("bad contentLength");
ContentLengthHeader c = new ContentLengthHeader();
c.setContentLength(contentLength);
return c;
|
public ContentTypeHeader | createContentTypeHeader(java.lang.String contentType, java.lang.String contentSubType)Creates a new ContentTypeHeader based on the newly supplied
contentType and contentSubType values.
if (contentType == null || contentSubType == null)
throw new NullPointerException("null contentType or subType");
ContentTypeHeader c = new ContentTypeHeader();
c.setContentType(contentType);
c.setContentSubType(contentSubType);
return c;
|
public DateHeader | createDateHeader(java.util.Calendar date)Creates a new DateHeader based on the newly supplied date value.
DateHeader d = new DateHeader();
if (date == null)
throw new NullPointerException("null date");
d.setDate(date);
return d;
|
public EventHeader | createEventHeader(java.lang.String eventType)Creates a new EventHeader based on the newly supplied eventType value.
if (eventType == null)
throw new NullPointerException("null eventType");
EventHeader event = new EventHeader();
event.setEventType(eventType);
return event;
|
public ExpiresHeader | createExpiresHeader(int expires)Creates a new ExpiresHeader based on the newly supplied expires value.
if (expires < 0)
throw new IllegalArgumentException("bad value " + expires);
ExpiresHeader e = new ExpiresHeader();
e.setExpires(expires);
return e;
|
public ExtensionHeader | createExtensionHeader(java.lang.String name, java.lang.String value)Creates a new ExtensionHeader based on the newly supplied name and
value values.
if (name == null)
throw new NullPointerException("bad name");
ExtensionHeader ext = new ExtensionHeader();
ext.setHeaderName(name);
ext.setValue(value);
return ext;
|
public FromHeader | createFromHeader(Address address, java.lang.String tag)Creates a new FromHeader based on the newly supplied address and
tag values.
if (address == null)
throw new NullPointerException("null address arg");
FromHeader from = new FromHeader();
from.setAddress(address);
if (tag != null) from.setTag(tag);
return from;
|
public Header | createHeader(java.lang.String headerName, java.lang.String headerValue)Create and parse a header.
if (headerName == null)
throw new NullPointerException("header name is null");
String expandedHeaderName = NameMap.expandHeaderName(headerName);
if (Header.isParameterLess(expandedHeaderName)) {
// The header can't have any parameters
// System.out.println("> '" + headerName + "' parameter-less");
ParameterLessHeader retval = new ParameterLessHeader();
retval.setHeaderName(headerName);
retval.setValue(headerValue);
return retval;
}
String hdrText = new StringBuffer().append(headerName)
.append(":").append(headerValue).toString();
Class clazz = NameMap.getClassFromName(expandedHeaderName);
if (clazz == null) {
// ExtensionHeader - can have some parameters
clazz = ExtensionHeader.clazz;
}
Exception ex = null;
try {
if (headerValue == null) {
Header retval = (Header) clazz.newInstance();
retval.setHeaderName(headerName);
}
} catch (InstantiationException ie) {
ex = ie;
} catch (IllegalAccessException iae) {
ex = iae;
}
if (ex != null) {
// print system message and exit
InternalErrorHandler.handleException(ex);
return null;
}
StringMsgParser smp = new StringMsgParser();
Header sipHeader = smp.parseHeader(hdrText);
if (sipHeader instanceof HeaderList) {
if (((HeaderList) sipHeader).size() > 1)
throw new ParseException("Only signleton allowed !", 0);
else {
// We have to preserve the original header's name
// (it might be given in a copact form)
Enumeration li = ((HeaderList) sipHeader).getElements();
while (li.hasMoreElements()) {
Header header = (Header) li.nextElement();
header.setHeaderName(headerName);
}
return (Header) ((HeaderList) sipHeader).first();
}
} else {
// We have to preserve the original header's name
// (it might be given in a copact form)
sipHeader.setHeaderName(headerName);
return sipHeader;
}
|
public java.util.Vector | createHeaders(java.lang.String headers)Create and return a list of headers.
if (headers == null)
throw new NullPointerException("null arg!");
StringMsgParser smp = new StringMsgParser();
Header shdr = smp.parseHeader(headers);
if (shdr instanceof HeaderList)
return ((HeaderList) shdr).getHeaders();
else throw new ParseException
("List of headers of this type is not allowed in a message", 0);
|
public MaxForwardsHeader | createMaxForwardsHeader(int maxForwards)Creates a new MaxForwardsHeader based on the newly
supplied maxForwards value.
if (maxForwards < 0 || maxForwards > 255)
throw new IllegalArgumentException
("bad maxForwards arg " + maxForwards);
MaxForwardsHeader m = new MaxForwardsHeader();
m.setMaxForwards(maxForwards);
return m;
|
public ProxyAuthenticateHeader | createProxyAuthenticateHeader(java.lang.String scheme)Creates a new ProxyAuthenticateHeader based on the newly supplied
scheme value.
if (scheme == null)
throw new NullPointerException("bad scheme arg");
ProxyAuthenticateHeader p = new ProxyAuthenticateHeader();
p.setScheme(scheme);
return p;
|
public ProxyAuthorizationHeader | createProxyAuthorizationHeader(java.lang.String scheme)Creates a new ProxyAuthorizationHeader based on the newly supplied
scheme value.
if (scheme == null)
throw new NullPointerException("bad scheme arg");
ProxyAuthorizationHeader p = new ProxyAuthorizationHeader();
p.setScheme(scheme);
return p;
|
public RecordRouteHeader | createRecordRouteHeader(Address address)Creates a new RecordRouteHeader based on the newly supplied
address value.
RecordRouteHeader recordRouteHeader = new RecordRouteHeader();
recordRouteHeader.setAddress(address);
return recordRouteHeader;
|
public RouteHeader | createRouteHeader(Address address)Creates a new RouteHeader based on the newly supplied address value.
if (address == null)
throw new NullPointerException
("null address arg");
RouteHeader route = new RouteHeader();
route.setAddress(address);
return route;
|
public ToHeader | createToHeader(Address address, java.lang.String tag)Creates a new ToHeader based on the newly supplied address and
tag values.
if (address == null)
throw new NullPointerException("null address");
ToHeader to = new ToHeader();
to.setAddress(address);
if (tag != null) to.setTag(tag);
return to;
|
public ViaHeader | createViaHeader(java.lang.String host, int port, java.lang.String transport, java.lang.String branch)Creates a new ViaHeader based on the newly supplied uri and
branch values.
// This should be changed.
if (host == null || transport == null)
throw new NullPointerException("null arg");
ViaHeader via = new ViaHeader();
if (branch != null) via.setBranch(branch);
via.setHost(host);
via.setPort(port);
via.setTransport(transport);
return via;
|
public WWWAuthenticateHeader | createWWWAuthenticateHeader(java.lang.String scheme)Creates a new WWWAuthenticateHeader based on the newly supplied
scheme value.
if (scheme == null)
throw new NullPointerException("null scheme");
WWWAuthenticateHeader www = new WWWAuthenticateHeader();
www.setScheme(scheme);
return www;
|