@Override protected synchronized String login(Object client, String userName, String password) throws DataEndpointAuthenticationException { try { return ((ThriftSecureEventTransmissionService.Client) client).connect(userName, password); } catch (ThriftAuthenticationException e) { throw new DataEndpointAuthenticationException("Thrift Authentication Exception", e); } catch (TException e) { throw new DataEndpointAuthenticationException("Thrift exception", e); } }
@Override public void run() { if (isInitialized()) { try { connect(); dataEndpoint.activate(); } catch (DataEndpointAuthenticationException e) { log.error("Error while trying to connect to the endpoint. " + e.getErrorMessage(), e); dataEndpoint.deactivate(); } } else { String errorMsg = "Data endpoint connection worker is not properly initialized "; if (dataEndpoint == null) errorMsg += ", data Endpoint is not provided "; if (dataEndpointConfiguration == null) errorMsg += ", data Endpoint configuration is not provided"; errorMsg += "."; log.error(errorMsg); } }
log.error(e.getMessage()); } catch (DataEndpointAuthenticationException e) { log.error(e.getMessage()); } catch (TransportException e) { log.error(e.getMessage());
@Override public void run() { if (isInitialized()) { try { connect(); dataEndpoint.activate(); } catch (DataEndpointAuthenticationException e) { log.error("Error while trying to connect to the endpoint. " + e.getErrorMessage(), e); dataEndpoint.deactivate(); } } else { String errorMsg = "Data endpoint connection worker is not properly initialized "; if (dataEndpoint == null) { errorMsg += ", data Endpoint is not provided "; } if (dataEndpointConfiguration == null) { errorMsg += ", data Endpoint configuration is not provided"; } errorMsg += "."; log.error(errorMsg); } }
} catch (DataEndpointAuthenticationException e) { log.error("Error in initializing binary data-publisher to send requests to global throttling engine " + e.getMessage(), e); } catch (TransportException e) { log.error("Error in initializing binary data-publisher to send requests to global throttling engine " +
@Override protected synchronized String login(Object client, String userName, String password) throws DataEndpointAuthenticationException { try { return ((ThriftSecureEventTransmissionService.Client) client).connect(userName, password); } catch (ThriftAuthenticationException e) { throw new DataEndpointAuthenticationException("Thrift Authentication Exception", e); } catch (TException e) { throw new DataEndpointAuthenticationException("Thrift exception", e); } }
@Override protected synchronized void logout(Object client, String sessionId) throws DataEndpointAuthenticationException { try { ((ThriftSecureEventTransmissionService.Client) client).disconnect(sessionId); } catch (TException e) { throw new DataEndpointAuthenticationException("Thrift Exception", e); } }
@Override protected synchronized void logout(Object client, String sessionId) throws DataEndpointAuthenticationException { try { ((ThriftSecureEventTransmissionService.Client) client).disconnect(sessionId); } catch (TException e) { throw new DataEndpointAuthenticationException("Thrift Exception", e); } }
@Override protected String login(Object client, String userName, String password) throws DataEndpointAuthenticationException { Socket socket = (Socket) client; try { sendBinaryLoginMessage(socket, userName, password); return processResponse(socket); } catch (Exception e) { if (e instanceof DataEndpointAuthenticationException) { throw (DataEndpointAuthenticationException) e; } else { throw new DataEndpointAuthenticationException("Error while trying to login to data receiver :" + socket.getRemoteSocketAddress().toString(), e); } } }
@Override protected String login(Object client, String userName, String password) throws DataEndpointAuthenticationException { Socket socket = (Socket) client; try { sendBinaryLoginMessage(socket, userName, password); return processResponse(socket); } catch (Exception e) { if (e instanceof DataEndpointAuthenticationException) { throw (DataEndpointAuthenticationException) e; } else { throw new DataEndpointAuthenticationException("Error while trying to login to data receiver :" + socket.getRemoteSocketAddress().toString(), e); } } }
@Override protected void logout(Object client, String sessionId) throws DataEndpointAuthenticationException { Socket socket = (Socket) client; try { sendBinaryLogoutMessage(socket, sessionId); processResponse(socket); } catch (Exception e) { if (e instanceof DataEndpointAuthenticationException) { throw (DataEndpointAuthenticationException) e; } else { throw new DataEndpointAuthenticationException("Error while trying to logout to data receiver :" + socket.getRemoteSocketAddress().toString(), e); } } }
@Override protected void logout(Object client, String sessionId) throws DataEndpointAuthenticationException { Socket socket = (Socket) client; try { sendBinaryLogoutMessage(socket, sessionId); processResponse(socket); } catch (Exception e) { if (e instanceof DataEndpointAuthenticationException) { throw (DataEndpointAuthenticationException) e; } else { throw new DataEndpointAuthenticationException("Error while trying to logout to data receiver :" + socket.getRemoteSocketAddress().toString(), e); } } }
private void connect() throws DataEndpointAuthenticationException { Object client = null; try { client = this.dataEndpointConfiguration.getSecuredTransportPool(). borrowObject(dataEndpointConfiguration.getAuthKey()); String sessionId = this.dataEndpoint. login(client, dataEndpointConfiguration.getUsername(), dataEndpointConfiguration.getPassword()); dataEndpointConfiguration.setSessionId(sessionId); } catch (Throwable e) { log.error(e.getMessage(), e); throw new DataEndpointAuthenticationException("Cannot borrow client for " + dataEndpointConfiguration.getAuthURL(), e); } finally { try { this.dataEndpointConfiguration.getSecuredTransportPool().returnObject(dataEndpointConfiguration.getAuthKey(), client); } catch (Exception e) { this.dataEndpointConfiguration.getSecuredTransportPool().clear(dataEndpointConfiguration.getAuthKey()); } } }
private void connect() throws DataEndpointAuthenticationException { Object client = null; try { client = this.dataEndpointConfiguration.getSecuredTransportPool(). borrowObject(dataEndpointConfiguration.getAuthKey()); String sessionId = this.dataEndpoint. login(client, dataEndpointConfiguration.getUsername(), dataEndpointConfiguration.getPassword()); dataEndpointConfiguration.setSessionId(sessionId); } catch (Throwable e) { log.error(e.getMessage(), e); throw new DataEndpointAuthenticationException("Cannot borrow client for " + dataEndpointConfiguration.getAuthURL(), e); } finally { try { this.dataEndpointConfiguration.getSecuredTransportPool(). returnObject(dataEndpointConfiguration.getAuthKey(), client); } catch (Exception e) { this.dataEndpointConfiguration.getSecuredTransportPool(). clear(dataEndpointConfiguration.getAuthKey()); } } }