public abstract class UpnpMessage<O extends UpnpOperation> extends Object
Defaults to UDA version 1.0 and a string body type. Message content is not streamed, it is always read into memory and transported as a string or bytes message body.
Subtypes of this class typically implement the integrity rules for individual UPnP messages, for example, what headers a particular message requires.
Messages are not thread-safe.
Modifier and Type | Class and Description |
---|---|
static class |
UpnpMessage.BodyType |
Modifier | Constructor and Description |
---|---|
protected |
UpnpMessage(O operation) |
protected |
UpnpMessage(O operation,
UpnpMessage.BodyType bodyType,
Object body) |
protected |
UpnpMessage(UpnpMessage<O> source) |
Modifier and Type | Method and Description |
---|---|
Object |
getBody() |
byte[] |
getBodyBytes() |
String |
getBodyString() |
UpnpMessage.BodyType |
getBodyType() |
String |
getContentTypeCharset() |
ContentTypeHeader |
getContentTypeHeader() |
UpnpHeaders |
getHeaders() |
O |
getOperation() |
int |
getUdaMajorVersion() |
int |
getUdaMinorVersion() |
boolean |
hasBody() |
boolean |
hasHostHeader() |
boolean |
isBodyNonEmptyString() |
boolean |
isContentTypeMissingOrText() |
boolean |
isContentTypeText() |
boolean |
isContentTypeTextUDA() |
void |
setBody(String string) |
void |
setBody(UpnpMessage.BodyType bodyType,
Object body) |
void |
setBodyCharacters(byte[] characterData) |
void |
setBodyType(UpnpMessage.BodyType bodyType) |
void |
setHeaders(UpnpHeaders headers) |
void |
setUdaMajorVersion(int udaMajorVersion) |
void |
setUdaMinorVersion(int udaMinorVersion) |
String |
toString() |
protected UpnpMessage(UpnpMessage<O> source)
protected UpnpMessage(O operation)
protected UpnpMessage(O operation, UpnpMessage.BodyType bodyType, Object body)
public int getUdaMajorVersion()
public void setUdaMajorVersion(int udaMajorVersion)
public int getUdaMinorVersion()
public void setUdaMinorVersion(int udaMinorVersion)
public UpnpHeaders getHeaders()
public void setHeaders(UpnpHeaders headers)
public Object getBody()
public void setBody(String string)
public void setBody(UpnpMessage.BodyType bodyType, Object body)
public void setBodyCharacters(byte[] characterData) throws UnsupportedEncodingException
UnsupportedEncodingException
public boolean hasBody()
public UpnpMessage.BodyType getBodyType()
public void setBodyType(UpnpMessage.BodyType bodyType)
public String getBodyString()
public byte[] getBodyBytes()
public O getOperation()
public boolean isContentTypeMissingOrText()
public ContentTypeHeader getContentTypeHeader()
public boolean isContentTypeText()
public boolean isContentTypeTextUDA()
public String getContentTypeCharset()
public boolean hasHostHeader()
public boolean isBodyNonEmptyString()
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.