Interface Lookup

All Known Subinterfaces:
LookupManager

public interface Lookup
  • 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-range
      ObjectNotFoundException - 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 Item
      transactionKey - identifier of the active transaction
      Returns:
      an ItemPath or AgentPath
      Throws:
      InvalidItemPathException - When the system key is invalid/out-of-range
      ObjectNotFoundException - 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:
      InvalidItemPathException
      ObjectNotFoundException
    • 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 resolve
      transactionKey - identifier of the active transaction
      Returns:
      The ItemPath it points to (should be an AgentPath if the path references an Agent)
      Throws:
      InvalidItemPathException
      ObjectNotFoundException
    • exists

      default boolean exists(Path path)
      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

      boolean exists(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.
      Parameters:
      path - The path to check
      transactionKey - identifier of the active transaction
      Returns:
      boolean true if the path exists, false if it doesn't
    • getContextTree

      default Lookup.PagedResult getContextTree(DomainPath start)
      Read the full context tree from the given Domainath
      Parameters:
      start -
      Returns:
      the
    • getContextTree

      Lookup.PagedResult getContextTree(DomainPath start, TransactionKey transactionKey)
      Parameters:
      start -
      transactionKey -
      Returns:
    • getChildren

      default Iterator<Path> getChildren(Path path)
      List the next-level-deep children of a Path
      Parameters:
      path - The parent Path
      Returns:
      An Iterator of child Paths
    • getChildren

      Iterator<Path> 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.
      Parameters:
      path - The parent Path
      transactionKey - identifier of the active transaction
      Returns:
      An Iterator of child Paths
    • getChildren

      default Lookup.PagedResult getChildren(Path path, int offset, int limit)
      List the next-level-deep children of a Path
      Parameters:
      path - The parent Path
      offset - the number of records to be skipped from the result
      limit - 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 Path
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - 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 Path
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      contextOnly - get only the contexts
      transactionKey - identifier of the active transaction
      Returns:
      A List of child Paths
    • search

      default Iterator<Path> search(Path start, String name)
      Find a path with a particular name (last component). Uses WILDCARD_MATCH as default constraints.
      Parameters:
      start - Search root
      name - 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 root
      name - The name to search for
      constraints - to optimise the backend query
      transactionKey - identifier of the active transaction
      Returns:
      An Iterator of matching Paths. Should be an empty Iterator if there are no matches.
    • search

      default Iterator<Path> search(Path start, Property... props)
      Search for Items in the specified path with the given property list
      Parameters:
      start - Search root
      props - list of Properties
      Returns:
      An Iterator of matching Paths
    • search

      Iterator<Path> 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.
      Parameters:
      start - Search root
      transactionKey - identifier of the active transaction
      props - list of Properties
      Returns:
      An Iterator of matching Paths
    • search

      default Lookup.PagedResult search(Path start, List<Property> props, int offset, int limit)
      Search for Items in the specified path with the given property list
      Parameters:
      start - Search root
      props - list of Properties
      offset - the number of records to be skipped from the result
      limit - 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 root
      props - list of Properties
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - identifier of the active transaction
      Returns:
      PagedResult of matching Paths
    • search

      default Iterator<Path> search(Path start, PropertyDescriptionList props)
      Search for Items of a particular type, based on its PropertyDescription outcome
      Parameters:
      start - Search root
      props - Properties unmarshalled from an ItemDescription's property description outcome.
      Returns:
      An Iterator of matching Paths
    • search

      Iterator<Path> 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.
      Parameters:
      start - Search root
      props - Properties unmarshalled from an ItemDescription's property description outcome.
      transactionKey - identifier of the active transaction
      Returns:
      An Iterator of matching Paths
    • search

      default Lookup.PagedResult search(Path start, PropertyDescriptionList props, int offset, int limit)
      Search for Items of a particular type, based on its PropertyDescription outcome
      Parameters:
      start - Search root
      props - Properties unmarshalled from an ItemDescription's property description outcome.
      offset - the number of records to be skipped from the result
      limit - 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 root
      props - Properties unmarshalled from an ItemDescription's property description outcome.
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - identifier of the active transaction
      Returns:
      An PagedResult of matching Paths
    • searchAliases

      default Iterator<Path> searchAliases(ItemPath itemPath)
      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

      Iterator<Path> 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.
      Parameters:
      itemPath - The ItemPath
      transactionKey - identifier of the active transaction
      Returns:
      An Iterator of DomainPaths that are aliases for that Item
    • searchAliases

      default Lookup.PagedResult searchAliases(ItemPath itemPath, int offset, int limit)
      Find all DomainPaths that are aliases for a particular Item or Agent
      Parameters:
      itemPath - The ItemPath
      offset - the number of records to be skipped from the result
      limit - 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 ItemPath
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - identifier of the active transaction
      Returns:
      An PagedResult of DomainPaths that are aliases for that Item
    • getAgentPath

      default AgentPath getAgentPath(String agentName) throws ObjectNotFoundException
      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 Agent
      transactionKey - identifier of the active transaction
      Returns:
      the AgentPath representing the Agent
      Throws:
      ObjectNotFoundException
    • getRolePath

      default RolePath getRolePath(String roleName) throws ObjectNotFoundException
      Find the RolePath for the named Role
      Parameters:
      roleName - the name of the Role
      Returns:
      the RolePath representing the Role
      Throws:
      ObjectNotFoundException
    • getRolePath

      RolePath getRolePath(String roleName, TransactionKey transactionKey) throws ObjectNotFoundException
      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 Role
      transactionKey - identifier of the active transaction
      Returns:
      the RolePath representing the Role
      Throws:
      ObjectNotFoundException
    • getAgents

      default AgentPath[] getAgents(RolePath rolePath) throws ObjectNotFoundException
      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 Role
      transactionKey - 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 Role
      offset - the number of records to be skipped from the result
      limit - 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 Role
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - identifier of the active transaction
      Returns:
      the PagedResult of Agents
      Throws:
      ObjectNotFoundException
    • getRoles

      default RolePath[] getRoles(AgentPath agentPath)
      Get all roles held by the given Agent
      Parameters:
      agentPath - the path representing the given Agent
      Returns:
      the list of Roles
    • getRoles

      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.
      Parameters:
      agentPath - the path representing the given Agent
      transactionKey - identifier of the active transaction
      Returns:
      the list of Roles
    • getRoles

      default Lookup.PagedResult getRoles(AgentPath agentPath, int offset, int limit)
      Get all roles held by the given Agent
      Parameters:
      agentPath - the path representing the given Agent
      offset - the number of records to be skipped from the result
      limit - 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 Agent
      offset - the number of records to be skipped from the result
      limit - the max number of records to be returned, use 0 to retrieve all records
      transactionKey - identifier of the active transaction
      Returns:
      the PagedResult of Roles
    • hasRole

      default boolean hasRole(AgentPath agentPath, RolePath role)
      Checks if an agent qualifies as holding the stated Role, including any sub-role logic.
      Parameters:
      agentPath - the path representing the given Agent
      role - the path representing the given Role
      Returns:
      true or false
    • hasRole

      boolean hasRole(AgentPath agentPath, RolePath role, TransactionKey transactionKey)
      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 Agent
      role - the path representing the given Role
      transactionKey - identifier of the active transaction
      Returns:
      true or false
    • getAgentName

      default String getAgentName(AgentPath agentPath) throws ObjectNotFoundException
      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 Agent
      transactionKey - identifier of the active transaction
      Returns:
      the name string
      Throws:
      ObjectNotFoundException