Package org.apache.nifi.remote.client
Class SiteInfoProvider
java.lang.Object
org.apache.nifi.remote.client.SiteInfoProvider
-
Field Summary
Modifier and TypeFieldDescriptionprivate URI
private long
private int
private final ReadWriteLock
private InetAddress
private HttpProxy
private int
private static final long
private final Lock
private final Lock
private long
private Integer
private Integer
private Boolean
private SSLContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected SiteToSiteRestApiClient
createSiteToSiteRestApiClient
(SSLContext sslContext, HttpProxy proxy) Return an active cluster URL that is known to work.getInputPortIdentifier
(String portName) getOutputPortIdentifier
(String portName) private String
getPortIdentifier
(String portName, Map<String, String> portMap) getPortIdentifier
(String portName, TransferDirection transferDirection) boolean
isSecure()
boolean
private ControllerDTO
void
setCachedContentsExpirationMillis
(long expirationMillis) void
setClusterUrls
(Set<String> clusterUrls) void
setConnectTimeoutMillis
(int connectTimeoutMillis) void
setLocalAddress
(InetAddress localAddress) void
void
setReadTimeoutMillis
(int readTimeoutMillis) void
setSslContext
(SSLContext sslContext)
-
Field Details
-
REMOTE_REFRESH_MILLIS
private static final long REMOTE_REFRESH_MILLIS -
listeningPortRWLock
-
remoteInfoReadLock
-
remoteInfoWriteLock
-
siteToSitePort
-
siteToSiteHttpPort
-
siteToSiteSecure
-
remoteRefreshTime
private long remoteRefreshTime -
proxy
-
localAddress
-
inputPortMap
-
outputPortMap
-
clusterUrls
-
activeClusterUrl
-
sslContext
-
connectTimeoutMillis
private int connectTimeoutMillis -
readTimeoutMillis
private int readTimeoutMillis -
cachedContentExpirationMillis
private long cachedContentExpirationMillis
-
-
Constructor Details
-
SiteInfoProvider
public SiteInfoProvider()
-
-
Method Details
-
refreshRemoteInfo
- Throws:
IOException
-
createSiteToSiteRestApiClient
protected SiteToSiteRestApiClient createSiteToSiteRestApiClient(SSLContext sslContext, HttpProxy proxy) -
isWebInterfaceSecure
public boolean isWebInterfaceSecure() -
getSiteToSitePort
- Returns:
- the port that the remote instance is listening on for
RAW Socket site-to-site communication, or
null
if the remote instance is not configured to allow site-to-site communications. - Throws:
IOException
- if unable to communicate with the remote instance
-
getSiteToSiteHttpPort
- Returns:
- the port that the remote instance is listening on for
HTTP(S) site-to-site communication, or
null
if the remote instance is not configured to allow site-to-site communications. - Throws:
IOException
- if unable to communicate with the remote instance
-
isSecure
- Returns:
true
if the remote instance is configured for secure site-to-site communications,false
otherwise- Throws:
IOException
- if unable to check if secure
-
getPortIdentifier
public String getPortIdentifier(String portName, TransferDirection transferDirection) throws IOException - Throws:
IOException
-
getInputPortIdentifier
- Throws:
IOException
-
getOutputPortIdentifier
- Throws:
IOException
-
getPortIdentifier
- Throws:
IOException
-
getActiveClusterUrl
Return an active cluster URL that is known to work. If it is unknown yet or cache is expired, then remote info will be refreshed.- Returns:
- an active cluster URL
- Throws:
IOException
-
setClusterUrls
-
getClusterUrls
-
setSslContext
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis) -
setReadTimeoutMillis
public void setReadTimeoutMillis(int readTimeoutMillis) -
setCachedContentsExpirationMillis
public void setCachedContentsExpirationMillis(long expirationMillis) -
setProxy
-
setLocalAddress
-