Reconnectpublic class Reconnect extends Connect Bayeux Reconnect implementation.
See http://svn.xantus.org/shortbus/trunk/bayeux/protocol.txt for the technical
details.
Upon connection, clients are implicitly subscribed to a connection-specific
channel located at:
/meta/clients/[SOME_UNIQUE_CLIENT_ID]
The client ID is used in reconnection. The reconnect verb allows occasionally
connected clients and the posting of messages for pre-authenticated systems.
// reconnection is very similar to initial connection:
//-----------------
// CLIENT -> SERVER
//-----------------
[
{
"channel": "/meta/reconnect",
"clientId": "SOME_UNIQUE_CLIENT_ID",
"timestamp": "LastReceivedTimeAtServer",
"id": "LastReceivedMessageId"
"connectionId": "/meta/connections/26",
"connectionType": "iframe", // FIXME: is this necessaray?
// optional
"authToken": "SOME_NONCE_PREVIOUSLY_PROVIDED_BY_SERVER"
}
// , ...
]
// generally, the first message in the array of responded messages will
// begin with:
//-----------------
// SERVER -> CLIENT
//-----------------
[
{
"channel": "/meta/reconnect",
"connectionId": "/meta/connections/26",
"successful": true,
// optional
"authToken": "SOME_NONCE_THAT_NEEDS_TO_BE_PROVIDED_SUBSEQUENTLY"
}
// , ...
] |
Fields Summary |
---|
private Advice | advise |
Constructors Summary |
---|
public Reconnect()
type = Verb.RECONNECT;
|
Methods Summary |
---|
public Advice | getAdvise()
return advise;
| public void | setAdvise(Advice advise)
this.advise = advise;
| public java.lang.String | toJSON()
return "[{"
+ "\"timestamp\":\"" + FastHttpDateFormat.getCurrentDate() + "\","
+ "\"error\":\"" + error + "\","
+ "\"successful\":" + successful + ","
+ "\"channel\":\"" + channel + "\""
+ "}," ;
|
|