FileDocCategorySizeDatePackage
Reconnect.javaAPI DocGlassfish v2 API4122Tue Jun 19 17:49:08 BST 2007com.sun.grizzly.cometd.bayeux

Reconnect

public 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" } // , ... ]
author
Jeanfrancois Arcand

Fields Summary
private Advice
advise
Constructors Summary
public Reconnect()

        type = Verb.RECONNECT;
    
Methods Summary
public AdvicegetAdvise()

        return advise;
    
public voidsetAdvise(Advice advise)

        this.advise = advise;
    
public java.lang.StringtoJSON()

            
        return "[{" 
                + "\"timestamp\":\"" + FastHttpDateFormat.getCurrentDate() + "\","
                + "\"error\":\"" + error + "\","
                + "\"successful\":" + successful + ","                
                + "\"channel\":\"" + channel + "\""
                + "}," ;