Class WebSocketMessageRouter

java.lang.Object
org.apache.nifi.websocket.WebSocketMessageRouter

public class WebSocketMessageRouter extends Object
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • endpointId

      private final String endpointId
    • sessions

      private final Map<String,WebSocketSession> sessions
    • processor

      private volatile org.apache.nifi.processor.Processor processor
  • Constructor Details

    • WebSocketMessageRouter

      public WebSocketMessageRouter(String endpointId)
  • Method Details

    • registerProcessor

      public void registerProcessor(org.apache.nifi.processor.Processor processor) throws WebSocketConfigurationException
      Throws:
      WebSocketConfigurationException
    • isProcessorRegistered

      public boolean isProcessorRegistered(org.apache.nifi.processor.Processor processor)
    • deregisterProcessor

      public void deregisterProcessor(org.apache.nifi.processor.Processor processor)
    • captureSession

      public void captureSession(WebSocketSession session)
    • onWebSocketClose

      public void onWebSocketClose(String sessionId, int statusCode, String reason)
    • onWebSocketText

      public void onWebSocketText(String sessionId, String message)
    • onWebSocketBinary

      public void onWebSocketBinary(String sessionId, byte[] payload, int offset, int length)
    • getSessionOrFail

      private WebSocketSession getSessionOrFail(String sessionId)
    • sendMessage

      public void sendMessage(String sessionId, SendMessage sendMessage) throws IOException
      Throws:
      IOException
    • disconnect

      public void disconnect(String sessionId, String reason) throws IOException
      Throws:
      IOException
    • containsSession

      public boolean containsSession(String sessionId)