@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 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()); } } }