io.vertx.ext.web.handler.graphql

## Class ApolloWSOptions

- java.lang.Object
- - io.vertx.ext.web.handler.graphql.ApolloWSOptions

-     public class ApolloWSOptions
      extends Object

  Options for configuring the `ApolloWSHandler`.
  Author:
    Rogelio Orts

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `DEFAULT_KEEP_ALIVE` Default interval in milliseconds to send `KEEPALIVE` messages to all clients = 30000.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApolloWSOptions()` Default constructor.
    `ApolloWSOptions(ApolloWSOptions other)` Copy constructor.
    `ApolloWSOptions(JsonObject json)` Constructor to create options from JSON.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getKeepAlive()`
    `String` | `getOrigin()`
    `ApolloWSOptions` | `setKeepAlive(long keepAlive)` Set the interval in milliseconds to send `KEEPALIVE` messages to all clients.
    `ApolloWSOptions` | `setOrigin(String origin)` Set the `Origin` for this handler, by default it will be `null`.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_KEEP_ALIVE

          public static final long DEFAULT_KEEP_ALIVE

      Default interval in milliseconds to send `KEEPALIVE` messages to all clients = 30000.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ApolloWSOptions

          public ApolloWSOptions()

      Default constructor.

    - #### ApolloWSOptions

          public ApolloWSOptions(ApolloWSOptions other)

      Copy constructor.
      Parameters:
        `other` - the options to copy

    - #### ApolloWSOptions

          public ApolloWSOptions(JsonObject json)

      Constructor to create options from JSON.
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Returns:
        a JSON representation of these options

    - #### getKeepAlive

          public long getKeepAlive()

      Returns:
        interval in milliseconds to send `KEEPALIVE` messages to all clients

    - #### setKeepAlive

          public ApolloWSOptions setKeepAlive(long keepAlive)

      Set the interval in milliseconds to send `KEEPALIVE` messages to all clients. Defaults to `30000`.
      Parameters:
        `keepAlive` - interval in milliseconds
      Returns:
        a reference to this, so the API can be used fluently

    - #### getOrigin

          public String getOrigin()

      Returns:
        the `Origin` for this handler. The Origin will be used to prevent Cross-Site WebSocket Hijacking attacks.

    - #### setOrigin

          public ApolloWSOptions setOrigin(String origin)

      Set the `Origin` for this handler, by default it will be `null`.
      Parameters:
        `origin` - web origin for this handler or `null`
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2022 Eclipse. All rights reserved.