Connectpublic class Connect extends VerbBase Bayeux Connect implementation.
See http://svn.xantus.org/shortbus/trunk/bayeux/protocol.txt for the technical
details.
// here's what the client then POST's:
//-----------------
// CLIENT -> SERVER
//-----------------
[
{
"channel": "/meta/connect",
"clientId": "SOME_UNIQUE_CLIENT_ID",
"connectionType": "iframe",
// optional
"authToken":"SOME_NONCE_PREVIOUSLY_PROVIDED_BY_SERVER"
}
// , ...
]
// NOTE: data should be POSTed with an encoding of
// application/x-www-form-urlencoded, and the preceeding payload is
// expected to be stored in the "message" parameter
// the server now replies with the preamble followed by any number of
// messages encoded in the tunnel-specific envelope:
//-----------------
// SERVER -> CLIENT
//-----------------
Comet -- cleaning up web development
...
|
Fields Summary |
---|
public static final String | HTML_HEADER | public static final String | DATA_WRAPPER_HEADER | public static final String | DATA_WRAPPER_FOOTER | public static final String | META_CONNECTIONS | protected String | clientId | protected String | connectionType | protected String | timestamp |
Constructors Summary |
---|
public Connect()
type = Verb.CONNECT;
|
Methods Summary |
---|
public java.lang.String | getClientId()
return clientId;
| public java.lang.String | getConnectionType()
return connectionType;
| public void | setClientId(java.lang.String clientId)
this.clientId = clientId;
| public void | setConnectionType(java.lang.String connectionType)
this.connectionType = connectionType;
| public java.lang.String | toJSON()
return "[{"
+ "\"timestamp\":\"" + FastHttpDateFormat.getCurrentDate() + "\","
+ "\"error\":\"" + error + "\","
+ "\"successful\":" + successful + ","
+ "\"channel\":\"" + channel + "\""
+ "}]\n" ;
|
|