public class SocketRemoteSiteListener extends Object implements RemoteSiteListener
| Modifier and Type | Field and Description |
|---|---|
private static int |
EXCEPTION_THRESHOLD_MILLIS |
private static org.slf4j.Logger |
LOG |
private NiFiProperties |
nifiProperties |
private NodeInformant |
nodeInformant |
private PeerDescriptionModifier |
peerDescriptionModifier |
private AtomicReference<ProcessGroup> |
rootGroup |
private int |
socketPort |
private SSLContext |
sslContext |
private AtomicBoolean |
stopped |
private long |
tlsErrorLastSeen |
| Constructor and Description |
|---|
SocketRemoteSiteListener(int socketPort,
SSLContext sslContext,
NiFiProperties nifiProperties) |
SocketRemoteSiteListener(int socketPort,
SSLContext sslContext,
NiFiProperties nifiProperties,
NodeInformant nodeInformant) |
| Modifier and Type | Method and Description |
|---|---|
private Socket |
acceptConnection(ServerSocket serverSocket) |
private ServerSocket |
createServerSocket() |
void |
destroy() |
private String |
getPeerIdentity(SSLSocket sslSocket) |
private int |
getPort() |
private void |
handleRequest(ServerProtocol protocol,
Peer peer,
RequestType requestType) |
private boolean |
handleTlsError(String msg) |
private boolean |
isTlsError(Throwable e) |
void |
setRootGroup(ProcessGroup rootGroup) |
void |
start() |
void |
stop() |
private boolean |
tlsErrorRecentlySeen()
Returns
true if any related exception has occurred within the last
EXCEPTION_THRESHOLD_MILLIS milliseconds. |
private void |
verifyMagicBytes(InputStream in,
String peerDescription) |
private final int socketPort
private final SSLContext sslContext
private final NodeInformant nodeInformant
private final AtomicReference<ProcessGroup> rootGroup
private final NiFiProperties nifiProperties
private final PeerDescriptionModifier peerDescriptionModifier
private static final int EXCEPTION_THRESHOLD_MILLIS
private volatile long tlsErrorLastSeen
private final AtomicBoolean stopped
private static final org.slf4j.Logger LOG
public SocketRemoteSiteListener(int socketPort,
SSLContext sslContext,
NiFiProperties nifiProperties)
public SocketRemoteSiteListener(int socketPort,
SSLContext sslContext,
NiFiProperties nifiProperties,
NodeInformant nodeInformant)
public void setRootGroup(ProcessGroup rootGroup)
setRootGroup in interface RemoteSiteListenerpublic void start()
throws IOException
start in interface RemoteSiteListenerIOExceptionprivate boolean isTlsError(Throwable e)
private String getPeerIdentity(SSLSocket sslSocket) throws SSLPeerUnverifiedException
SSLPeerUnverifiedExceptionprivate boolean handleTlsError(String msg)
private boolean tlsErrorRecentlySeen()
true if any related exception has occurred within the last
EXCEPTION_THRESHOLD_MILLIS milliseconds. Does not evaluate the error locally,
simply checks the last time the timestamp was updated.private ServerSocket createServerSocket() throws IOException
IOExceptionprivate Socket acceptConnection(ServerSocket serverSocket)
private void handleRequest(ServerProtocol protocol, Peer peer, RequestType requestType) throws IOException, NotAuthorizedException, BadRequestException, RequestExpiredException
private int getPort()
public void stop()
stop in interface RemoteSiteListenerpublic void destroy()
destroy in interface RemoteSiteListenerprivate void verifyMagicBytes(InputStream in, String peerDescription) throws IOException
IOExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.