Constructor and Description |
---|
CoapMessage(int version,
MessageType type,
int code,
int id,
byte[] token,
CoapOption[] options,
byte[] payload)
Create a CoAP message
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static CoapMessage |
get(String url,
boolean confimable) |
Integer |
getAccept() |
int |
getCode() |
Integer |
getContentFormat() |
int |
getId() |
String[] |
getLocationPath() |
String[] |
getLocationQuery() |
Integer |
getMaxAge() |
CoapOption[] |
getOptions() |
byte[] |
getPayload() |
String |
getProxyScheme() |
String |
getProxyUri()
return the absolute URI used to make a request to a forward-proxy
|
byte[] |
getToken() |
MessageType |
getType() |
String |
getUriHost() |
String[] |
getUriPath() |
Integer |
getUriPort() |
String[] |
getUriQuery() |
int |
getVersion() |
int |
hashCode() |
static CoapMessage |
post(String url,
boolean confimable,
byte[] payload) |
Object |
requestId() |
void |
setCode(int code) |
void |
setId(int id) |
void |
setOptions(CoapOption[] options) |
void |
setPayload(byte[] payload) |
void |
setToken(byte[] token) |
void |
setType(MessageType type) |
void |
setVersion(int version) |
String |
toString() |
public CoapMessage(int version, MessageType type, int code, int id, byte[] token, CoapOption[] options, byte[] payload)
version
- the version (you probably want 1 here)type
- the type of CoAP messagecode
- the message code : CoapCode
id
- the identifier for this messagetoken
- the message token (can be null
)options
- list of options for this message (can be null
)payload
- the payload of the message (can be null
public static final CoapMessage get(String url, boolean confimable)
public static final CoapMessage post(String url, boolean confimable, byte[] payload)
public Object requestId()
public int getVersion()
public int getCode()
public int getId()
public byte[] getToken()
public byte[] getPayload()
public CoapOption[] getOptions()
public MessageType getType()
public String[] getUriPath()
public String[] getUriQuery()
public String getUriHost()
public Integer getUriPort()
public String getProxyUri()
public String getProxyScheme()
public Integer getContentFormat()
public Integer getAccept()
public Integer getMaxAge()
public String[] getLocationPath()
public String[] getLocationQuery()
public void setVersion(int version)
public void setType(MessageType type)
public void setCode(int code)
public void setId(int id)
public void setToken(byte[] token)
public void setPayload(byte[] payload)
public void setOptions(CoapOption[] options)
Copyright © 2009–2013 Apache MINA Project. All rights reserved.