Package org.cristalise.kernel.lookup
Interface Lookup
- All Known Subinterfaces:
LookupManager
public interface Lookup
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shutdown the lookupdefault booleanChecks if a particular Path exists in the directorybooleanexists(Path path, TransactionKey transactionKey) Checks if a particular Path exists in the directory This method can be used in server side code or Script to find uncommitted changes during the active transaction.default StringgetAgentName(AgentPath agentPath) Return the name of the Agent referenced by an AgentPathgetAgentName(AgentPath agentPath, TransactionKey transactionKey) Return the name of the Agent referenced by an AgentPath This method can be used in server side code or Script to find uncommitted changes during the active transaction.default AgentPathgetAgentPath(String agentName) Find the AgentPath for the named AgentgetAgentPath(String agentName, TransactionKey transactionKey) Find the AgentPath for the named Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.default AgentPath[]Returns all of the Agents in this centre who hold this role (including sub-roles)default Lookup.PagedResultReturns all of the Agents who hold this role (including sub-roles)getAgents(RolePath rolePath, int offset, int limit, TransactionKey transactionKey) Returns all of the Agents who hold this role (including sub-roles) This method can be used in server side code or Script to find uncommitted changes during the active transaction.getAgents(RolePath rolePath, TransactionKey transactionKey) Returns all of the Agents in this centre who hold this role (including sub-roles) This method can be used in server side code or Script to find uncommitted changes during the active transaction.getChildren(Path path) List the next-level-deep children of a Pathdefault Lookup.PagedResultgetChildren(Path path, int offset, int limit) List the next-level-deep children of a PathgetChildren(Path path, int offset, int limit, boolean contextOnly, TransactionKey transactionKey) List the next-level-deep children (items or contexts) of the given path This method can be used in server side code or Script to find uncommitted changes during the active transaction.default Lookup.PagedResultgetChildren(Path path, int offset, int limit, TransactionKey transactionKey) List the next-level-deep children (items and contexts) of the given path This method can be used in server side code or Script to find uncommitted changes during the active transaction.getChildren(Path path, TransactionKey transactionKey) List the next-level-deep children of a Path This method can be used in server side code or Script to find uncommitted changes during the active transaction.default Lookup.PagedResultgetContextTree(DomainPath start) Read the full context tree from the given DomainathgetContextTree(DomainPath start, TransactionKey transactionKey) default ItemPathgetItemPath(String sysKey) Fetch the correct subclass class of ItemPath for a particular Item, derived from its lookup entry.getItemPath(String sysKey, TransactionKey transactionKey) Fetch the correct subclass class of ItemPath for a particular Item, derived from its lookup entry.default RolePathgetRolePath(String roleName) Find the RolePath for the named RolegetRolePath(String roleName, TransactionKey transactionKey) Find the RolePath for the named Role This method can be used in server side code or Script to find uncommitted changes during the active transaction.default RolePath[]Get all roles held by the given Agentdefault Lookup.PagedResultGet all roles held by the given AgentgetRoles(AgentPath agentPath, int offset, int limit, TransactionKey transactionKey) Get all roles held by the given Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.RolePath[]getRoles(AgentPath agentPath, TransactionKey transactionKey) Get all roles held by the given Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.default booleanChecks if an agent qualifies as holding the stated Role, including any sub-role logic.booleanhasRole(AgentPath agentPath, RolePath role, TransactionKey transactionKey) Checks if an agent qualifies as holding the stated Role, including any sub-role logic.voidopen()Connect to the directory using the root credentials.default ItemPathresolvePath(DomainPath domainPath) Find the ItemPath for which a DomainPath is an alias.resolvePath(DomainPath domainPath, TransactionKey transactionKey) Find the ItemPath for which a DomainPath is an alias.Find a path with a particular name (last component).search(Path start, String name, Lookup.SearchConstraints constraints, TransactionKey transactionKey) Find a path with a particular name (last component) This method can be used in server side code or Script to find uncommitted changes during the active transaction.default Lookup.PagedResultSearch for Items in the specified path with the given property listsearch(Path start, List<Property> props, int offset, int limit, TransactionKey transactionKey) Search for Items in the specified path with the given property list This method can be used in server side code or Script to find uncommitted changes during the active transaction.search(Path start, TransactionKey transactionKey, Property... props) Search for Items in the specified path with the given property list This method can be used in server side code or Script to find uncommitted changes during the active transaction.Search for Items in the specified path with the given property listsearch(Path start, PropertyDescriptionList props) Search for Items of a particular type, based on its PropertyDescription outcomedefault Lookup.PagedResultsearch(Path start, PropertyDescriptionList props, int offset, int limit) Search for Items of a particular type, based on its PropertyDescription outcomesearch(Path start, PropertyDescriptionList props, int offset, int limit, TransactionKey transactionKey) Search for Items of a particular type, based on its PropertyDescription outcome This method can be used in server side code or Script to find uncommitted changes during the active transaction.search(Path start, PropertyDescriptionList props, TransactionKey transactionKey) Search for Items of a particular type, based on its PropertyDescription outcome This method can be used in server side code or Script to find uncommitted changes during the active transaction.searchAliases(ItemPath itemPath) Find all DomainPaths that are aliases for a particular Item or Agentdefault Lookup.PagedResultsearchAliases(ItemPath itemPath, int offset, int limit) Find all DomainPaths that are aliases for a particular Item or AgentsearchAliases(ItemPath itemPath, int offset, int limit, TransactionKey transactionKey) Find all DomainPaths that are aliases for a particular Item or Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.searchAliases(ItemPath itemPath, TransactionKey transactionKey) Find all DomainPaths that are aliases for a particular Item or Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.
-
Method Details
-
open
void open()Connect to the directory using the root credentials. -
close
void close()Shutdown the lookup -
getItemPath
default ItemPath getItemPath(String sysKey) throws InvalidItemPathException, ObjectNotFoundException Fetch the correct subclass class of ItemPath for a particular Item, derived from its lookup entry.- Parameters:
sysKey- The system key of the Item- Returns:
- an ItemPath or AgentPath
- Throws:
InvalidItemPathException- When the system key is invalid/out-of-rangeObjectNotFoundException- When the Item does not exist in the directory.
-
getItemPath
ItemPath getItemPath(String sysKey, TransactionKey transactionKey) throws InvalidItemPathException, ObjectNotFoundException Fetch the correct subclass class of ItemPath for a particular Item, derived from its lookup entry. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
sysKey- The system key of the ItemtransactionKey- identifier of the active transaction- Returns:
- an ItemPath or AgentPath
- Throws:
InvalidItemPathException- When the system key is invalid/out-of-rangeObjectNotFoundException- When the Item does not exist in the directory.
-
resolvePath
default ItemPath resolvePath(DomainPath domainPath) throws InvalidItemPathException, ObjectNotFoundException Find the ItemPath for which a DomainPath is an alias.- Parameters:
domainPath- The path to resolve- Returns:
- The ItemPath it points to (should be an AgentPath if the path references an Agent)
- Throws:
InvalidItemPathExceptionObjectNotFoundException
-
resolvePath
ItemPath resolvePath(DomainPath domainPath, TransactionKey transactionKey) throws InvalidItemPathException, ObjectNotFoundException Find the ItemPath for which a DomainPath is an alias. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
domainPath- The path to resolvetransactionKey- identifier of the active transaction- Returns:
- The ItemPath it points to (should be an AgentPath if the path references an Agent)
- Throws:
InvalidItemPathExceptionObjectNotFoundException
-
exists
Checks if a particular Path exists in the directory- Parameters:
path- The path to check- Returns:
- boolean true if the path exists, false if it doesn't
-
exists
Checks if a particular Path exists in 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 checktransactionKey- identifier of the active transaction- Returns:
- boolean true if the path exists, false if it doesn't
-
getContextTree
Read the full context tree from the given Domainath- Parameters:
start-- Returns:
- the
-
getContextTree
- Parameters:
start-transactionKey-- Returns:
-
getChildren
List the next-level-deep children of a Path- Parameters:
path- The parent Path- Returns:
- An Iterator of child Paths
-
getChildren
List the next-level-deep children of a Path This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
path- The parent PathtransactionKey- identifier of the active transaction- Returns:
- An Iterator of child Paths
-
getChildren
List the next-level-deep children of a Path- Parameters:
path- The parent Pathoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- A List of child Paths
-
getChildren
default Lookup.PagedResult getChildren(Path path, int offset, int limit, TransactionKey transactionKey) List the next-level-deep children (items and contexts) of the given path This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
path- The parent Pathoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- A List of child Paths
-
getChildren
Lookup.PagedResult getChildren(Path path, int offset, int limit, boolean contextOnly, TransactionKey transactionKey) List the next-level-deep children (items or contexts) of the given path This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
path- The parent Pathoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordscontextOnly- get only the contextstransactionKey- identifier of the active transaction- Returns:
- A List of child Paths
-
search
Find a path with a particular name (last component). Uses WILDCARD_MATCH as default constraints.- Parameters:
start- Search rootname- The name to search for- Returns:
- An Iterator of matching Paths. Should be an empty Iterator if there are no matches.
-
search
Iterator<Path> search(Path start, String name, Lookup.SearchConstraints constraints, TransactionKey transactionKey) Find a path with a particular name (last component) This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
start- Search rootname- The name to search forconstraints- to optimise the backend querytransactionKey- identifier of the active transaction- Returns:
- An Iterator of matching Paths. Should be an empty Iterator if there are no matches.
-
search
Search for Items in the specified path with the given property list- Parameters:
start- Search rootprops- list of Properties- Returns:
- An Iterator of matching Paths
-
search
Search for Items in the specified path with the given property list This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
start- Search roottransactionKey- identifier of the active transactionprops- list of Properties- Returns:
- An Iterator of matching Paths
-
search
Search for Items in the specified path with the given property list- Parameters:
start- Search rootprops- list of Propertiesoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- PagedResult of matching Paths
-
search
Lookup.PagedResult search(Path start, List<Property> props, int offset, int limit, TransactionKey transactionKey) Search for Items in the specified path with the given property list This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
start- Search rootprops- list of Propertiesoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- PagedResult of matching Paths
-
search
Search for Items of a particular type, based on its PropertyDescription outcome- Parameters:
start- Search rootprops- Properties unmarshalled from an ItemDescription's property description outcome.- Returns:
- An Iterator of matching Paths
-
search
Search for Items of a particular type, based on its PropertyDescription outcome This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
start- Search rootprops- Properties unmarshalled from an ItemDescription's property description outcome.transactionKey- identifier of the active transaction- Returns:
- An Iterator of matching Paths
-
search
Search for Items of a particular type, based on its PropertyDescription outcome- Parameters:
start- Search rootprops- Properties unmarshalled from an ItemDescription's property description outcome.offset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- An PagedResult of matching Paths
-
search
Lookup.PagedResult search(Path start, PropertyDescriptionList props, int offset, int limit, TransactionKey transactionKey) Search for Items of a particular type, based on its PropertyDescription outcome This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
start- Search rootprops- Properties unmarshalled from an ItemDescription's property description outcome.offset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- An PagedResult of matching Paths
-
searchAliases
Find all DomainPaths that are aliases for a particular Item or Agent- Parameters:
itemPath- The ItemPath- Returns:
- An Iterator of DomainPaths that are aliases for that Item
-
searchAliases
Find all DomainPaths that are aliases for a particular Item or Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
itemPath- The ItemPathtransactionKey- identifier of the active transaction- Returns:
- An Iterator of DomainPaths that are aliases for that Item
-
searchAliases
Find all DomainPaths that are aliases for a particular Item or Agent- Parameters:
itemPath- The ItemPathoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- An PagedResult of DomainPaths that are aliases for that Item
-
searchAliases
Lookup.PagedResult searchAliases(ItemPath itemPath, int offset, int limit, TransactionKey transactionKey) Find all DomainPaths that are aliases for a particular Item or Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
itemPath- The ItemPathoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- An PagedResult of DomainPaths that are aliases for that Item
-
getAgentPath
Find the AgentPath for the named Agent- Parameters:
agentName- then name of the Agent- Returns:
- the AgentPath representing the Agent
- Throws:
ObjectNotFoundException
-
getAgentPath
AgentPath getAgentPath(String agentName, TransactionKey transactionKey) throws ObjectNotFoundException Find the AgentPath for the named Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agentName- then name of the AgenttransactionKey- identifier of the active transaction- Returns:
- the AgentPath representing the Agent
- Throws:
ObjectNotFoundException
-
getRolePath
Find the RolePath for the named Role- Parameters:
roleName- the name of the Role- Returns:
- the RolePath representing the Role
- Throws:
ObjectNotFoundException
-
getRolePath
Find the RolePath for the named Role This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
roleName- the name of the RoletransactionKey- identifier of the active transaction- Returns:
- the RolePath representing the Role
- Throws:
ObjectNotFoundException
-
getAgents
Returns all of the Agents in this centre who hold this role (including sub-roles)- Parameters:
rolePath- the path representing the given Role- Returns:
- the list of Agents
- Throws:
ObjectNotFoundException
-
getAgents
AgentPath[] getAgents(RolePath rolePath, TransactionKey transactionKey) throws ObjectNotFoundException Returns all of the Agents in this centre who hold this role (including sub-roles) This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
rolePath- the path representing the given RoletransactionKey- identifier of the active transaction- Returns:
- the list of Agents
- Throws:
ObjectNotFoundException
-
getAgents
default Lookup.PagedResult getAgents(RolePath rolePath, int offset, int limit) throws ObjectNotFoundException Returns all of the Agents who hold this role (including sub-roles)- Parameters:
rolePath- the path representing the given Roleoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- the PagedResult of Agents
- Throws:
ObjectNotFoundException
-
getAgents
Lookup.PagedResult getAgents(RolePath rolePath, int offset, int limit, TransactionKey transactionKey) throws ObjectNotFoundException Returns all of the Agents who hold this role (including sub-roles) This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
rolePath- the path representing the given Roleoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- the PagedResult of Agents
- Throws:
ObjectNotFoundException
-
getRoles
Get all roles held by the given Agent- Parameters:
agentPath- the path representing the given Agent- Returns:
- the list of Roles
-
getRoles
Get all roles held by the given Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agentPath- the path representing the given AgenttransactionKey- identifier of the active transaction- Returns:
- the list of Roles
-
getRoles
Get all roles held by the given Agent- Parameters:
agentPath- the path representing the given Agentoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all records- Returns:
- the PagedResult of Roles
-
getRoles
Lookup.PagedResult getRoles(AgentPath agentPath, int offset, int limit, TransactionKey transactionKey) Get all roles held by the given Agent This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agentPath- the path representing the given Agentoffset- the number of records to be skipped from the resultlimit- the max number of records to be returned, use 0 to retrieve all recordstransactionKey- identifier of the active transaction- Returns:
- the PagedResult of Roles
-
hasRole
Checks if an agent qualifies as holding the stated Role, including any sub-role logic.- Parameters:
agentPath- the path representing the given Agentrole- the path representing the given Role- Returns:
- true or false
-
hasRole
Checks if an agent qualifies as holding the stated Role, including any sub-role logic. This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agentPath- the path representing the given Agentrole- the path representing the given RoletransactionKey- identifier of the active transaction- Returns:
- true or false
-
getAgentName
Return the name of the Agent referenced by an AgentPath- Parameters:
agentPath- the path representing the given Agent- Returns:
- the name string
- Throws:
ObjectNotFoundException
-
getAgentName
String getAgentName(AgentPath agentPath, TransactionKey transactionKey) throws ObjectNotFoundException Return the name of the Agent referenced by an AgentPath This method can be used in server side code or Script to find uncommitted changes during the active transaction.- Parameters:
agentPath- the path representing the given AgenttransactionKey- identifier of the active transaction- Returns:
- the name string
- Throws:
ObjectNotFoundException
-