rocks.xmpp.extensions.httpbind.model.Body Maven / Gradle / Ivy
Show all versions of xmpp-core Show documentation
} wrapper element, which indicates an error reported by the connection manager. */ @XmlEnum public enum Condition { /** * The format of an HTTP header or binding element received from the client is unacceptable (e.g., syntax error). */ @XmlEnumValue(value = "bad-request") BAD_REQUEST, /** * The target domain specified in the 'to' attribute or the target host or port specified in the 'route' attribute is no longer serviced by the connection manager. */ @XmlEnumValue(value = "host-gone") HOST_GONE, /** * The target domain specified in the 'to' attribute or the target host or port specified in the 'route' attribute is unknown to the connection manager. */ @XmlEnumValue(value = "host-unknown") HOST_UNKNOWN, /** * The initialization element lacks a 'to' or 'route' attribute (or the attribute has no value) but the connection manager requires one. */ @XmlEnumValue(value = "improper-addressing") IMPROPER_ADDRESSING, /** * The connection manager has experienced an internal error that prevents it from servicing the request. */ @XmlEnumValue(value = "internal-server-error") INTERNAL_SERVER_ERROR, /** * (1) 'sid' is not valid, (2) 'stream' is not valid, (3) 'rid' is larger than the upper limit of the expected window, (4) connection manager is unable to resend response, (5) 'key' sequence is invalid. */ @XmlEnumValue(value = "item-not-found") ITEM_NOT_FOUND, /** * Another request being processed at the same time as this request caused the session to terminate. */ @XmlEnumValue(value = "other-request") OTHER_REQUEST, /** * The client has broken the session rules (polling too frequently, requesting too frequently, sending too many simultaneous requests). */ @XmlEnumValue(value = "policy-violation") POLICY_VIOLATION, /** * The connection manager was unable to connect to, or unable to connect securely to, or has lost its connection to, the server. */ @XmlEnumValue(value = "remote-connection-failed") REMOTE_CONNECTION_FAILED, /** * Encapsulates an error in the protocol being transported. */ @XmlEnumValue(value = "remote-stream-error") REMOTE_STREAM_ERROR, /** * The connection manager does not operate at this URI (e.g., the connection manager accepts only SSL or TLS connections at some https: URI rather than the http: URI requested by the client). The client can try POSTing to the URI in the content of the {@code/* * The MIT License (MIT) * * Copyright (c) 2014-2016 Christian Schudt * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package rocks.xmpp.extensions.httpbind.model; import rocks.xmpp.addr.Jid; import javax.xml.XMLConstants; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlRootElement; import java.net.URI; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Locale; /** * The implementation of the {@code
} element in the {@code http://jabber.org/protocol/httpbind} namespace. ** This class is immutable. * * @author Christian Schudt * @see XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH) * @see XEP-0206: XMPP Over BOSH * @see XML Schema */ @XmlRootElement public final class Body { /** * http://jabber.org/protocol/httpbind */ public static final String NAMESPACE = "http://jabber.org/protocol/httpbind"; /** * urn:xmpp:xbosh */ public static final String XBOSH_NAMESPACE = "urn:xmpp:xbosh"; @XmlAnyElement(lax = true) private final List
* * * @return The 'from' attribute. */ public final Jid getFrom() { return from; } /** *** * @return The 'hold' attribute. */ public final Byte getHold() { return hold; } public final Short getInactivity() { return inactivity; } public final String getKey() { return key; } /** *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.
*The client SHOULD set the 'hold' attribute to a value of "1".
*** * @return The maximal pause in seconds. */ public final Short getMaxPause() { return maxpause; } public final String getNewKey() { return newkey; } /** *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.
*** * @return The 'pause' attribute value. */ public final Short getPause() { return pause; } /** *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.
*** * @return The 'polling' attribute value. */ public final Short getPolling() { return polling; } /** *This attribute specifies the shortest allowable polling interval (in seconds). This enables the client to not send empty request elements more often than desired.
*** * @return The 'report' attribute value. */ public final Integer getReport() { return report; } /** *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.
*** * @return The 'requests' attribute value. */ public final Byte getRequests() { return requests; } /** *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.
**} element of every client request MUST possess a sequential request ID encapsulated via the 'rid' attribute. * * * @return The 'rid' attribute value. */ public final Long getRid() { return rid; } /** *The {@code
** * @return The 'route' attribute value. */ public final String getRoute() { return route; } /** *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").
**} element MUST NOT possess a 'sid' attribute. * * * @return The 'route' attribute value. */ public final String getSid() { return sid; } /** *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 {@code
** * @return The 'stream' attribute value. */ public final String getStream() { return stream; } /** * @return The 'time' attribute value. * @see #getReport() */ public final Short getTime() { return time; } public final String getTo() { return to; } public final Type getType() { return type; } /** *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.
*** * @return The 'version' attribute value. */ public final String getVersion() { return version; } public final Integer getWait() { return wait; } public final Locale getLanguage() { return lang; } public final Condition getCondition() { return condition; } public final String getXmppVersion() { return version; } public final Boolean getRestartLogic() { return restartlogic; } public final Boolean getRestart() { return restart; } /** *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.
**} 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". * * * @return The content. */ public final String getContent() { return content; } /** * Gets the 'authid' attribute. * * @return The 'authid' attribute. */ public final String getAuthId() { return authid; } /** * The implementation of the 'condition' attribute of the {@codeSome clients are constrained to only accept HTTP responses with specific Content-Types (e.g., "text/html"). The {@code