public final class Body extends Object
<body/> element in the http://jabber.org/protocol/httpbind namespace.| Modifier and Type | Class and Description |
|---|---|
static class |
Body.Condition
The implementation of the 'condition' attribute of the
<body/> wrapper element, which indicates an error reported by the connection manager. |
static class |
Body.Type
The implementation of the 'type' attribute of the
<body/> element. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccept()
The connection manager MAY include an 'accept' attribute in the session creation response element, to specify a comma-separated list of the content encodings it can decompress.
|
Long |
getAck()
A client MAY include an 'ack' attribute (set to "1") to indicate that it will be using acknowledgements throughout the session and that the absence of an 'ack' attribute in any request is meaningful.
|
String |
getCharsets()
The connection manager MAY inform the client which encodings it can convert by setting the optional 'charsets' attribute in the session creation response element to a space-separated list of encodings.
|
Body.Condition |
getCondition() |
String |
getContent() |
Jid |
getFrom()
The
<body/> element of the first request MAY also possess a 'from' attribute, which specifies the originator of the first stream and which enables the connection manager to forward the originating entity's identity to the application server. |
Byte |
getHold()
This attribute informs the client about the maximum number of requests the connection manager will keep waiting at any one time during the session.
|
Short |
getInactivity() |
String |
getKey() |
String |
getLanguage() |
Short |
getMaxPause()
If the connection manager supports session pausing (see Inactivity) then it SHOULD advertise that to the client by including a 'maxpause' attribute in the session creation response element.
|
String |
getNewKey() |
Short |
getPause()
If a client encounters an exceptional temporary situation during which it will be unable to send requests to the connection manager for a period of time greater than the maximum inactivity period (e.g., while a runtime environment changes from one web page to another), and if the connection manager included a 'maxpause' attribute in its Session Creation Response, then the client MAY request a temporary increase to the maximum inactivity period by including a 'pause' attribute in a request.
|
Short |
getPolling()
This attribute specifies the shortest allowable polling interval (in seconds).
|
Integer |
getReport()
After receiving a request with an 'ack' value less than the 'rid' of the last request that it has already responded to, the connection manager MAY inform the client of the situation by sending its next response immediately instead of waiting until it has payloads to send to the client (e.g., if some time has passed since it responded).
|
Byte |
getRequests()
This attribute enables the connection manager to limit the number of simultaneous requests the client makes (see Overactivity and Polling Sessions).
|
Boolean |
getRestart() |
Boolean |
getRestartLogic() |
Long |
getRid()
The
<body/> element of every client request MUST possess a sequential request ID encapsulated via the 'rid' attribute. |
String |
getRoute()
A connection manager MAY be configured to enable sessions with more than one server in different domains.
|
String |
getSid()
All requests after the first one MUST include a valid 'sid' attribute (provided by the connection manager in the Session Creation Response).
|
String |
getStream()
If a connection manager supports the multi-streams feature, it MUST include a 'stream' attribute in its Session Creation Response.
|
Short |
getTime() |
String |
getTo() |
Body.Type |
getType() |
URI |
getUri()
If the connection manager reports a
Body.Condition.SEE_OTHER_URI error condition, this method returns the URI. |
String |
getVersion()
This attribute specifies the highest version of the BOSH protocol that the client supports.
|
Integer |
getWait() |
List<Object> |
getWrappedObjects() |
String |
getXmppVersion() |
void |
setAck(Long ack)
Sets the 'ack' value.
|
void |
setCondition(Body.Condition condition) |
void |
setContent(String content)
Some clients are constrained to only accept HTTP responses with specific Content-Types (e.g., "text/html").
|
void |
setFrom(Jid from) |
void |
setHold(Byte hold)
The client SHOULD set the 'hold' attribute to a value of "1".
|
void |
setKey(String key) |
void |
setLanguage(String language) |
void |
setNewKey(String newKey) |
void |
setPause(Short pause) |
void |
setReport(Integer report) |
void |
setRequests(Byte requests) |
void |
setRestart(Boolean restart) |
void |
setRestartLogic(Boolean restartLogic) |
void |
setRid(Long rid) |
void |
setRoute(String route) |
void |
setSid(String sid) |
void |
setStream(String stream) |
void |
setTime(Short time) |
void |
setTo(String to) |
void |
setType(Body.Type type) |
void |
setVersion(String version) |
void |
setWait(Integer wait) |
void |
setXmppVersion(String xmppVersion) |
public Body(Object wrappedObject)
public Body()
public URI getUri()
Body.Condition.SEE_OTHER_URI error condition, this method returns the URI.public String getAccept()
The connection manager MAY include an 'accept' attribute in the session creation response element, to specify a comma-separated list of the content encodings it can decompress. After receiving a session creation response with an 'accept' attribute, clients MAY include an HTTP Content-Encoding header in subsequent requests (indicating one of the encodings specified in the 'accept' attribute) and compress the bodies of the requests accordingly.
public Long getAck()
A client MAY include an 'ack' attribute (set to "1") to indicate that it will be using acknowledgements throughout the session and that the absence of an 'ack' attribute in any request is meaningful.
When responding to a request that it has been holding, if the connection manager finds it has already received another request with a higher 'rid' attribute (typically while it was holding the first request), then it MAY acknowledge the reception to the client. The connection manager MAY set the 'ack' attribute of any response to the value of the highest 'rid' attribute it has received in the case where it has also received all requests with lower 'rid' values.
public void setAck(Long ack)
ack - The ack value.public String getCharsets()
The connection manager MAY inform the client which encodings it can convert by setting the optional 'charsets' attribute in the session creation response element to a space-separated list of encodings.
public Jid getFrom()
The
<body/>element of the first request MAY also possess a 'from' attribute, which specifies the originator of the first stream and which enables the connection manager to forward the originating entity's identity to the application server.
public Byte getHold()
This attribute informs the client about the maximum number of requests the connection manager will keep waiting at any one time during the session. This value MUST NOT be greater than the value specified by the client in the session request.
public void setHold(Byte hold)
The client SHOULD set the 'hold' attribute to a value of "1".
hold - The 'hold' attribute.public Short getInactivity()
public String getKey()
public void setKey(String key)
public Short getMaxPause()
If the connection manager supports session pausing (see Inactivity) then it SHOULD advertise that to the client by including a 'maxpause' attribute in the session creation response element. The value of the attribute indicates the maximum length of a temporary session pause (in seconds) that a client can request.
public String getNewKey()
public void setNewKey(String newKey)
public Short getPause()
If a client encounters an exceptional temporary situation during which it will be unable to send requests to the connection manager for a period of time greater than the maximum inactivity period (e.g., while a runtime environment changes from one web page to another), and if the connection manager included a 'maxpause' attribute in its Session Creation Response, then the client MAY request a temporary increase to the maximum inactivity period by including a 'pause' attribute in a request.
public void setPause(Short pause)
pause - The 'pause' attribute value.getPause()public Short getPolling()
This attribute specifies the shortest allowable polling interval (in seconds). This enables the client to not send empty request elements more often than desired.
public Integer getReport()
After receiving a request with an 'ack' value less than the 'rid' of the last request that it has already responded to, the connection manager MAY inform the client of the situation by sending its next response immediately instead of waiting until it has payloads to send to the client (e.g., if some time has passed since it responded). In this case it SHOULD include a 'report' attribute set to one greater than the 'ack' attribute it received from the client, and a 'time' attribute set to the number of milliseconds since it sent the response associated with the 'report' attribute.
Upon reception of a response with 'report' and 'time' attributes, if the client has still not received the response associated with the request identifier specified by the 'report' attribute, then it MAY choose to resend the request associated with the missing response.
public void setReport(Integer report)
report - The 'report' attribute value.getReport()public Byte getRequests()
This attribute enables the connection manager to limit the number of simultaneous requests the client makes (see Overactivity and Polling Sessions). The RECOMMENDED values are either "2" or one more than the value of the 'hold' attribute specified in the session request.
public void setRequests(Byte requests)
requests - The 'requests' attribute value.getRequests()public Long getRid()
The
<body/>element of every client request MUST possess a sequential request ID encapsulated via the 'rid' attribute.
public String getRoute()
A connection manager MAY be configured to enable sessions with more than one server in different domains. When requesting a session with such a "proxy" connection manager, a client SHOULD include a 'route' attribute that specifies the protocol, hostname, and port of the server with which it wants to communicate, formatted as "proto:host:port" (e.g., "xmpp:example.com:9999").
public void setRoute(String route)
route - The 'route' attribute value.getRoute()public String getSid()
All requests after the first one MUST include a valid 'sid' attribute (provided by the connection manager in the Session Creation Response). The initialization request is unique in that the
<body/>element MUST NOT possess a 'sid' attribute.
public void setSid(String sid)
sid - The 'route' attribute value.getSid()public String getStream()
If a connection manager supports the multi-streams feature, it MUST include a 'stream' attribute in its Session Creation Response. If a client does not receive the 'stream' attribute then it MUST assume that the connection manager does not support the feature.
public void setStream(String stream)
stream - The 'stream' attribute value.getStream()public Short getTime()
getReport()public void setTime(Short time)
time - The 'time' attribute value.getTime()public String getTo()
public void setTo(String to)
public Body.Type getType()
public void setType(Body.Type type)
public String getVersion()
This attribute specifies the highest version of the BOSH protocol that the client supports. The numbering scheme is "<major>.<minor>" (where the minor number MAY be incremented higher than a single digit, so it MUST be treated as a separate integer). Note: The 'ver' attribute should not be confused with the version of any protocol being transported.
public void setVersion(String version)
version - The 'version' attribute value.getVersion()public Integer getWait()
public void setWait(Integer wait)
public String getLanguage()
public void setLanguage(String language)
public Body.Condition getCondition()
public void setCondition(Body.Condition condition)
public String getXmppVersion()
public void setXmppVersion(String xmppVersion)
public Boolean getRestartLogic()
public void setRestartLogic(Boolean restartLogic)
public Boolean getRestart()
public void setRestart(Boolean restart)
public String getContent()
setContent(String)public void setContent(String content)
Some clients are constrained to only accept HTTP responses with specific Content-Types (e.g., "text/html"). The
<body/>element of the first request MAY possess a 'content' attribute. This specifies the value of the HTTP Content-Type header that MUST appear in all the connection manager's responses during the session. If the client request does not possess a 'content' attribute, then the HTTP Content-Type header of responses MUST be "text/xml; charset=utf-8".
content - The content.Copyright © 2014 XMPP.rocks. All rights reserved.