Package org.cristalise.kernel.lookup
Interface LookupManager
- All Superinterfaces:
Lookup
The LookupManager interface contains all of the directory modifying methods
of the Lookup. This allows read-only Lookup implementations. Server processes
will attempt to cast their Lookups into LookupManagers, and fail to start up
if this is not possible.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cristalise.kernel.lookup.Lookup
Lookup.PagedResult, Lookup.SearchConstraints -
Method Summary
Modifier and TypeMethodDescriptiondefault voidRegister a new a Path in the directory.voidadd(Path newPath, TransactionKey transactionKey) Register a new a Path in the directory.default voidAdds the given Agent to the given Role, if they both exist.voidaddRole(AgentPath agent, RolePath rolePath, TransactionKey transactionKey) Adds the given Agent to the given Role, if they both exist.default RolePathcreateRole(RolePath role) Creates a new Role.createRole(RolePath role, TransactionKey transactionKey) Creates a new Role.default voidRemove a Path from the directory.voiddelete(Path path, TransactionKey transactionKey) Remove a Path from the directory.voidinitializeDirectory(TransactionKey transactionKey) Called when a server starts up.voidvoiddefault voidremoveRole(AgentPath agent, RolePath role) Remove the given Agent from the given Role.voidremoveRole(AgentPath agent, RolePath role, TransactionKey transactionKey) Remove the given Agent from the given Role.default voidsetAgentPassword(AgentPath agent, String newPassword) Set permanent password of Agent'sdefault voidsetAgentPassword(AgentPath agent, String newPassword, boolean temporary) Set an Agent's passwordvoidsetAgentPassword(AgentPath agent, String newPassword, boolean temporary, TransactionKey transactionKey) Set an Agent's password This method can be used in server side code or Script to find uncommitted changes during the active transaction.default voidsetHasJobList(RolePath role, boolean hasJobList) Set the flag specifying whether Activities holding this Role should push Jobs its Agents.voidsetHasJobList(RolePath role, boolean hasJobList, TransactionKey transactionKey) Set the flag specifying whether Activities holding this Role should push Jobs its Agents.default voidsetPermission(RolePath role, String permission) Sets the permission of the given Role.voidsetPermission(RolePath role, String permission, TransactionKey transactionKey) Sets the permission of the given Role.default voidsetPermissions(RolePath role, List<String> permissions) Sets the list of permission of the given Role.voidsetPermissions(RolePath role, List<String> permissions, TransactionKey transactionKey) Sets the list of permission of the given Role.Methods inherited from interface org.cristalise.kernel.lookup.Lookup
close, exists, exists, getAgentName, getAgentName, getAgentPath, getAgentPath, getAgents, getAgents, getAgents, getAgents, getChildren, getChildren, getChildren, getChildren, getChildren, getContextTree, getContextTree, getItemPath, getItemPath, getRolePath, getRolePath, getRoles, getRoles, getRoles, getRoles, hasRole, hasRole, open, resolvePath, resolvePath, search, search, search, search, search, search, search, search, search, search, searchAliases, searchAliases, searchAliases, searchAliases
-
Method Details
-
initializeDirectory
Called when a server starts up. The Lookup implementation should ensure that the initial structure of its directory is valid, and create it on first boot. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
transactionKey- identifier of the active transaction- Throws:
ObjectNotFoundException- When initialization data is not found
-
add
Register a new a Path in the directory.- Parameters:
newPath- The path to add- Throws:
ObjectCannotBeUpdated- When there is an error writing to the directoryObjectAlreadyExistsException- When the Path has already been registered
-
add
void add(Path newPath, TransactionKey transactionKey) throws ObjectCannotBeUpdated, ObjectAlreadyExistsException Register a new a Path in the directory. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
newPath- The path to addtransactionKey- identifier of the active transaction- Throws:
ObjectCannotBeUpdated- When there is an error writing to the directoryObjectAlreadyExistsException- When the Path has already been registered
-
delete
Remove a Path from the directory.- Parameters:
path- The path to remove- Throws:
ObjectCannotBeUpdated- When an error occurs writing to the directory
-
delete
Remove a Path from the directory. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
path- The path to removetransactionKey- identifier of the active transaction- Throws:
ObjectCannotBeUpdated- When an error occurs writing to the directory
-
createRole
default RolePath createRole(RolePath role) throws ObjectAlreadyExistsException, ObjectCannotBeUpdated Creates a new Role. Checks if parent role exists or not and throws ObjectCannotBeUpdated if parent does not exist Called by the server predefined step 'CreateNewRole'- Parameters:
role- The new role path- Returns:
- the RolePath representing the newly create Role
- Throws:
ObjectAlreadyExistsExceptionObjectCannotBeUpdated
-
createRole
RolePath createRole(RolePath role, TransactionKey transactionKey) throws ObjectAlreadyExistsException, ObjectCannotBeUpdated Creates a new Role. Checks if parent role exists or not and throws ObjectCannotBeUpdated if parent does not exist Called by the server predefined step 'CreateNewRole' This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
role- The new role pathtransactionKey- identifier of the active transaction- Returns:
- the RolePath representing the newly create Role
- Throws:
ObjectAlreadyExistsExceptionObjectCannotBeUpdated
-
addRole
default void addRole(AgentPath agent, RolePath rolePath) throws ObjectCannotBeUpdated, ObjectNotFoundException Adds the given Agent to the given Role, if they both exist.- Parameters:
agent- the path representing the given AgentrolePath- the path representing the given Role- Throws:
ObjectCannotBeUpdatedObjectNotFoundException
-
addRole
void addRole(AgentPath agent, RolePath rolePath, TransactionKey transactionKey) throws ObjectCannotBeUpdated, ObjectNotFoundException Adds the given Agent to the given Role, if they both exist. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agent- the path representing the given AgentrolePath- the path representing the given RoletransactionKey- identifier of the active transaction- Throws:
ObjectCannotBeUpdatedObjectNotFoundException
-
removeRole
default void removeRole(AgentPath agent, RolePath role) throws ObjectCannotBeUpdated, ObjectNotFoundException Remove the given Agent from the given Role. Does not delete the Role.- Parameters:
agent- the path representing the given Agentrole- the path representing the given Role- Throws:
ObjectCannotBeUpdatedObjectNotFoundException
-
removeRole
void removeRole(AgentPath agent, RolePath role, TransactionKey transactionKey) throws ObjectCannotBeUpdated, ObjectNotFoundException Remove the given Agent from the given Role. Does not delete the Role. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agent- the path representing the given Agentrole- the path representing the given RoletransactionKey- identifier of the active transaction- Throws:
ObjectCannotBeUpdatedObjectNotFoundException
-
setAgentPassword
default void setAgentPassword(AgentPath agent, String newPassword) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException Set permanent password of Agent's- Parameters:
agent- The AgentnewPassword- The Agent's new password- Throws:
ObjectNotFoundExceptionObjectCannotBeUpdatedNoSuchAlgorithmException
-
setAgentPassword
default void setAgentPassword(AgentPath agent, String newPassword, boolean temporary) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException Set an Agent's password- Parameters:
agent- The AgentnewPassword- The Agent's new passwordtemporary- whether the new password is temporary or not- Throws:
ObjectNotFoundExceptionObjectCannotBeUpdatedNoSuchAlgorithmException
-
setAgentPassword
void setAgentPassword(AgentPath agent, String newPassword, boolean temporary, TransactionKey transactionKey) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException Set an Agent's password This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agent- The AgentnewPassword- The Agent's new passwordtemporary- whether the new password is temporary or nottransactionKey- identifier of the active transaction- Throws:
ObjectNotFoundExceptionObjectCannotBeUpdatedNoSuchAlgorithmException
-
setHasJobList
default void setHasJobList(RolePath role, boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated Set the flag specifying whether Activities holding this Role should push Jobs its Agents.- Parameters:
role- The role to modifyhasJobList- boolean flag- Throws:
ObjectNotFoundExceptionObjectCannotBeUpdated
-
setHasJobList
void setHasJobList(RolePath role, boolean hasJobList, TransactionKey transactionKey) throws ObjectNotFoundException, ObjectCannotBeUpdated Set the flag specifying whether Activities holding this Role should push Jobs its Agents. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
role- The role to modifyhasJobList- boolean flagtransactionKey- identifier of the active transaction- Throws:
ObjectNotFoundExceptionObjectCannotBeUpdated
-
setPermission
default void setPermission(RolePath role, String permission) throws ObjectNotFoundException, ObjectCannotBeUpdated Sets the permission of the given Role. Use blank string to clear the permissions- Parameters:
role- the RolePath to changepermission- String using WildcardPermission format of shirotransactionKey- identifier of the active transaction- Throws:
ObjectCannotBeUpdated- there was a problem updating the permissionsObjectNotFoundException
-
setPermission
void setPermission(RolePath role, String permission, TransactionKey transactionKey) throws ObjectNotFoundException, ObjectCannotBeUpdated Sets the permission of the given Role. Use blank string to clear the permissions This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
role- the RolePath to changepermission- String using WildcardPermission format of shirotransactionKey- identifier of the active transaction- Throws:
ObjectNotFoundException- Role does not existsObjectCannotBeUpdated- there was a problem updating the permissions
-
setPermissions
default void setPermissions(RolePath role, List<String> permissions) throws ObjectNotFoundException, ObjectCannotBeUpdated Sets the list of permission of the given Role. Use empty list to clear the permissions- Parameters:
role- the RolePath to changepermissions- list of String using WildcardPermission format of shiro- Throws:
ObjectNotFoundException- Role does not existsObjectCannotBeUpdated- there was a problem updating the permissions
-
setPermissions
void setPermissions(RolePath role, List<String> permissions, TransactionKey transactionKey) throws ObjectNotFoundException, ObjectCannotBeUpdated Sets the list of permission of the given Role. Use empty list to clear the permissions This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
role- the RolePath to changepermissions- list of String using WildcardPermission format of shirotransactionKey- identifier of the active transaction- Throws:
ObjectNotFoundException- Role does not existsObjectCannotBeUpdated- there was a problem updating the permissions
-
postStartServer
void postStartServer() -
postBoostrap
void postBoostrap()
-