/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (o instanceof RemoteFrameworkConnectionInfo) { RemoteFrameworkConnectionInfo other = (RemoteFrameworkConnectionInfo) o; if (!getHost().equals(other.getHost())) { return false; } if (getPort() != other.getPort()) { return false; } if (getUseSSL() != other.getUseSSL()) { return false; } if (!getTrustManagers().equals(other.getTrustManagers())) { return false; } if (!getKey().equals(other.getKey())) { return false; } if (getTimeout() != other.getTimeout()) { return false; } return true; } return false; }
connection = new RemoteFrameworkConnection(connectionInfo); connection.writeObject(CurrentLocale.get()); connection.writeObject(connectionInfo.getKey());
new RemoteFrameworkConnectionInfo(host, port, key, useSSL, trustManagers, 60 * 1000); LOG.debug("Remote connection info: {}", info);
try { connection.writeObject(CurrentLocale.get()); connection.writeObject(frameworkConnectionInfo.getKey()); connection.writeObject(new HelloRequest(HelloRequest.CONNECTOR_INFO)); response = (HelloResponse) connection.readObject(); LOG.error("HelloResponse is null from {0}", frameworkConnectionInfo); throw new ConnectorIOException("HelloResponse is null from " + frameworkConnectionInfo.toString());
connection = new RemoteFrameworkConnection(connectionInfo); connection.writeObject(CurrentLocale.get()); connection.writeObject(connectionInfo.getKey());
manager = fact.getRemoteManager(new RemoteFrameworkConnectionInfo(host, port, new GuardedString(key.toCharArray())));
try { connection.writeObject(CurrentLocale.get()); connection.writeObject(frameworkConnectionInfo.getKey()); connection.writeObject(new HelloRequest(HelloRequest.CONNECTOR_INFO)); response = (HelloResponse) connection.readObject(); LOG.error("HelloResponse is null from {0}", frameworkConnectionInfo); throw new ConnectorIOException("HelloResponse is null from " + frameworkConnectionInfo.toString());
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (o instanceof RemoteFrameworkConnectionInfo) { RemoteFrameworkConnectionInfo other = (RemoteFrameworkConnectionInfo) o; if (!getHost().equals(other.getHost())) { return false; } if (getPort() != other.getPort()) { return false; } if (getUseSSL() != other.getUseSSL()) { return false; } if (!getTrustManagers().equals(other.getTrustManagers())) { return false; } if (!getKey().equals(other.getKey())) { return false; } if (getTimeout() != other.getTimeout()) { return false; } return true; } return false; }
connection.writeObject(connectionInfo.getKey());
manager = fact.getRemoteManager(new RemoteFrameworkConnectionInfo(host, port, new GuardedString(key.toCharArray()))); } catch (Throwable t) {
RemoteFrameworkConnectionInfo other = (RemoteFrameworkConnectionInfo)o; if (!getHost().equals(other.getHost())) { return false; if (getPort() != other.getPort()) { return false; if (getUseSSL() != other.getUseSSL()) { return false; if (!getTrustManagers().equals(other.getTrustManagers())) { return false; if (!getKey().equals(other.getKey())) { return false; if (getTimeout() != other.getTimeout()) { return false;
public Map<String, Object> getServerInfo() throws RuntimeException { try (RemoteFrameworkConnection connection = new RemoteFrameworkConnection(frameworkConnectionInfo)) { connection.writeObject(CurrentLocale.get()); connection.writeObject(frameworkConnectionInfo.getKey()); connection.writeObject(new HelloRequest(HelloRequest.SERVER_INFO)); HelloResponse response = (HelloResponse) connection.readObject(); if (response.getException() instanceof ConnectorException) { throw (ConnectorException) response.getException(); } else if (response.getException() != null) { throw ConnectorException.wrap(response.getException()); } return response.getServerInfo(); } }
new RemoteFrameworkConnectionInfo(host, port, new GuardedString(key.toCharArray()))); } catch (Throwable t) {
private void init(RemoteFrameworkConnectionInfo connectionInfo) throws Exception { Socket socket = new Socket(); socket.setSoTimeout(connectionInfo.getTimeout()); socket.connect(new InetSocketAddress(connectionInfo.getHost(), connectionInfo.getPort()), connectionInfo.getTimeout()); try { if (connectionInfo.getUseSSL()) { List<TrustManager> trustManagers = connectionInfo.getTrustManagers(); TrustManager[] trustManagerArr = null; if (null != trustManagers && trustManagers.size() > 0) { factory.createSocket(socket, connectionInfo.getHost(), connectionInfo .getPort(), true); ((SSLSocket) socket).startHandshake();
public Map<String, Object> getServerInfo() throws RuntimeException { try (RemoteFrameworkConnection connection = new RemoteFrameworkConnection(frameworkConnectionInfo)) { connection.writeObject(CurrentLocale.get()); connection.writeObject(frameworkConnectionInfo.getKey()); connection.writeObject(new HelloRequest(HelloRequest.SERVER_INFO)); HelloResponse response = (HelloResponse) connection.readObject(); if (response.getException() instanceof ConnectorException) { throw (ConnectorException) response.getException(); } else if (response.getException() != null) { throw ConnectorException.wrap(response.getException()); } return response.getServerInfo(); } }
/** * Returns ICF connector info manager that manages local connectors. The * manager will be created if it does not exist yet. * * @return ICF connector info manager that manages local connectors */ private ConnectorInfoManager getRemoteConnectorInfoManager(ConnectorHostType hostType) { String hostname = hostType.getHostname(); int port = Integer.parseInt(hostType.getPort()); GuardedString key; try { key = new GuardedString(protector.decryptString(hostType.getSharedSecret()).toCharArray()); } catch (EncryptionException e) { throw new SystemException("Shared secret decryption error: "+e.getMessage(),e); } Integer timeout = hostType.getTimeout(); if (timeout == null) { timeout = 0; } boolean useSSL = false; if (hostType.isProtectConnection() != null) { useSSL = hostType.isProtectConnection(); } List<TrustManager> trustManagers = protector.getTrustManagers(); LOGGER.trace("Creating RemoteFrameworkConnectionInfo: hostname={}, port={}, key={}, useSSL={}, trustManagers={}, timeout={}", new Object[] {hostname, port, key, useSSL, trustManagers, timeout}); RemoteFrameworkConnectionInfo remoteFramewrorkInfo = new RemoteFrameworkConnectionInfo(hostname, port, key, useSSL, trustManagers, timeout); return connectorInfoManagerFactory.getRemoteManager(remoteFramewrorkInfo); }
private void init(RemoteFrameworkConnectionInfo connectionInfo) throws Exception { Socket socket = new Socket(); socket.setSoTimeout(connectionInfo.getTimeout()); socket.connect(new InetSocketAddress(connectionInfo.getHost(), connectionInfo.getPort()), connectionInfo.getTimeout()); try { if (connectionInfo.getUseSSL()) { List<TrustManager> trustManagers = connectionInfo.getTrustManagers(); TrustManager[] trustManagerArr = null; if (null != trustManagers && trustManagers.size() > 0) { factory.createSocket(socket, connectionInfo.getHost(), connectionInfo .getPort(), true); ((SSLSocket) socket).startHandshake();