Class RestConfig

java.lang.Object
com.hazelcast.config.rest.RestConfig

public class RestConfig extends Object
This class allows controlling the Hazelcast REST API feature.
Since:
5.4
  • Constructor Details

    • RestConfig

      public RestConfig()
      Default constructor for RestConfig.
  • Method Details

    • getRequestTimeoutDuration

      public Duration getRequestTimeoutDuration()
      Return the HTTP request timeout.
      Returns:
    • setRequestTimeoutDuration

      public void setRequestTimeoutDuration(Duration requestTimeoutDuration)
      Set the HTTP request timeout. Default is 120 seconds. WARNING: The resolution for requestTimeoutDuration can not be more than a second.
      Parameters:
      requestTimeoutDuration -
      Throws:
      IllegalArgumentException - if requestTimeoutDuration is negative
    • isEnabled

      public boolean isEnabled()
      Checks if the RestConfig is enabled.
      Returns:
      true if the RestConfig is enabled, false otherwise.
    • setEnabled

      public RestConfig setEnabled(boolean enabled)
      Sets the enabled status of the RestConfig.
      Parameters:
      enabled - the new enabled status.
      Returns:
      the updated RestConfig.
    • getPort

      public int getPort()
      Gets the port of the RestConfig.
      Returns:
      the port of the RestConfig.
    • setPort

      public RestConfig setPort(int port)
      Sets the port of the RestConfig.
      Parameters:
      port - the new port.
      Returns:
      the updated RestConfig.
    • getSecurityRealm

      public String getSecurityRealm()
      Gets the name of the Rest security realm.
      Returns:
      the name of the realm.
    • setSecurityRealm

      public RestConfig setSecurityRealm(String securityRealm)
      Sets the name of the Rest security realm.
      Parameters:
      securityRealm - the name of the realm. This should be an already defined valid security realm.
    • getTokenValidityDuration

      public Duration getTokenValidityDuration()
      Gets the token validity duration.
      Returns:
      the duration for which the token is valid.
    • setTokenValidityDuration

      public RestConfig setTokenValidityDuration(Duration tokenValidityDuration)
      Sets the expiration duration for jwt token. WARNING: The resolution for tokenValidityDuration can not be more than a second.
      Parameters:
      tokenValidityDuration - the duration for which the token should be valid.
    • getSsl

      public RestConfig.Ssl getSsl()
      Gets the SSL configuration.
      Returns:
      the SSL configuration.
    • setSsl

      public RestConfig setSsl(RestConfig.Ssl ssl)
      Sets the SSL configuration.
      Parameters:
      ssl - the new SSL configuration.
      Returns:
      the updated RestConfig.
    • toString

      public String toString()
      Returns a string representation of the RestConfig.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the RestConfig.