Subscribepublic class Subscribe extends VerbBase Bayeux Subscribe implementation.
See http://svn.xantus.org/shortbus/trunk/bayeux/protocol.txt for the technical
details.
// Subscribing and unsubscribing to channel is straightforward. Subscribing:
//-----------------
// CLIENT -> SERVER
//-----------------
[
{
"channel": "/meta/subscribe",
"subscription": "/some/other/channel",
// optional
"authToken": "SOME_NONCE_PREVIOUSLY_PROVIDED_BY_SERVER"
}
// , ...
]
// response to subscription:
//-----------------
// SERVER -> CLIENT
//-----------------
[
{
"channel": "/meta/subscribe",
"subscription": "/some/other/channel",
"successful": true,
"advice": {
"transport": {
retry: true, // or false
}
},
"clientId": "SOME_UNIQUE_CLIENT_ID",
"error": "",
// optional
"authToken": "SOME_NONCE"
}
// , ...
] |
Fields Summary |
---|
protected String | subscription | protected Advice | advise | protected String | clientId | protected String | error |
Constructors Summary |
---|
public Subscribe()
type = Verb.SUBSCRIBE;
|
Methods Summary |
---|
public Advice | getAdvise()
return advise;
| public java.lang.String | getClientId()
return clientId;
| public java.lang.String | getError()
return error;
| public java.lang.String | getSubscription()
return subscription;
| public void | setAdvise(Advice advise)
this.advise = advise;
| public void | setClientId(java.lang.String clientId)
this.clientId = clientId;
| public void | setError(java.lang.String error)
this.error = error;
| public void | setSubscription(java.lang.String subscription)
this.subscription = subscription;
| public java.lang.String | toJSON()
return "[{"
+ "\"subscription\":\"" + subscription + "\","
+ "\"error\":\"" + error + "\","
+ "\"successful\":" + successful + ","
+ "\"channel\":\"" + channel + "\""
+ "}]\n";
|
|