Class OAuthEntry

java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.OAuthEntry

public class OAuthEntry extends ManagedObject
This class wraps an OAuth configuration entry stored.
  • Constructor Details

  • Method Details

    • load

      public void load(Entry entry) throws ConfigOpFailedException
      Description copied from class: ManagedObject
      Load values from an entry. No directory operation should be done in this method.

      Mandatory variables are assigned only after everything is ok. This is done so during re-loading, if there are exceptions and even then the object is used, there is no crash by using mandatory variables that are assumed to have non-null values.

      Specified by:
      load in class ManagedObject
      Parameters:
      entry - Entry representing the object, could be null if the existing entry has to be reloaded
      Throws:
      ConfigOpFailedException - if mandatory attributes are not loaded
    • create

      public static OAuthEntry create(IsodeDirectorySession ds, String serverAddress, Integer serverPort, Integer tokenPort, Integer tokenDuration, Integer refreshTokenDuration, Boolean allowNonTLSMode, Boolean useClientStrongAuth) throws ConfigOpFailedException, ReadFailedException
      Construct entry (which will be something like "cn=oauth,cn=config").

      The returned result will contain attributes containing default values (see code).

      Parameters:
      ds - Directory session.
      Returns:
      created Changelog entry
      Throws:
      ReadFailedException - if there is a problem on reading the committed entry back.
      ConfigOpFailedException - if there is a problem on applying the changes to the directory.
    • getServiceEnabled

      public Boolean getServiceEnabled()
      Get the service enabled flag.
      Returns:
      the service enabled flag.
    • setServiceEnabled

      public void setServiceEnabled(Boolean enabled)
      Set the service enabled flag.
      Parameters:
      enabled - The service enabled flag.
    • getServerAddress

      public String getServerAddress()
      Get the server address or hostname.
      Returns:
      the server address (null if not set)
    • setServerAddress

      public void setServerAddress(String addr)
      Set the server address or hostname.
      Parameters:
      addr - New address.
    • getServerPort

      public Integer getServerPort()
      Get the server port.
      Returns:
      Get the server port value (null if not set).
    • setServerPort

      public void setServerPort(Integer serverPort)
      Set the server port.
      Parameters:
      serverPort - Server port value.
    • getTokenPort

      public Integer getTokenPort()
      Get the token port.
      Returns:
    • setTokenPort

      public void setTokenPort(Integer tokenPort)
      Set the token port.
      Parameters:
      Token - port value.
    • getTokenDuration

      public Integer getTokenDuration()
      Get the token duration.
      Returns:
      Token duration value (null if not set).
    • setTokenDuration

      public void setTokenDuration(Integer tokenDuration)
      Set the token duration.
      Parameters:
      Set - the token duration.
    • getRefreshTokenDuration

      public Integer getRefreshTokenDuration()
      Get refresh token duration
      Returns:
      Refresh token duration value (null if not set).
    • setRefreshTokenDuration

      public void setRefreshTokenDuration(Integer refreshTokenDuration)
      Set the refresh token duration.
      Parameters:
      refreshTokenDuration - Value to set.
    • getAllowNonTLSMode

      public Boolean getAllowNonTLSMode()
      Get value of allowNonTLSMode.
      Returns:
      Value of allowNonTLSMode (null if not set).
    • setAllowNonTLSMode

      public void setAllowNonTLSMode(Boolean allowNonTLSMode)
      Set the value of allowNonTLSMode.
      Parameters:
      allowNonTLSMode - Value to set.
    • getUseClientStrongAuth

      public Boolean getUseClientStrongAuth()
      Get value of useClientStrongAuth.
      Returns:
      Value of useClientStrongAuth (null if not set).
    • setUseClientStrongAuth

      public void setUseClientStrongAuth(Boolean useClientStrongAuth)
      Set the value of useClientStrongAuth.
      Parameters:
      useClientStrongAuth - Value to set.