Class SiteInfoProvider

java.lang.Object
org.apache.nifi.remote.client.SiteInfoProvider

public class SiteInfoProvider extends Object
  • Field Details

    • REMOTE_REFRESH_MILLIS

      private static final long REMOTE_REFRESH_MILLIS
    • listeningPortRWLock

      private final ReadWriteLock listeningPortRWLock
    • remoteInfoReadLock

      private final Lock remoteInfoReadLock
    • remoteInfoWriteLock

      private final Lock remoteInfoWriteLock
    • siteToSitePort

      private Integer siteToSitePort
    • siteToSiteHttpPort

      private Integer siteToSiteHttpPort
    • siteToSiteSecure

      private Boolean siteToSiteSecure
    • remoteRefreshTime

      private long remoteRefreshTime
    • proxy

      private HttpProxy proxy
    • localAddress

      private InetAddress localAddress
    • inputPortMap

      private final Map<String,String> inputPortMap
    • outputPortMap

      private final Map<String,String> outputPortMap
    • clusterUrls

      private Set<String> clusterUrls
    • activeClusterUrl

      private URI activeClusterUrl
    • sslContext

      private SSLContext sslContext
    • connectTimeoutMillis

      private int connectTimeoutMillis
    • readTimeoutMillis

      private int readTimeoutMillis
    • cachedContentExpirationMillis

      private long cachedContentExpirationMillis
  • Constructor Details

    • SiteInfoProvider

      public SiteInfoProvider()
  • Method Details

    • refreshRemoteInfo

      private ControllerDTO refreshRemoteInfo() throws IOException
      Throws:
      IOException
    • createSiteToSiteRestApiClient

      protected SiteToSiteRestApiClient createSiteToSiteRestApiClient(SSLContext sslContext, HttpProxy proxy)
    • isWebInterfaceSecure

      public boolean isWebInterfaceSecure()
    • getSiteToSitePort

      public Integer getSiteToSitePort() throws IOException
      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

      public Integer getSiteToSiteHttpPort() throws IOException
      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

      public boolean isSecure() throws IOException
      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

      public String getInputPortIdentifier(String portName) throws IOException
      Throws:
      IOException
    • getOutputPortIdentifier

      public String getOutputPortIdentifier(String portName) throws IOException
      Throws:
      IOException
    • getPortIdentifier

      private String getPortIdentifier(String portName, Map<String,String> portMap) throws IOException
      Throws:
      IOException
    • getActiveClusterUrl

      public URI getActiveClusterUrl() throws IOException
      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

      public void setClusterUrls(Set<String> clusterUrls)
    • getClusterUrls

      public Set<String> getClusterUrls()
    • setSslContext

      public void setSslContext(SSLContext sslContext)
    • setConnectTimeoutMillis

      public void setConnectTimeoutMillis(int connectTimeoutMillis)
    • setReadTimeoutMillis

      public void setReadTimeoutMillis(int readTimeoutMillis)
    • setCachedContentsExpirationMillis

      public void setCachedContentsExpirationMillis(long expirationMillis)
    • setProxy

      public void setProxy(HttpProxy proxy)
    • setLocalAddress

      public void setLocalAddress(InetAddress localAddress)