public void connect ( ) throws Exception { logger . debug ( "[connect] initializing new connection" ) ; if ( timer != null ) { timer . cancel ( ) ; } if ( isConnected ( ) ) { return ; } synchronized ( webSocketHandler . getNotifyConnectionObject ( ) ) { webSocketConnectionManager . start ( ) ; try { webSocketHandler . getNotifyConnectionObject ( ) . wait ( TimeUnit . SECONDS . toMillis ( WEBSOCKET_TIMEOUT ) ) ; } catch ( InterruptedException e ) { onConnectionClosed ( ) ; logger . debug ( "[connect] not open" ) ; throw new Exception ( "websocket connection not open" ) ; } if ( ! isConnected ( ) ) { onConnectionClosed ( ) ; logger . debug ( "[connect] timeout" ) ; throw new Exception ( "websocket connection timeout" ) ; } } }
Connects to the Neo4j server identified by URI and ID of this connection .