public class WebSocketMessageRouter extends Object
| Modifier and Type | Field and Description |
|---|---|
private String |
endpointId |
private static org.slf4j.Logger |
logger |
private org.apache.nifi.processor.Processor |
processor |
private Map<String,WebSocketSession> |
sessions |
| Constructor and Description |
|---|
WebSocketMessageRouter(String endpointId) |
| Modifier and Type | Method and Description |
|---|---|
void |
captureSession(WebSocketSession session) |
boolean |
containsSession(String sessionId) |
void |
deregisterProcessor(org.apache.nifi.processor.Processor processor) |
void |
disconnect(String sessionId,
String reason) |
private WebSocketSession |
getSessionOrFail(String sessionId) |
boolean |
isProcessorRegistered(org.apache.nifi.processor.Processor processor) |
void |
onWebSocketBinary(String sessionId,
byte[] payload,
int offset,
int length) |
void |
onWebSocketClose(String sessionId,
int statusCode,
String reason) |
void |
onWebSocketText(String sessionId,
String message) |
void |
registerProcessor(org.apache.nifi.processor.Processor processor) |
void |
sendMessage(String sessionId,
SendMessage sendMessage) |
private static final org.slf4j.Logger logger
private final String endpointId
private final Map<String,WebSocketSession> sessions
private volatile org.apache.nifi.processor.Processor processor
public WebSocketMessageRouter(String endpointId)
public void registerProcessor(org.apache.nifi.processor.Processor processor)
throws WebSocketConfigurationException
WebSocketConfigurationExceptionpublic boolean isProcessorRegistered(org.apache.nifi.processor.Processor processor)
public void deregisterProcessor(org.apache.nifi.processor.Processor processor)
public void captureSession(WebSocketSession session)
public void onWebSocketBinary(String sessionId, byte[] payload, int offset, int length)
private WebSocketSession getSessionOrFail(String sessionId)
public void sendMessage(String sessionId, SendMessage sendMessage) throws IOException
IOExceptionpublic void disconnect(String sessionId, String reason) throws IOException
IOExceptionpublic boolean containsSession(String sessionId)
Copyright © 2021 Apache NiFi Project. All rights reserved.