Interface DataStoreProvider
Interface used for storing & retrieving information. Also used to search
user.
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
convertUserIdToUniversalId
(String userId, String realm) Converts the provided user ID to universal ID if it wasn't in the universal ID format already.getAttribute
(String userID, String attrName) Gets user attribute.getAttributes
(String userID, Set<String> attrNames) Gets user attributes.byte[][]
getBinaryAttribute
(String userID, String attrName) Gets user binary attribute.getBinaryAttributes
(String userID, Set<String> attrNames) Gets user binary attributes.Searches user.void
Initializes the provider.boolean
isUserExists
(String userID) Checks if the user exists with a given userid.default boolean
isUsernameUniversalId
(String username) Checks if the given username is of the universal ID format.void
Sets user attributes.
-
Method Details
-
init
Initializes the provider.- Parameters:
componentName
- Component name, such as saml, saml2, id-ff, disco, authnsvc, and idpp.- Throws:
DataStoreProviderException
- if an error occurred during initialization.
-
getAttribute
Gets user attribute.- Parameters:
userID
- ID value for the user.attrName
- Name of the attribute whose value to be retrieved.- Returns:
- Set of the values for the attribute.
- Throws:
DataStoreProviderException
- if an error occurred.
-
getAttributes
Map<String,Set<String>> getAttributes(String userID, Set<String> attrNames) throws DataStoreProviderException Gets user attributes.- Parameters:
userID
- ID value for the user.attrNames
- The Set of attribute names.- Returns:
- Map of specified attributes. Map key is the attribute name and value is the attribute value Set.
- Throws:
DataStoreProviderException
- if an error occurred.
-
getBinaryAttribute
Gets user binary attribute.- Parameters:
userID
- ID value for the user.attrName
- Name of the attribute whose value to be retrieved.- Returns:
- Set of the values for the attribute.
- Throws:
DataStoreProviderException
- if an error occurred.
-
getBinaryAttributes
Map<String,byte[][]> getBinaryAttributes(String userID, Set<String> attrNames) throws DataStoreProviderException Gets user binary attributes.- Parameters:
userID
- ID value for the user.attrNames
- The Set of attribute names.- Returns:
- Map of specified attributes. Map key is the attribute name and value is the attribute value Set.
- Throws:
DataStoreProviderException
- if an error occurred.
-
setAttributes
void setAttributes(String userID, Map<String, Set<String>> attrMap) throws DataStoreProviderExceptionSets user attributes.- Parameters:
userID
- ID value for the user.attrMap
- Map of specified attributes to be set. Map key is the attribute name and value is the attribute value Set.- Throws:
DataStoreProviderException
- if an error occurred.
-
getUserID
Searches user.- Parameters:
orgDN
- The organization to search the user.avPairs
- Attribute value pairs that will be used for searching the user.- Throws:
DataStoreProviderException
- if an error occurred.
-
isUsernameUniversalId
Checks if the given username is of the universal ID format.- Parameters:
username
- The user's ID (either just the username, or a universal ID)- Returns:
- true if the username is a universal ID, otherwise false.
- Throws:
DataStoreProviderException
-
convertUserIdToUniversalId
Converts the provided user ID to universal ID if it wasn't in the universal ID format already.- Parameters:
userId
- The user's ID (either just the username, or a universal ID).realm
- The realm the user belongs to.- Returns:
- The user's universal ID.
-
isUserExists
Checks if the user exists with a given userid.- Parameters:
userID
- ID of an user- Returns:
true
if the user exists;false
otherwise.- Throws:
DataStoreProviderException
- if an error occurred.
-