java.lang.Object
org.elasticsearch.transport.RemoteConnectionManager
- All Implemented Interfaces:
Closeable,AutoCloseable,ConnectionManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordNested classes/interfaces inherited from interface org.elasticsearch.transport.ConnectionManager
ConnectionManager.ConnectionValidator, ConnectionManager.DelegatingNodeConnectionListener -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(TransportConnectionListener listener) voidclose()voidfinal voidconnectToNode(DiscoveryNode node, ConnectionProfile connectionProfile, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Releasable> listener) Remote cluster connections have a different lifecycle from intra-cluster connections.voidconnectToRemoteClusterNode(DiscoveryNode node, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Void> listener) voidgetConnection(DiscoveryNode node) booleannodeConnected(DiscoveryNode node) voidopenConnection(DiscoveryNode node, ConnectionProfile profile, ActionListener<Transport.Connection> listener) voidremoveListener(TransportConnectionListener listener) resolveRemoteClusterAlias(Transport.Connection connection) This method returns a remote cluster alias for the given transport connection if it targets a node in the remote cluster.This method returns information (alias and credentials) for remote cluster for the given transport connection.intsize()
-
Method Details
-
getCredentialsManager
-
connectToNode
public final void connectToNode(DiscoveryNode node, ConnectionProfile connectionProfile, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Releasable> listener) throws ConnectTransportException Remote cluster connections have a different lifecycle from intra-cluster connections. UseconnectToRemoteClusterNode(org.elasticsearch.cluster.node.DiscoveryNode, org.elasticsearch.transport.ConnectionManager.ConnectionValidator, org.elasticsearch.action.ActionListener<java.lang.Void>)instead of this method.- Specified by:
connectToNodein interfaceConnectionManager- Throws:
ConnectTransportException
-
connectToRemoteClusterNode
public void connectToRemoteClusterNode(DiscoveryNode node, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Void> listener) throws ConnectTransportException - Throws:
ConnectTransportException
-
addListener
- Specified by:
addListenerin interfaceConnectionManager
-
removeListener
- Specified by:
removeListenerin interfaceConnectionManager
-
openConnection
public void openConnection(DiscoveryNode node, @Nullable ConnectionProfile profile, ActionListener<Transport.Connection> listener) - Specified by:
openConnectionin interfaceConnectionManager
-
getConnection
- Specified by:
getConnectionin interfaceConnectionManager
-
nodeConnected
- Specified by:
nodeConnectedin interfaceConnectionManager
-
disconnectFromNode
- Specified by:
disconnectFromNodein interfaceConnectionManager
-
getConnectionProfile
- Specified by:
getConnectionProfilein interfaceConnectionManager
-
getAnyRemoteConnection
-
getAllConnectedNodes
- Specified by:
getAllConnectedNodesin interfaceConnectionManager
-
size
public int size()- Specified by:
sizein interfaceConnectionManager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnectionManager
-
closeNoBlock
public void closeNoBlock()- Specified by:
closeNoBlockin interfaceConnectionManager
-
resolveRemoteClusterAlias
This method returns a remote cluster alias for the given transport connection if it targets a node in the remote cluster. This method will return an optional empty in case the connection targets the local node or the node in the local cluster.- Parameters:
connection- the transport connection for which to resolve a remote cluster alias- Returns:
- a cluster alias if the connection target a node in the remote cluster, otherwise an empty result
-
resolveRemoteClusterAliasWithCredentials
public static Optional<RemoteConnectionManager.RemoteClusterAliasWithCredentials> resolveRemoteClusterAliasWithCredentials(Transport.Connection connection) This method returns information (alias and credentials) for remote cluster for the given transport connection. Either or both of alias and credentials can be null depending on the connection.- Parameters:
connection- the transport connection for which to resolve a remote cluster alias
-