Class WebSocketSettings

java.lang.Object
org.apache.pekko.http.scaladsl.settings.WebSocketSettings
All Implemented Interfaces:
WebSocketSettings
Direct Known Subclasses:
WebSocketSettingsImpl

public abstract class WebSocketSettings extends Object implements WebSocketSettings
  • Constructor Details

    • WebSocketSettings

      public WebSocketSettings()
  • Method Details

    • getPeriodicKeepAliveData

      public final Supplier<org.apache.pekko.util.ByteString> getPeriodicKeepAliveData()
      Description copied from interface: WebSocketSettings
      The provided supplier will be invoked for each new keep-alive frame that is sent. The ByteString will be included in the Ping or Pong frame sent as heartbeat, so keep in mind to keep it relatively small, in order not to make the frames too bloated.
      Specified by:
      getPeriodicKeepAliveData in interface WebSocketSettings
      Returns:
      (undocumented)
    • getRandomFactory

      public final Supplier<Random> getRandomFactory()
      Specified by:
      getRandomFactory in interface WebSocketSettings
    • logFrames

      public abstract boolean logFrames()
      Specified by:
      logFrames in interface WebSocketSettings
    • periodicKeepAliveData

      public abstract scala.Function0<org.apache.pekko.util.ByteString> periodicKeepAliveData()
      The provided function will be invoked for each new keep-alive frame that is sent. The ByteString will be included in the Ping or Pong frame sent as heartbeat, so keep in mind to keep it relatively small, in order not to make the frames too bloated.
      Returns:
      (undocumented)
    • periodicKeepAliveMaxIdle

      public abstract scala.concurrent.duration.Duration periodicKeepAliveMaxIdle()
      Specified by:
      periodicKeepAliveMaxIdle in interface WebSocketSettings
    • periodicKeepAliveMode

      public abstract String periodicKeepAliveMode()
      Specified by:
      periodicKeepAliveMode in interface WebSocketSettings
    • randomFactory

      public abstract scala.Function0<Random> randomFactory()
    • receiveIdleTimeout

      public abstract scala.concurrent.duration.Duration receiveIdleTimeout()
      Description copied from interface: WebSocketSettings
      Maximum allowable time between two consecutive frames being received. If exceeded, the WebSocket flow is failed with a pekko.http.scaladsl.model.ws.WebSocketIdleTimeoutException. Duration.Inf disables the check.

      Specified by:
      receiveIdleTimeout in interface WebSocketSettings
      Returns:
      (undocumented)
      Since:
      2.0.0
    • sendIdleTimeout

      public abstract scala.concurrent.duration.Duration sendIdleTimeout()
      Description copied from interface: WebSocketSettings
      Maximum allowable time between two consecutive frames being sent. If exceeded, the WebSocket flow is failed with a pekko.http.scaladsl.model.ws.WebSocketIdleTimeoutException. Duration.Inf disables the check.

      Specified by:
      sendIdleTimeout in interface WebSocketSettings
      Returns:
      (undocumented)
      Since:
      2.0.0
    • withLogFrames

      public WebSocketSettings withLogFrames(boolean shouldLog)
      Specified by:
      withLogFrames in interface WebSocketSettings
    • withPeriodicKeepAliveData

      public WebSocketSettings withPeriodicKeepAliveData(scala.Function0<org.apache.pekko.util.ByteString> newValue)
    • withPeriodicKeepAliveMaxIdle

      public WebSocketSettings withPeriodicKeepAliveMaxIdle(scala.concurrent.duration.Duration newValue)
      Specified by:
      withPeriodicKeepAliveMaxIdle in interface WebSocketSettings
    • withPeriodicKeepAliveMode

      public WebSocketSettings withPeriodicKeepAliveMode(String newValue)
      Specified by:
      withPeriodicKeepAliveMode in interface WebSocketSettings
    • withRandomFactoryFactory

      public WebSocketSettings withRandomFactoryFactory(Supplier<Random> newValue)
      Specified by:
      withRandomFactoryFactory in interface WebSocketSettings
    • withReceiveIdleTimeout

      public WebSocketSettings withReceiveIdleTimeout(scala.concurrent.duration.Duration newValue)
      Specified by:
      withReceiveIdleTimeout in interface WebSocketSettings
      Parameters:
      newValue - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.0.0
    • withSendIdleTimeout

      public WebSocketSettings withSendIdleTimeout(scala.concurrent.duration.Duration newValue)
      Specified by:
      withSendIdleTimeout in interface WebSocketSettings
      Parameters:
      newValue - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.0.0