Class VelocityOrgStructureWrapper

java.lang.Object
de.uplanet.lucy.server.usermanager.velocity.VelocityOrgStructureWrapper

public final class VelocityOrgStructureWrapper extends Object
  • Constructor Details

    • VelocityOrgStructureWrapper

      public VelocityOrgStructureWrapper(de.uplanet.jdbc.JdbcConnection p_conn, de.uplanet.lucy.server.usermanager.orgstructure.IOrgStructure p_org, de.uplanet.lucy.server.usermanager.ds.IDsDbSchema p_schema, de.uplanet.lucy.server.usermanager.usecases.IDsucObject p_dsucObject, de.uplanet.lucy.server.usermanager.usecases.IDsucUser p_dsucUser, de.uplanet.lucy.server.usermanager.usecases.IDsucSet p_dsucSet, de.uplanet.lucy.server.usermanager.usecases.IDsucGetMembers p_dsucGetMembers)
  • Method Details

    • clearLocalUserCache

      public void clearLocalUserCache()
      Clears the local user cache.
    • existsUser

      public boolean existsUser(String p_strGuid) throws SQLException
      Check if the specified user exists.

      The method returns false if the user exists but is deactivated.

      Parameters:
      p_strGuid - The user's unique identifier (GUID).
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
    • existsUser

      public boolean existsUser(String p_strGuid, boolean p_bIncludeDeactivated) throws SQLException
      Check if the specified user exists.
      Parameters:
      p_strGuid - The user's unique identifier (GUID).
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • getUser

      public IUser getUser(String p_strGuid) throws SQLException
      Get the user with the specified GUID.

      Note: Do not store this user object for later use by another thread or transaction.

      Parameters:
      p_strGuid - The user's unique identifier (GUID).
      Returns:
      The user, or null if the user was deactivated or could not be found in the database.
      Throws:
      SQLException - If a database error occurred.
    • getUser

      public IUser getUser(String p_strGuid, boolean p_bIncludeDeactivated) throws SQLException
      Get the user with the specified GUID.

      Note: Do not store this user object for later use by another thread or transaction.

      Parameters:
      p_strGuid - The user's unique identifier (GUID).
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The user, or null if the user could not be found in the database.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If p_strGuid is not a valid GUID.
      Since:
      Intrexx 6.0.
    • existsUser

      public boolean existsUser(Number p_numId) throws SQLException
      Check if the specified user exists.

      The method returns false if the user exists but is deactivated.

      Note: Do not use this method except in cases where only the user's integer ID is known.

      Parameters:
      p_numId - The user's integer identifier.
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • existsUser

      public boolean existsUser(Number p_numId, boolean p_bIncludeDeactivated) throws SQLException
      Check if the specified user exists.

      Note: Do not use this method except in cases where only the user's integer ID is known.

      Parameters:
      p_numId - The user's integer identifier.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • getUser

      public IUser getUser(Number p_numId) throws SQLException
      Get the user with the specified integer ID.

      Note: Do not use this method except in cases where only the user's integer ID is known.

      Note: Do not store this user object for later use by another thread or transaction.

      Parameters:
      p_numId - The user's integer identifier.
      Returns:
      The user, or null if the user could not be found in the database.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 5.2.
    • getUser

      public IUser getUser(Number p_numId, boolean p_bIncludeDeactivated) throws SQLException
      Get the user with the specified integer ID.

      Note: Do not use this method except in cases where only the user's integer ID is known.

      Note: Do not store this user object for later use by another thread or transaction.

      Parameters:
      p_numId - The user's integer identifier.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The user, or null if the user could not be found in the database.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • existsUser

      public boolean existsUser(String p_strLoginName, String p_strLoginDomain) throws SQLException
      Check if the specified user exists.

      The method returns false if the user exists but is deactivated.

      Parameters:
      p_strLoginName - The login name.
      p_strLoginDomain - The login domain.
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • existsUser

      public boolean existsUser(String p_strLoginName, String p_strLoginDomain, boolean p_bIncludeDeactivated) throws SQLException
      Check if the specified user exists.
      Parameters:
      p_strLoginName - The login name.
      p_strLoginDomain - The login domain.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      true if the specified user exists, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • getUser

      public IUser getUser(String p_strLoginName, String p_strLoginDomain) throws SQLException
      Get the user with the specified login name and domain.

      Note: Do not use this method except in cases where only the user's integer ID is known.

      Parameters:
      p_strLoginName - The login name.
      p_strLoginDomain - The login domain.
      Returns:
      The user, or null if the user could not be found.
      Throws:
      SQLException - If a database error occurred.
    • getUser

      public IUser getUser(String p_strLoginName, String p_strLoginDomain, boolean p_bIncludeDeactivated) throws SQLException
      Get the user with the specified login name and domain.

      Note: Do not store this user object for later use by another thread or transaction.

      Parameters:
      p_strLoginName - The login name.
      p_strLoginDomain - The login domain.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The user, or null if the user could not be found in the database.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If p_strLoginName is null.
      Since:
      Intrexx 6.0.
    • getRootNode

      public VelocityDsContainerNode getRootNode()
      Get the pseudo root node of the organizational structure.

      The children of this node are the top-level organizational container nodes and do not report the pseudo root as their parent.

      Returns:
      The pseudo root node.
    • containsContainerNode

      public boolean containsContainerNode(String p_strGuid)
      Check if the org structure contains a container with the given given unique identifier.
      Parameters:
      p_strGuid - The unique identifier.
      Returns:
      true if the container was found, or false otherwise.
    • getContainerNode

      public VelocityDsContainerNode getContainerNode(String p_strGuid)
      Get a container by it's unique identifier.
      Parameters:
      p_strGuid - The organizational container's unique identifier.
      Returns:
      The organizational container node, or null if none was found for the given unique identifier.
    • findContainerNode

      public VelocityDsContainerNode findContainerNode(String p_strContainer)
      Find a container by its GUID, its name or its path.
      Parameters:
      p_strContainer - The GUID, name, or path of the container.
      Returns:
      The container, or null if the requested container was not found.
      Throws:
      IllegalArgumentException - If p_strContainer is null or empty, or if the given identifier was ambiguous.
    • getContainerNodes

      public VelocityDsNodes getContainerNodes()
      Get a list of all containers in the org structure.
      Returns:
      A list that contains all containers in the org structure.
    • getContainerClassNodes

      public VelocityDsNodes getContainerClassNodes()
      Get a list of all containers in the org structure that have class CONTAINER.
      Returns:
      A list that contains all containers in the org structure that have class CONTAINER.
    • getOrgUnitClassNodes

      public VelocityDsNodes getOrgUnitClassNodes()
      Get a list of all containers in the org structure that have class ORGUNIT.
      Returns:
      A list that contains all containers in the org structure that have class ORGUNIT.
    • getOrganizationClassNodes

      public VelocityDsNodes getOrganizationClassNodes()
      Get a list of all containers in the org structure that have class ORGANIZATION.
      Returns:
      A list that contains all containers in the org structure that have class ORGANIZATION.
    • containsSetNode

      public boolean containsSetNode(String p_strGuid)
      Check if the org structure contains a set with the given given unique identifier.
      Parameters:
      p_strGuid - The unique identifier.
      Returns:
      true if the set was found, or false otherwise.
    • getSetNode

      public VelocityDsSetNode getSetNode(String p_strGuid)
      Get a set by it's unique identifier.
      Parameters:
      p_strGuid - The set's unique identifier.
      Returns:
      The set node, or null if none was found for the given unique identifier.
    • findSetNode

      public VelocityDsSetNode findSetNode(String p_strSet)
      Find a set by its GUID, its name or its path.
      Parameters:
      p_strSet - The GUID, name, or path of the set.
      Returns:
      The set, or null if the requested set was not found.
      Throws:
      IllegalArgumentException - If p_strSet is null or empty, or if the given identifier was ambiguous.
    • getSetNodes

      public VelocityDsNodes getSetNodes()
      Get a list of all sets in the org structure.
      Returns:
      A list that contains all sets in the org structure.
    • getSetClassNodes

      public VelocityDsNodes getSetClassNodes()
      Get a list of all sets in the org structure that have class SET.
      Returns:
      A list that contains all sets in the org structure that have class SET.
    • getRoleClassNodes

      public VelocityDsNodes getRoleClassNodes()
      Get a list of all sets in the org structure that have class ROLE.
      Returns:
      A list that contains all sets in the org structure that have class ROLE.
    • getGroupClassNodes

      public VelocityDsNodes getGroupClassNodes()
      Get a list of all sets in the org structure that have class GROUP.
      Returns:
      A list that contains all sets in the org structure that have class GROUP.
    • getDistListClassNodes

      public VelocityDsNodes getDistListClassNodes()
      Get a list of all sets in the org structure that have class DISTLIST.
      Returns:
      A list that contains all sets in the org structure that have class DISTLIST.
    • getContainingSets

      public VelocityDsNodes getContainingSets(IUser p_user) throws SQLException
      Get a collection of sets that directly contain the given user.
      Parameters:
      p_user - The user.
      Returns:
      A collection of sets the given user is a direct member of.
      Throws:
      SQLException - If a database error occurred.
    • getContainingSets

      public VelocityDsNodes getContainingSets(String p_strUserGuid) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      Throws:
      SQLException
      de.uplanet.lucy.usermanager.NotFoundException
    • getMembershipSets

      public VelocityDsNodes getMembershipSets(IUser p_user) throws SQLException
      Get a collection of sets that directly or indirectly contain the given user.
      Parameters:
      p_user - The user.
      Returns:
      A collection of sets the given user is member of.
      Throws:
      SQLException - If a database error occurred.
    • getMembershipSets

      public VelocityDsNodes getMembershipSets(String p_strUserGuid) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      Get a collection of sets that directly or indirectly contain the given user.
      Parameters:
      p_strUserGuid - The user's GUID.
      Returns:
      A collection of sets the given user is member of.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the user was not found in the database.
    • getMembershipContainers

      public VelocityDsNodes getMembershipContainers(IUser p_user) throws SQLException
      Get a collection of containers that directly or indirectly contain the given user.
      Parameters:
      p_user - The user.
      Returns:
      A collection of containers the given user is member of.
      Throws:
      SQLException - If a database error occurred.
    • getMembershipContainers

      public VelocityDsNodes getMembershipContainers(String p_strUserGuid) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      Get a collection of containers that directly or indirectly contain the given user.
      Parameters:
      p_strUserGuid - The user's GUID.
      Returns:
      A collection of containers the given user is member of.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the user was not found in the database.
    • getMembership

      public VelocityDsNodes getMembership(IUser p_user) throws SQLException
      Get a list of containers and sets that directly or indirectly contain the given user. Containers are listed before sets.
      Parameters:
      p_user - The user.
      Returns:
      A list of containers ans sets the given user is member of.
      Throws:
      SQLException - If a database error occurred.
    • getMembership

      public VelocityDsNodes getMembership(Subject p_subject)
      Get a list of containers and sets that are part of the given subject. Containers are listed before sets.

      Using this method can be more efficient than using getMembership(IUser) in the common case where the user's subject is available through the session.

      Parameters:
      p_subject - The subject.
      Returns:
      A list of containers ans sets that are part of the given subject.
    • getMembership

      public VelocityDsNodes getMembership(String p_strUserGuid) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      Get a list of containers and sets that directly or indirectly contain the given user. Containers are listed before sets.
      Parameters:
      p_strUserGuid - The user's GUID.
      Returns:
      A list of containers ans sets the given user is member of.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the user was not found in the database.
    • getMembers

      public List<IUser> getMembers(Object p_obj, boolean p_bIncludeDeactivated) throws SQLException
      Get a list of users that are referenced by the given object.

      The method recognizes user, set, and container GUIDs, org structure nodes (IDsNode, AbstractVelocityDsNode), and Intrexx principal objects.

      Parameters:
      p_obj - An object as described above.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The list of users referenced by the given object.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given object is null, or it is not of the above mentioned type.
      Since:
      Intrexx 6.0.
    • getMembers

      public List<IUser> getMembers(Collection<?> p_collection, boolean p_bIncludeDeactivated) throws SQLException
      Get a list of users that are referenced by the given collection.

      The method recognizes user, set, and container GUIDs, org structure nodes (IDsNode, AbstractVelocityDsNode), and Intrexx principal objects.

      Parameters:
      p_collection - A collection as described above.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The list of users referenced by the given collection.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given collection is null, or the contents of the collections is not of the above mentioned type.
      Since:
      Intrexx 6.0.
    • classifyGuids

      public Map<String,List<String>> classifyGuids(CharSequence p_chseq, boolean p_bIncludeDeactivatedUsers) throws SQLException
      Parameters:
      p_chseq - Text to extract GUIDs from.
      p_bIncludeDeactivatedUsers - false if deactivated users should be ignored, or true otherwise.
      Returns:
      A map that contains the classified GUIDs.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given input is null.
      Since:
      Intrexx 6.0.
      See Also:
    • classifyGuids

      public Map<String,List<String>> classifyGuids(Collection<?> p_guids, boolean p_bIncludeDeactivatedUsers) throws SQLException
      Classify the given GUIDs. The resultant map will contain the following lists:
      • users: exising (i.e. not deleted) users,
      • containers: containers,
      • sets: sets,
      • unclassified: GUIDs that fall into none of the above categories.

      Elements that are not GUIDs are ignored.

      Parameters:
      p_guids - A collection of GUIDs.
      p_bIncludeDeactivatedUsers - false if deactivated users should be ignored, or true otherwise.
      Returns:
      A map that contains the classified GUIDs.
      Throws:
      SQLException - If a database error occurred.
      Since:
      Intrexx 6.0.
    • isUser

      public boolean isUser(Object p_obj) throws SQLException
      Check if the given object represents a user.

      The method recognizes GUIDs, user objects, and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a user, or false otherwise.
      Throws:
      SQLException - If a database error occurred.
    • isSet

      public boolean isSet(Object p_obj)
      Check if the given object represents a set.

      The method recognizes GUIDs, org structure nodes (DsSetNode, VelocityDsSetNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a set, or false otherwise.
    • isGroup

      public boolean isGroup(Object p_obj)
      Check if the given object represents a group.

      The method recognizes GUIDs, org structure nodes (DsSetNode, VelocityDsSetNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a group, or false otherwise.
    • isRole

      public boolean isRole(Object p_obj)
      Check if the given object represents a role.

      The method recognizes GUIDs, org structure nodes (DsSetNode, VelocityDsSetNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a role, or false otherwise.
    • isDistList

      public boolean isDistList(Object p_obj)
      Check if the given object represents a distribution list.

      The method recognizes GUIDs, org structure nodes (DsSetNode, VelocityDsSetNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a distribution list, or false otherwise.
    • isContainer

      public boolean isContainer(Object p_obj)
      Check if the given object represents a container.

      The method recognizes GUIDs, org structure nodes (DsContainerNode, VelocityDsContainerNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents a container, or false otherwise.
    • isOrganization

      public boolean isOrganization(Object p_obj)
      Check if the given object represents an organization.

      The method recognizes GUIDs, org structure nodes (DsContainerNode, VelocityDsContainerNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents an organization, or false otherwise.
    • isOrgUnit

      public boolean isOrgUnit(Object p_obj)
      Check if the given object represents an organizational unit.

      The method recognizes GUIDs, org structure nodes (DsContainerNode, VelocityDsContainerNode), and Intrexx principal objects.

      Parameters:
      p_obj - The object to check.
      Returns:
      true if the given object represents an organizational unit, or false otherwise.