java.lang.Object
org.elasticsearch.transport.RemoteConnectionManager
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ConnectionManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Nested classes/interfaces inherited from interface org.elasticsearch.transport.ConnectionManager
ConnectionManager.ConnectionValidator, ConnectionManager.DelegatingNodeConnectionListener
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TransportConnectionListener listener) void
close()
void
final void
connectToNode
(DiscoveryNode node, ConnectionProfile connectionProfile, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Releasable> listener) Remote cluster connections have a different lifecycle from intra-cluster connections.void
connectToRemoteClusterNode
(DiscoveryNode node, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Void> listener) void
getConnection
(DiscoveryNode node) boolean
nodeConnected
(DiscoveryNode node) void
openConnection
(DiscoveryNode node, ConnectionProfile profile, ActionListener<Transport.Connection> listener) void
removeListener
(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.int
size()
-
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:
connectToNode
in interfaceConnectionManager
- Throws:
ConnectTransportException
-
connectToRemoteClusterNode
public void connectToRemoteClusterNode(DiscoveryNode node, ConnectionManager.ConnectionValidator connectionValidator, ActionListener<Void> listener) throws ConnectTransportException - Throws:
ConnectTransportException
-
addListener
- Specified by:
addListener
in interfaceConnectionManager
-
removeListener
- Specified by:
removeListener
in interfaceConnectionManager
-
openConnection
public void openConnection(DiscoveryNode node, @Nullable ConnectionProfile profile, ActionListener<Transport.Connection> listener) - Specified by:
openConnection
in interfaceConnectionManager
-
getConnection
- Specified by:
getConnection
in interfaceConnectionManager
-
nodeConnected
- Specified by:
nodeConnected
in interfaceConnectionManager
-
disconnectFromNode
- Specified by:
disconnectFromNode
in interfaceConnectionManager
-
getConnectionProfile
- Specified by:
getConnectionProfile
in interfaceConnectionManager
-
getAnyRemoteConnection
-
getAllConnectedNodes
- Specified by:
getAllConnectedNodes
in interfaceConnectionManager
-
size
public int size()- Specified by:
size
in interfaceConnectionManager
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceConnectionManager
-
closeNoBlock
public void closeNoBlock()- Specified by:
closeNoBlock
in 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
-