@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,SessionInfo> |
activeSessions |
static org.apache.nifi.components.PropertyDescriptor |
AUTH_CHARSET |
protected String |
authorizationHeader |
private org.eclipse.jetty.websocket.client.WebSocketClient |
client |
private org.apache.nifi.controller.ConfigurationContext |
configurationContext |
static org.apache.nifi.components.PropertyDescriptor |
CONNECTION_ATTEMPT_COUNT |
static org.apache.nifi.components.PropertyDescriptor |
CONNECTION_TIMEOUT |
private ReentrantLock |
connectionLock |
private long |
connectionTimeoutMillis |
static org.apache.nifi.components.PropertyDescriptor |
CUSTOM_AUTH |
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) |
void |
connect(String clientId,
Map<String,String> flowFileAttributes) |
private void |
connect(String clientId,
String sessionId,
Map<String,String> flowFileAttributes) |
(package private) Future<org.eclipse.jetty.websocket.api.Session> |
createWebsocketSession(RoutingWebSocketListener listener,
org.eclipse.jetty.websocket.client.ClientUpgradeRequest request) |
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 CONNECTION_ATTEMPT_COUNT
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 CUSTOM_AUTH
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 final Map<String,SessionInfo> activeSessions
private final ReentrantLock connectionLock
private org.eclipse.jetty.websocket.client.WebSocketClient client
private URI webSocketUri
private long connectionTimeoutMillis
private volatile ScheduledExecutorService sessionMaintenanceScheduler
private org.apache.nifi.controller.ConfigurationContext configurationContext
protected String authorizationHeader
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 WebSocketClientServiceIOExceptionpublic void connect(String clientId, Map<String,String> flowFileAttributes) throws IOException
connect in interface WebSocketClientServiceIOExceptionprivate void connect(String clientId, String sessionId, Map<String,String> flowFileAttributes) throws IOException
IOExceptionFuture<org.eclipse.jetty.websocket.api.Session> createWebsocketSession(RoutingWebSocketListener listener, org.eclipse.jetty.websocket.client.ClientUpgradeRequest request) throws IOException
IOExceptionpublic String getTargetUri()
getTargetUri in interface WebSocketClientServiceCopyright © 2022 Apache NiFi Project. All rights reserved.