Class SocketClient
java.lang.Object
org.apache.nifi.remote.client.AbstractSiteToSiteClient
org.apache.nifi.remote.client.socket.SocketClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SiteToSiteClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.nifi.remote.client.SiteToSiteClient
SiteToSiteClient.Builder, SiteToSiteClient.StandardSiteToSiteClientConfig
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private final boolean
private static final org.slf4j.Logger
private final long
private final EndpointConnectionPool
private String
private final String
Fields inherited from class org.apache.nifi.remote.client.AbstractSiteToSiteClient
config, siteInfoProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private RemoteDestination
createRemoteDestination
(String portId, String portName) createTransaction
(TransferDirection direction) Creates a new Transaction that can be used to either send data to a remote NiFi instance or receive data from a remote NiFi instance, depending on the value passed for thedirection
argument.private String
getPortIdentifier
(TransferDirection direction) boolean
isSecure()
In order to determine whether the server is configured for secure communications, the client may have to query the server's RESTful interface.Methods inherited from class org.apache.nifi.remote.client.AbstractSiteToSiteClient
getConfig
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
pool
-
compress
private final boolean compress -
portName
-
penalizationNanos
private final long penalizationNanos -
portIdentifier
-
closed
private volatile boolean closed
-
-
Constructor Details
-
SocketClient
-
-
Method Details
-
isSecure
Description copied from interface:SiteToSiteClient
In order to determine whether the server is configured for secure communications, the client may have to query the server's RESTful interface. Doing so could result in an IOException.
- Returns:
true
if site-to-site communications with the remote instance are secure,false
if site-to-site communications with the remote instance are not secure. Whether or not communications are secure depends on the server, not the client- Throws:
IOException
- if unable to query the remote instance's RESTful interface or if the remote instance is not configured to allow site-to-site communications
-
getPortIdentifier
- Throws:
IOException
-
createRemoteDestination
-
createTransaction
Description copied from interface:SiteToSiteClient
Creates a new Transaction that can be used to either send data to a remote NiFi instance or receive data from a remote NiFi instance, depending on the value passed for the
direction
argument.Note: If all of the nodes are penalized (See
SiteToSiteClient.Builder.nodePenalizationPeriod(long, TimeUnit)
), then this method will returnnull
.- Parameters:
direction
- specifies which direction the data should be transferred. A value ofTransferDirection.SEND
indicates that this Transaction will send data to the remote instance; a value ofTransferDirection.RECEIVE
indicates that this Transaction will be used to receive data from the remote instance.- Returns:
- a Transaction to use for sending or receiving data, or
null
if all nodes are penalized. - Throws:
IOException
- ioe
-
close
- Throws:
IOException
-