@Tags(value={"WebSocket","Jetty","client"})
@CapabilityDescription(value="Implementation of WebSocketClientService. This service uses Jetty WebSocket client module to provide WebSocket session management throughout the application.")
public class JettyWebSocketClient
extends AbstractJettyWebSocketService
implements WebSocketClientService
| Modifier and Type | Field and Description |
|---|---|
private Map<String,String> |
activeSessions |
static org.apache.nifi.components.PropertyDescriptor |
AUTH_CHARSET |
private String |
authorizationHeader |
private org.eclipse.jetty.websocket.client.WebSocketClient |
client |
static org.apache.nifi.components.PropertyDescriptor |
CONNECTION_TIMEOUT |
private ReentrantLock |
connectionLock |
private long |
connectionTimeoutMillis |
private static List<org.apache.nifi.components.PropertyDescriptor> |
properties |
static org.apache.nifi.components.PropertyDescriptor |
PROXY_HOST |
static org.apache.nifi.components.PropertyDescriptor |
PROXY_PORT |
static org.apache.nifi.components.PropertyDescriptor |
SESSION_MAINTENANCE_INTERVAL |
private ScheduledExecutorService |
sessionMaintenanceScheduler |
static org.apache.nifi.components.PropertyDescriptor |
USER_NAME |
static org.apache.nifi.components.PropertyDescriptor |
USER_PASSWORD |
private URI |
webSocketUri |
static org.apache.nifi.components.PropertyDescriptor |
WS_URI |
INPUT_BUFFER_SIZE, MAX_BINARY_MESSAGE_SIZE, MAX_TEXT_MESSAGE_SIZEroutersSSL_CONTEXT| Constructor and Description |
|---|
JettyWebSocketClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(String clientId) |
private void |
connect(String clientId,
String sessionId) |
protected Collection<org.apache.nifi.components.ValidationResult> |
customValidate(org.apache.nifi.components.ValidationContext validationContext) |
protected List<org.apache.nifi.components.PropertyDescriptor> |
getSupportedPropertyDescriptors() |
String |
getTargetUri() |
(package private) void |
maintainSessions() |
void |
startClient(org.apache.nifi.controller.ConfigurationContext context) |
void |
stopClient() |
configurePolicy, createSslFactory, getAbstractPropertyDescriptorsderegisterProcessor, isProcessorRegistered, registerProcessor, sendMessageabstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getConfigurationContext, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabledequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitderegisterProcessor, isProcessorRegistered, registerProcessor, sendMessagepublic static final org.apache.nifi.components.PropertyDescriptor WS_URI
public static final org.apache.nifi.components.PropertyDescriptor CONNECTION_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor SESSION_MAINTENANCE_INTERVAL
public static final org.apache.nifi.components.PropertyDescriptor USER_NAME
public static final org.apache.nifi.components.PropertyDescriptor USER_PASSWORD
public static final org.apache.nifi.components.PropertyDescriptor AUTH_CHARSET
public static final org.apache.nifi.components.PropertyDescriptor PROXY_HOST
public static final org.apache.nifi.components.PropertyDescriptor PROXY_PORT
private static final List<org.apache.nifi.components.PropertyDescriptor> properties
private org.eclipse.jetty.websocket.client.WebSocketClient client
private URI webSocketUri
private String authorizationHeader
private long connectionTimeoutMillis
private volatile ScheduledExecutorService sessionMaintenanceScheduler
private final ReentrantLock connectionLock
protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent@OnEnabled
public void startClient(org.apache.nifi.controller.ConfigurationContext context)
throws Exception
startClient in interface WebSocketClientServiceExceptionprotected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext)
customValidate in class org.apache.nifi.components.AbstractConfigurableComponent@OnDisabled
@OnShutdown
public void stopClient()
throws Exception
stopClient in interface WebSocketClientServiceExceptionpublic void connect(String clientId) throws IOException
connect in interface WebSocketClientServiceIOExceptionprivate void connect(String clientId, String sessionId) throws IOException
IOExceptionpublic String getTargetUri()
getTargetUri in interface WebSocketClientServiceCopyright © 2021 Apache NiFi Project. All rights reserved.