Class JsonDirectoryBackend
- java.lang.Object
-
- technology.openpool.ldap.adapter.backend.JsonDirectoryBackend
-
- All Implemented Interfaces:
DirectoryBackend,NestedDirectoryBackend
public class JsonDirectoryBackend extends Object implements NestedDirectoryBackend
The JSON directory backend API for test scenarios.
-
-
Constructor Summary
Constructors Constructor Description JsonDirectoryBackend(ServerConfiguration config)Instantiates a new JSON directory backend.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<GroupEntity>getAllGroups()Gets all groups.Set<GroupEntity>getAllGroups(int startIndex, int maxResults)Gets all groups.Set<UserEntity>getAllUsers()Gets all users.Set<UserEntity>getAllUsers(int startIndex, int maxResults)Gets all users.UserEntitygetAuthenticatedUser(String id, String password)Gets info from authenticated user.Set<GroupEntity>getDirectChildGroupsOfGroup(String id)Gets direct child groups of group.Set<GroupEntity>getDirectGroupsOfUser(String id)Gets direct groups of user.Set<GroupEntity>getDirectParentGroupsOfGroup(String id)Gets direct parent groups of group.Set<UserEntity>getDirectUsersOfGroup(String id)Gets direct users of group.GroupEntitygetGroup(String id)Gets group info.StringgetId()Gets backend ID.MappableCursor<MembershipEntity>getMemberships()Returns a cursor for membership entities.Set<GroupEntity>getTransitiveChildGroupsOfGroup(String id)Gets transitive child groups of group.Set<GroupEntity>getTransitiveGroupsOfUser(String id)Gets transitive groups of user.Set<GroupEntity>getTransitiveParentGroupsOfGroup(String id)Gets transitive parent groups of group.Set<UserEntity>getTransitiveUsersOfGroup(String id)Gets transitive users of group.UserEntitygetUser(String id)Gets user info.MappableCursor<Row>runQueryExpression(String txId, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager, QueryExpression expression, EntityType entityType)Runs a query expression.voidshutdown()Shutdown method.voidstartup()Startup method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface technology.openpool.ldap.adapter.api.directory.NestedDirectoryBackend
acquireDbLock, dropAllGroups, dropAllUsers, dropGroup, dropMembership, dropUser, releaseDbLock, requireReset, upsertAllGroups, upsertAllGroups, upsertAllUsers, upsertAllUsers, upsertGroup, upsertMembership, upsertUser, upsertUser, withReadAccess, withReadAccess, withWriteAccess, withWriteAccess
-
-
-
-
Constructor Detail
-
JsonDirectoryBackend
public JsonDirectoryBackend(ServerConfiguration config)
Instantiates a new JSON directory backend.- Parameters:
config- the config instance of the server
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:DirectoryBackendGets backend ID.- Specified by:
getIdin interfaceDirectoryBackend- Returns:
- the backend ID
-
startup
public void startup()
Description copied from interface:DirectoryBackendStartup method.- Specified by:
startupin interfaceDirectoryBackend
-
shutdown
public void shutdown()
Description copied from interface:DirectoryBackendShutdown method.- Specified by:
shutdownin interfaceDirectoryBackend
-
runQueryExpression
public MappableCursor<Row> runQueryExpression(String txId, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager, QueryExpression expression, EntityType entityType)
Description copied from interface:DirectoryBackendRuns a query expression.- Specified by:
runQueryExpressionin interfaceDirectoryBackend- Parameters:
txId- the transaction IDschemaManager- the schema managerexpression- the query expressionentityType- the entity type- Returns:
- the query generator
-
getGroup
public GroupEntity getGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets group info.- Specified by:
getGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the group
- Throws:
EntityNotFoundException- the entry not found exception
-
getUser
public UserEntity getUser(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets user info.- Specified by:
getUserin interfaceDirectoryBackend- Parameters:
id- the user ID- Returns:
- the user
- Throws:
EntityNotFoundException- the entry not found exception
-
getAuthenticatedUser
public UserEntity getAuthenticatedUser(String id, String password) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets info from authenticated user.- Specified by:
getAuthenticatedUserin interfaceDirectoryBackend- Parameters:
id- the user IDpassword- the password- Returns:
- the authenticated user
- Throws:
EntityNotFoundException- the entry not found exception
-
getAllGroups
public Set<GroupEntity> getAllGroups()
Description copied from interface:DirectoryBackendGets all groups.- Specified by:
getAllGroupsin interfaceDirectoryBackend- Returns:
- the groups
-
getAllGroups
public Set<GroupEntity> getAllGroups(int startIndex, int maxResults)
Description copied from interface:DirectoryBackendGets all groups.- Specified by:
getAllGroupsin interfaceDirectoryBackend- Returns:
- the groups
-
getAllUsers
public Set<UserEntity> getAllUsers()
Description copied from interface:DirectoryBackendGets all users.- Specified by:
getAllUsersin interfaceDirectoryBackend- Returns:
- the users
-
getAllUsers
public Set<UserEntity> getAllUsers(int startIndex, int maxResults)
Description copied from interface:DirectoryBackendGets all users.- Specified by:
getAllUsersin interfaceDirectoryBackend- Returns:
- the users
-
getDirectUsersOfGroup
public Set<UserEntity> getDirectUsersOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets direct users of group.- Specified by:
getDirectUsersOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the direct users of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getDirectGroupsOfUser
public Set<GroupEntity> getDirectGroupsOfUser(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets direct groups of user.- Specified by:
getDirectGroupsOfUserin interfaceDirectoryBackend- Parameters:
id- the user ID- Returns:
- the direct groups of user
- Throws:
EntityNotFoundException- the entry not found exception
-
getTransitiveUsersOfGroup
public Set<UserEntity> getTransitiveUsersOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets transitive users of group.- Specified by:
getTransitiveUsersOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the transitive users of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getTransitiveGroupsOfUser
public Set<GroupEntity> getTransitiveGroupsOfUser(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets transitive groups of user.- Specified by:
getTransitiveGroupsOfUserin interfaceDirectoryBackend- Parameters:
id- the user ID- Returns:
- the transitive groups of user
- Throws:
EntityNotFoundException- the entry not found exception
-
getDirectChildGroupsOfGroup
public Set<GroupEntity> getDirectChildGroupsOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets direct child groups of group.- Specified by:
getDirectChildGroupsOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the direct child groups of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getDirectParentGroupsOfGroup
public Set<GroupEntity> getDirectParentGroupsOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets direct parent groups of group.- Specified by:
getDirectParentGroupsOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the direct parent groups of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getTransitiveChildGroupsOfGroup
public Set<GroupEntity> getTransitiveChildGroupsOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets transitive child groups of group.- Specified by:
getTransitiveChildGroupsOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the transitive child groups of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getTransitiveParentGroupsOfGroup
public Set<GroupEntity> getTransitiveParentGroupsOfGroup(String id) throws EntityNotFoundException
Description copied from interface:DirectoryBackendGets transitive parent groups of group.- Specified by:
getTransitiveParentGroupsOfGroupin interfaceDirectoryBackend- Parameters:
id- the group ID- Returns:
- the transitive parent groups of group
- Throws:
EntityNotFoundException- the entry not found exception
-
getMemberships
public MappableCursor<MembershipEntity> getMemberships()
Description copied from interface:NestedDirectoryBackendReturns a cursor for membership entities.- Specified by:
getMembershipsin interfaceNestedDirectoryBackend- Returns:
- the cursor with membership elements
-
-