Handshakepublic class Handshake extends VerbBase Bayeux Handshake implementation.
See http://svn.xantus.org/shortbus/trunk/bayeux/protocol.txt for the technical
details.
This is an example of the messages exchanged during a
connection setup process:
// from client, to server
[
{
"channel": "/meta/handshake",
// all meta channel messages MUST contain the protocol version the
// client expects
"version": 0.1,
// the oldest version of the protocol that this client will support
"minimumVersion": 0.1,
"supportedConnectionTypes": ["iframe", "flash", "http-polling"],
// the authScheme is outside the realm of this specification and
// provided here for illustration only. It's also optional.
"authScheme": "SHA1",
// the authUser and authToken are optional and authScheme dependent
"authUser": "alex",
"authToken": "HASHJIBBERISH"
}
// servers MUST ignore other messages in the envelope should the first
// be a handshake request
]
// from server, to client
[
{
"channel": "/meta/handshake",
// preferred protocol version
"version": 0.1,
// the oldest version of the protocol that this server will support
"minimumVersion": 0.1,
"supportedConnectionTypes": ["iframe", "flash", "http-polling"],
"clientId": "SOME_UNIQUE_CLIENT_ID",
"authSuccessful": true,
// authToken is auth scheme dependent and entirely optional
"authToken": "SOME_NONCE_THAT_NEEDS_TO_BE_PROVIDED_SUBSEQUENTLY",
// advice determines the client behavior on errors
"advice": {
"reconnect": "retry", // one of "none", "retry", "handshake", "recover"
// transport specializations of the top-level generalized
// advice
"transport": {
"iframe": { },
"flash": { },
"http-polling": {
// delay before reconnecting
"interval": 5000 // ms
}
}
}
}
// servers MUST send only a handshake message in response to a handshake request
] |
Fields Summary |
---|
private String | version | private String | minimumVersion | private String | supportedConnectionTypes | private String | authScheme | private String | authUser | private String | clientId | private Boolean | authSuccessful | private Advice | advice | private boolean | successfull |
Constructors Summary |
---|
public Handshake()
type = Verb.HANDSHAKE;
|
Methods Summary |
---|
public Advice | getAdvice()
return advice;
| public java.lang.String | getAuthScheme()
return authScheme;
| public java.lang.Boolean | getAuthSuccessful()
return authSuccessful;
| public java.lang.String | getAuthUser()
return authUser;
| public java.lang.String | getClientId()
return clientId;
| public java.lang.String | getMinimumVersion()
return minimumVersion;
| public java.lang.String | getSupportedConnectionTypes()
return supportedConnectionTypes;
| public java.lang.String | getVersion()
return version;
| public void | setAdvice(Advice advice)
this.advice = advice;
| public void | setAuthScheme(java.lang.String authScheme)
this.authScheme = authScheme;
| public void | setAuthSuccessful(java.lang.Boolean authSuccessful)
this.authSuccessful = authSuccessful;
| public void | setAuthUser(java.lang.String authUser)
this.authUser = authUser;
| public void | setClientId(java.lang.String clientId)
this.clientId = clientId;
| public void | setMinimumVersion(java.lang.String minimumVersion)
this.minimumVersion = minimumVersion;
| public void | setSupportedConnectionTypes(java.lang.String supportedConnectionTypes)
this.supportedConnectionTypes = supportedConnectionTypes;
| public void | setVersion(java.lang.String version)
this.version = version;
| public java.lang.String | toJSON()
return "[{"
+ "\"supportedConnectionTypes\":" + supportedConnectionTypes + ","
+ "\"minimumVersion\":" + minimumVersion + ","
+ "\"authSuccessful\":" + authSuccessful + ","
+ ext.toJSON() + ","
+ "\"clientId\":\"" + clientId + "\","
+ "\"successful\":" + successful + ","
+ "\"channel\":\"" + channel + "\","
+ advice.toJSON() + ","
+ "\"version\":" + version
+ "}]\n";
| public java.lang.String | toString()
return toJSON();
|
|