Package com.isode.dsapi.config
Class OAuthEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.OAuthEntry
This class wraps an OAuth configuration entry stored.
-
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger -
Constructor Summary
ConstructorsConstructorDescriptionOAuthEntry(Entry entry, IsodeDirectorySession ds) Construct from the entry object. -
Method Summary
Modifier and TypeMethodDescriptionstatic OAuthEntrycreate(IsodeDirectorySession ds, String serverAddress, Integer serverPort, Integer tokenPort, Integer tokenDuration, Integer refreshTokenDuration, Boolean allowNonTLSMode, Boolean useClientStrongAuth) Construct entry (which will be something like "cn=oauth,cn=config").Get value of allowNonTLSMode.Get refresh token durationGet the server address or hostname.Get the server port.Get the service enabled flag.Get the token duration.Get the token port.Get value of useClientStrongAuth.voidLoad values from an entry.voidsetAllowNonTLSMode(Boolean allowNonTLSMode) Set the value of allowNonTLSMode.voidsetRefreshTokenDuration(Integer refreshTokenDuration) Set the refresh token duration.voidsetServerAddress(String addr) Set the server address or hostname.voidsetServerPort(Integer serverPort) Set the server port.voidsetServiceEnabled(Boolean enabled) Set the service enabled flag.voidsetTokenDuration(Integer tokenDuration) Set the token duration.voidsetTokenPort(Integer tokenPort) Set the token port.voidsetUseClientStrongAuth(Boolean useClientStrongAuth) Set the value of useClientStrongAuth.Methods inherited from class com.isode.dsapi.config.ManagedObject
addAttribute, addAttribute, addAttribute, addAttributeValue, addAttributeValue, addEntry, addOC, checkMandatory, checkMandatory, checkMandatory, checkMandatory, commit, commitNoRefresh, createAP, createAttributeType, createDN, createPA, createRDN, createRDN, getAttribute, getAttributeDefaultWhenNull, getDN, getIsodeDirectorySession, getMultiValueBer, getMultiValuedInteger, getMultiValuedInteger, getMultiValuedString, getMultiValuedString, getPA, getValue, getValueAttrTypeFromOID, getValueBer, getValueBoolean, getValueDate, getValueDate, getValueDN, getValueInteger, getValueInteger, getValueString, getValueString, getValueStringFromAttribute, hasAttributeChanged, hasChanges, remove, removeAttr, removeStringValue, reset, reset, updateAttr, updateAttr, updateAttr, updateBoolean, updateDN, updateInteger, updateMultiValuedBER, updateMultiValuedInteger, updateMultiValuedString, updatePA, updatePA, updateString
-
Constructor Details
-
OAuthEntry
Construct from the entry object.- Parameters:
entry- Entry representing the OAuth config.ds- Isode directory session- Throws:
ConfigOpFailedException- if mandatory attributes are not loaded
-
-
Method Details
-
load
Description copied from class:ManagedObjectLoad 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:
loadin classManagedObject- 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
Get the service enabled flag.- Returns:
- the service enabled flag.
-
setServiceEnabled
Set the service enabled flag.- Parameters:
enabled- The service enabled flag.
-
getServerAddress
Get the server address or hostname.- Returns:
- the server address (null if not set)
-
setServerAddress
Set the server address or hostname.- Parameters:
addr- New address.
-
getServerPort
Get the server port.- Returns:
- Get the server port value (null if not set).
-
setServerPort
Set the server port.- Parameters:
serverPort- Server port value.
-
getTokenPort
Get the token port.- Returns:
-
setTokenPort
Set the token port.- Parameters:
Token- port value.
-
getTokenDuration
Get the token duration.- Returns:
- Token duration value (null if not set).
-
setTokenDuration
Set the token duration.- Parameters:
Set- the token duration.
-
getRefreshTokenDuration
Get refresh token duration- Returns:
- Refresh token duration value (null if not set).
-
setRefreshTokenDuration
Set the refresh token duration.- Parameters:
refreshTokenDuration- Value to set.
-
getAllowNonTLSMode
Get value of allowNonTLSMode.- Returns:
- Value of allowNonTLSMode (null if not set).
-
setAllowNonTLSMode
Set the value of allowNonTLSMode.- Parameters:
allowNonTLSMode- Value to set.
-
getUseClientStrongAuth
Get value of useClientStrongAuth.- Returns:
- Value of useClientStrongAuth (null if not set).
-
setUseClientStrongAuth
Set the value of useClientStrongAuth.- Parameters:
useClientStrongAuth- Value to set.
-