Search in sources :

Example 1 with ZeppelinhubWebsocket

use of org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.listener.ZeppelinhubWebsocket in project zeppelin by apache.

the class ZeppelinhubClient method connect.

private ZeppelinhubSession connect() {
    ZeppelinhubSession zeppelinSession;
    try {
        ZeppelinhubWebsocket ws = ZeppelinhubWebsocket.newInstance(zeppelinhubToken);
        Future<Session> future = client.connect(ws, zeppelinhubWebsocketUrl, conectionRequest);
        Session session = future.get();
        zeppelinSession = ZeppelinhubSession.createInstance(session, zeppelinhubToken);
    } catch (IOException | InterruptedException | ExecutionException e) {
        LOG.info("Couldnt connect to zeppelinhub - {}", e.toString());
        zeppelinSession = ZeppelinhubSession.EMPTY;
    }
    return zeppelinSession;
}
Also used : ZeppelinhubSession(org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.session.ZeppelinhubSession) IOException(java.io.IOException) ZeppelinhubWebsocket(org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.listener.ZeppelinhubWebsocket) ExecutionException(java.util.concurrent.ExecutionException) Session(org.eclipse.jetty.websocket.api.Session) ZeppelinhubSession(org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.session.ZeppelinhubSession)

Aggregations

IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 ZeppelinhubWebsocket (org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.listener.ZeppelinhubWebsocket)1 ZeppelinhubSession (org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.session.ZeppelinhubSession)1 Session (org.eclipse.jetty.websocket.api.Session)1