Class GroovyOrgBuilder

java.lang.Object
de.uplanet.lucy.server.usermanager.groovy.GroovyOrgBuilder

@Scriptable public final class GroovyOrgBuilder extends Object
Since:
Intrexx 5.2.
  • Constructor Details

    • GroovyOrgBuilder

      public GroovyOrgBuilder(IProcessingContext p_ctx, de.uplanet.lucy.server.session.ISessionManagerSupplier p_funSessionManager, IOrgStructure p_org, de.uplanet.lucy.server.usermanager.ds.IDsDbSchema p_schema, de.uplanet.lucy.server.usermanager.ds.IDsRecordFactory p_dsRecFac, de.uplanet.lucy.server.usermanager.ds.DsClass p_dsUserClass, 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, Path p_dirUserImage, de.uplanet.lucy.usermanager.ISecurityConfiguration p_securityConfiguration)
      Parameters:
      p_ctx - The processing context.
      p_funSessionManager - The session manager.
      p_org - The organizational structure.
      p_schema - The user management schema.
      p_dsRecFac - The user management record factory to be used.
      p_dsUserClass -
      p_dsucObject -
      p_dsucUser -
      p_dsucSet -
      p_dsucGetMembers -
      p_dirUserImage - The directory for user images.
      p_securityConfiguration - The security configuration to be used.
  • Method Details

    • clearLocalUserCache

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

      public Object withOrgStructure(groovy.lang.Closure<?> p_closure)
      Work with the organizational structure.
      Parameters:
      p_closure - A closure.
      Returns:
      The closures return value, or null.
    • getOrgStructure

      public GroovyOrgStructureWrapper getOrgStructure()
      Get the organizational structure.
      Returns:
      The Groovy org structure.
    • invalidateOrgStructureAfterCommit

      public void invalidateOrgStructureAfterCommit()
      Invalidate the organizational structure after the current transaction has been committed.
      Throws:
      IllegalStateException - If the current thread does not have a transaction.
    • 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.
      IllegalArgumentException - If the given user GUID is null or invalid.
    • 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.
      IllegalArgumentException - If the given user GUID is null or invalid.
      Since:
      Intrexx 6.0.
    • getUser

      public GroovyUser getUser(String p_strGuid) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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 found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was deactivated or could not be found in the database.
      IllegalArgumentException - If the given user GUID is null or invalid.
    • getUser

      public GroovyUser getUser(String p_strGuid, boolean p_bIncludeDeactivated) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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 found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was not found in the database.
      IllegalArgumentException - If the given user GUID is null or invalid.
      Since:
      Intrexx 6.0.
    • existsUser

      public boolean existsUser(long p_lId) throws SQLException
      Check if the specified user exists.

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

      Parameters:
      p_lId - 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(long p_lId, boolean p_bIncludeDeactivated) throws SQLException
      Check if the specified user exists.
      Parameters:
      p_lId - 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 GroovyUser getUser(long p_lId) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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_lId - The user's integer identifier.
      Returns:
      The user found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was deactivated or not found in the database.
    • getUser

      public GroovyUser getUser(long p_lId, boolean p_bIncludeDeactivated) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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_lId - The user's integer identifier.
      p_bIncludeDeactivated - false if deactivated users should be ignored, or true otherwise.
      Returns:
      The user found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was not found in the database.
      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.
    • 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 GroovyUser getUser(String p_strLoginName, String p_strLoginDomain) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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.
      Returns:
      The user found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was deactivated or not found in the database.
      IllegalArgumentException - If p_strLoginName is null.
    • getUser

      public GroovyUser getUser(String p_strLoginName, String p_strLoginDomain, boolean p_bIncludeDeactivated) throws SQLException, de.uplanet.lucy.usermanager.NotFoundException
      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 found.
      Throws:
      SQLException - If a database error occurred.
      de.uplanet.lucy.usermanager.NotFoundException - If the requested user was not found in the database.
      IllegalArgumentException - If p_strLoginName is null.
      Since:
      Intrexx 6.0.
    • deleteUser

      public void deleteUser(String p_strGuid) throws Exception
      Delete the user with the specified GUID.
      Parameters:
      p_strGuid - The user's unique identifier (GUID).
      Throws:
      Exception - If an error occurred.
    • createUser

      public GroovyUser createUser(groovy.lang.Closure<?> p_closure) throws de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException, IOException, SQLException
      Create a new user.

      The given closure's delegate will be set to a GroovyUserWrapper object.

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

      Parameters:
      p_closure - The closure that sets the users properties.
      Returns:
      The newly created user.
      Throws:
      de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException - If the user could not be created, e.g. if no name or loginName was provided, or an invalid container or membership was specified.
      SQLException - If an SQL error occurred.
      IOException - If an I/O error occurred.
    • deleteSet

      public void deleteSet(String p_strGuid) throws SQLException
      Delete the set with the specified GUID.
      Parameters:
      p_strGuid - The set's unique identifier (GUID).
      Throws:
      IllegalArgumentException - If no set was found for the GUID.
      SQLException - If an SQL error occurred.
    • deleteContainer

      public void deleteContainer(String p_strGuid) throws SQLException
      Delete the container with the specified GUID.
      Parameters:
      p_strGuid - The container's unique identifier (GUID).
      Throws:
      IllegalArgumentException - If no container was found for the GUID.
      SQLException - If an SQL error occurred.
    • createSet

      public GroovyDsSetNode createSet(String p_strClassName, groovy.lang.Closure<?> p_closure) throws de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException, SQLException
      Create a new set.

      The given closure's delegate will be set to a GroovyDsSetWrapper object.

      Note: Do not store the returned set object for later use by another thread or transaction.

      Parameters:
      p_strClassName - The name of the set class e.g. SET, GROUP or ROLE.
      p_closure - The closure that sets the sets properties.
      Returns:
      The newly created set.
      Throws:
      de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException - If the user could not be created, e.g. if no name was provided, or an invalid container or membership was specified.
      SQLException - If an SQL error occurred.
    • createContainer

      public GroovyDsContainerNode createContainer(String p_strClassName, groovy.lang.Closure<?> p_closure) throws de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException, SQLException
      Create a new container.

      The given closure's delegate will be set to a GroovyDsContainerWrapper object.

      Note: Do not store the returned container object for later use by another thread or transaction.

      Parameters:
      p_strClassName - The name of the container class e.g. CONTAINER, ORGANIZATION or TENANT.
      p_closure - The closure that sets the containers properties.
      Returns:
      The newly created container.
      Throws:
      de.uplanet.lucy.server.usermanager.groovy.OrgBuilderException - If the user could not be created, e.g. if no name was provided, or an invalid container was specified.
      SQLException - If an SQL error occurred.
    • getEncryptedPassword

      public String getEncryptedPassword(Map<String,Object> p_params) throws Exception
      Derive an encrypted password suitable as an Intrexx user password stored in the user database.

      The password is derived as a secret 256 bit key using the PBKDF2 method with 10000 iterations.

      • password: The password to be encrypted.
      • salt (optional): A salt value for the user's password. If this parameter is not specified this method will randomly generate a standard salt value.

      Parameters:
      p_params - The named input parameters.
      Returns:
      The encrypted password.
      Throws:
      Exception
      Since:
      Intrexx 9.2.
      See Also:
    • changePassword

      public void changePassword(Map<String,Object> p_params) throws Exception
      Set the password of the specified user.

      Either a password or an encrypted password must be given.

      • user: The user for whom the password should be set. Either a GUID, or a user object.
      • password: The password to be encrypted.
      • salt (optional): A new salt value for the user's password. If this parameter is not specified this method will randomly generate a standard salt value. The parameter is ignored if an encrypted password is provided.
      • encryptedPassword: An already encrypted password.
      • mustChangePassword (optional): true if the user must change the password, or false if the user should not be forced to change the password. The respective user property is not affected if this parameter is not set.

      This method maintains the password history but for security reasons does currently not check the password's properties.

      Parameters:
      p_params - The input parameters needed to change the password.
      Throws:
      Exception
      Since:
      Intrexx 9.2.
      See Also:
    • aesGcmDecryptAndChangePassword

      @Deprecated public void aesGcmDecryptAndChangePassword(Map<String,Object> p_params) throws Exception
      Deprecated.
      Since Intrexx 9.0.
      Set the password of a user using data encrypted with 128 bit key length AES in Galois Counter Mode without padding. See NIST Special Publication SP 800-38D.

      The new password must be encrypted with a session key that has been derived from the given password using the PBKDF2WithHmacSHA256 key derivation algorithm (by default a 128 bit key and 1000 iterations).

      • user: The user for whom the password should be set. Either a GUID, or a user object.
      • password: The password used to derive the session key for decrypting the new password.
      • pbkdfSaltBase64: The base64 encoded salt value to be used to derive the session key.
      • ivBase64: The base64 encoded initialization vector for decryption.
      • ctBase64: The base64 encoded cypher text that contains the new password.
      • salt (optional): A new salt value for the user's password. If this parameter is not specified this method will randomly generate a standard salt value.
      • mustChangePassword (optional): true if the user must change the password, or false if the user should not be forced to change the password. The respective user property is not affected if this parameter is not set.
      • debug (optional): Debug flag to get more detailed error messages.
        Note: Setting this property to true can weaken the security of this method. so do not use it in production environments.

      This method maintains the password history but for security reasons does currently not check the password's properties.

      Parameters:
      p_params - The input parameters needed to change the password.
      Throws:
      Exception
      Since:
      Intrexx 7.0.
    • changePassword

      public void changePassword(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strNewPassword) throws Exception
      Set the password of the specified user.
      Parameters:
      p_user - The user.
      p_strNewPassword - The new password in unencrypted form (must not be null).
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If p_strNewPassword is null.
      Exception
      See Also:
    • changePassword

      public boolean changePassword(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strNewPassword, Boolean p_checkAcceptablePassword) throws Exception
      Parameters:
      p_user - The user.
      p_strNewPassword - The new password in unencrypted form (must not be null).
      p_checkAcceptablePassword - If true password will be validated before changeing password.
      Returns:
      true if change was successful.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If p_strNewPassword is null.
      Exception
      See Also:
    • isPasswordAcceptable

      @Deprecated public boolean isPasswordAcceptable(String p_strPassword)
      Deprecated.
      Do not use this method.
      Check if the given password is accepted by the current rules.
      Parameters:
      p_strPassword - The password.
      Returns:
      true if the password acceptable, or false otherwise.
    • isPasswordAcceptable

      public boolean isPasswordAcceptable(String p_strUserName, String p_strDomain, String p_strPassword, String p_strLang) throws SQLException
      Check if the given password is acceptable.
      Parameters:
      p_strUserName - The login name of the user (must not be null).
      p_strDomain - The domain of the user (may be null).
      p_strPassword - The password to check (must not be null).
      p_strLang - The language to be used (must not be null).
      Returns:
      true if the password is valid.
      If false is returned the explanation is logged as warning into the portal.log.
      Throws:
      SQLException - If a database error occurred.
    • validatePassword

      public List<String> validatePassword(String p_strUserName, String p_strDomain, String p_strPassword, String p_strLang) throws SQLException
      Validate a password.
      Parameters:
      p_strUserName - The login name of the user (must not be null).
      p_strDomain - The domain of the user (may be null).
      p_strPassword - The password to check (must not be null).
      p_strLang - The language to be used (must not be null).
      Returns:
      An empty list if the password is valid. If the password is invalid, a non-empty list of messages is returned.
      Throws:
      SQLException - If a database error occurred.
    • createSaltedPasswordHash

      public List<String> createSaltedPasswordHash(String p_strPassword)
      Create a standard salted password hash.

      Usage:

         def (strHash, strSalt) = g_om.createSaltedPasswordHash("the password")
       

      Parameters:
      p_strPassword - The password.
      Returns:
      A list with the salted password hash as the first, and the salt value as the second element.
      Throws:
      IllegalArgumentException - If the given password was null.
      Since:
      Intrexx 6.0.
      See Also:
    • getPasswordExpirationTimeout

      public long getPasswordExpirationTimeout()
      Get the password expiration timeout in milliseconds.
      Returns:
      The password expiration timeout.
    • verifyCredentials

      public boolean verifyCredentials(Map<String,Object> p_params) throws Exception
      Verify the given credentials using the specified authentication configuration.

      Parameters:

      • authConfigName (required) - The authentication configuration to be used. Normally this is one of the configurations defined in the LucyAuth.cfg file.
      • user (optional*) - The user as a user object.
      • loginName (optional*) - The user's login name.
      • loginDomain (optional*) - The user's login domain.
      • password (required) - The password to be verified.
      • debug (optional) - Set this to true if some debug output is required (Groovy truth applies).
      • * To identify the user either a user object, or the login name with optional login domain are required.

      Parameters:
      p_params - The named parameters.
      Throws:
      IOException - If an error occurred.
      Exception
    • generateAndSendPassword

      public void generateAndSendPassword(de.uplanet.lucy.server.usermanager.IUser p_user) throws Exception
      Generate a password and send it to the specified user.
      Parameters:
      p_user - The user.
      Throws:
      de.uplanet.lucy.server.mail.MailServiceNotAvailableException - If the mail service is not enabled.
      IllegalArgumentException - If the given user is null.
      Exception - If an error occurred.
    • generateAndSendPassword

      public void generateAndSendPassword(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strLang) throws Exception
      Generate a password and send it to the specified user.
      Parameters:
      p_user - The user.
      p_strLang - The language to be used.
      Throws:
      de.uplanet.lucy.server.mail.MailServiceNotAvailableException - If the mail service is not enabled.
      IllegalArgumentException - If the given user is null.
      Exception - If an error occurred.
    • createSession

      public GroovySession createSession(String p_strUserGuid) throws LoginException, de.uplanet.lucy.server.session.SessionException
      Create a session for a certain user.
      Parameters:
      p_strUserGuid - The user's GUID.
      Returns:
      The newly created session.
      Throws:
      IllegalArgumentException - If the given user GUID is null or invalid.
      de.uplanet.lucy.server.session.SessionException
      LoginException
      Since:
      Intrexx 8.0.
    • getSessions

      public List<GroovySession> getSessions()
      Get a list of the currently active sessions.
      Returns:
      The sessions.
      Since:
      Intrexx 7.0.
    • getActiveSessionCount

      public int getActiveSessionCount()
      Get the number of active sessions.

      This method delegates to LoggedOnUsers.getActiveSessionCount().

      Returns:
      The number of active sessions.
      See Also:
    • getNonAnonymousActiveSessionCount

      public int getNonAnonymousActiveSessionCount()
      Get the number of non-anonymous active sessions.

      This method delegates to LoggedOnUsers.getNonAnonymousActiveSessionCount().

      Returns:
      The number of active sessions.
      See Also:
    • isUserOnline

      public boolean isUserOnline(String p_strUserId)
      Test if the specified user is online, i.e. if she or he has an associated session.

      This method delegates to LoggedOnUsers.isUserOnline(String).

      Parameters:
      p_strUserId - The user's unique identifier.
      Returns:
      true if the user is online, false otherwise.
      Throws:
      IllegalArgumentException - If the given user GUID is null.
      See Also:
    • isUserOnline

      public boolean isUserOnline(de.uplanet.lucy.server.usermanager.IUser p_user)
      Test if the specified user is online, i.e. if she or he has an associated session.

      This method delegates to LoggedOnUsers.isUserOnline(String).

      Parameters:
      p_user - The user.
      Returns:
      true if the user is online, false otherwise.
      Throws:
      IllegalArgumentException - If the given user is null.
      See Also:
    • getLoggedOnUsers

      public List<de.uplanet.lucy.server.usermanager.IUser> getLoggedOnUsers(boolean p_bIncludeAnonymous)
      Get a list of users that are currently logged in.

      If a user is logged in multiple times, the list contains an entry for each active user session.

      This method delegates to LoggedOnUsers.getLoggedOnUsers(boolean).

      Parameters:
      p_bIncludeAnonymous - true if the list should include anonymous users, or false otherwise.
      Returns:
      The (possibly empty) list of requested users.
      See Also:
    • getLoggedOnUsers

      public List<de.uplanet.lucy.server.usermanager.IUser> getLoggedOnUsers(boolean p_bIncludeAnonymous, groovy.lang.Closure<?> p_closure)
      Get a list of users that are currently logged in.

      If a user is logged in multiple times, the list contains an entry for each active user session.

      This method delegates to LoggedOnUsers.getLoggedOnUsers(boolean, Closure).

      Parameters:
      p_closure - A closure that filters users.
      p_bIncludeAnonymous - true if the list should include anonymous users, or false otherwise.
      Returns:
      The (possibly empty) list of requested users.
      See Also:
    • getLoggedOnUsersDistinct

      public List<de.uplanet.lucy.server.usermanager.IUser> getLoggedOnUsersDistinct()
      Get a distinct list of non-anonymous users that are currently logged in.

      This method delegates to LoggedOnUsers.getLoggedOnUsersDistinct().

      Returns:
      The (possibly empty) list of requested users.
      See Also:
    • getLoggedOnUsersDistinct

      public List<de.uplanet.lucy.server.usermanager.IUser> getLoggedOnUsersDistinct(groovy.lang.Closure<?> p_closure)
      Get a distinct list of non-anonymous users that pass the given filter and that are currently logged in.

      This method delegates to LoggedOnUsers.getLoggedOnUsersDistinct(Closure).

      Parameters:
      p_closure - A closure that filters users.
      Returns:
      The (possibly empty) list of requested users.
      See Also:
    • getGuidsFromText

      public Set<String> getGuidsFromText(CharSequence p_chseq)
      Get a distinct set of GUIDs from the given text.

      Note that the order of GUIDs within the text is not preserved in the result.

      Parameters:
      p_chseq - The text to extract GUIDs from.
      Returns:
      The (possibly empty) set of GUIDs.
      See Also:
    • classifyGuids

      public Map<String,List<String>> classifyGuids(CharSequence p_chseq) throws SQLException
      Parameters:
      p_chseq - Text to extract GUIDs from.
      Returns:
      A map that contains the classified GUIDs.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given input is null.
      See Also:
    • 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 <T extends CharSequence> Map<String,List<String>> classifyGuids(Collection<T> p_guids) 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.
      Returns:
      A map that contains the classified GUIDs.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given input is null.
    • classifyGuids

      public <T extends CharSequence> Map<String,List<String>> classifyGuids(Collection<T> 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.
      IllegalArgumentException - If the given input is null.
      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, GroovyDsSetNode), 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, GroovyDsSetNode), 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, GroovyDsSetNode), 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, GroovyDsSetNode), 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, GroovyDsContainerNode), 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, GroovyDsContainerNode), 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, GroovyDsContainerNode), and Intrexx principal objects.

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

      public Collection<GroovyDsSetNode> getContainingSets(de.uplanet.lucy.server.usermanager.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.
      IllegalArgumentException - If the given user is null.
    • getContainingSets

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

      public Collection<GroovyDsSetNode> getMembershipSets(de.uplanet.lucy.server.usermanager.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.
      IllegalArgumentException - If the given user is null.
    • getMembershipSets

      public Collection<GroovyDsSetNode> 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.
      IllegalArgumentException - If the given user GUID is null or invalid.
    • getMembershipContainers

      public Collection<GroovyDsContainerNode> getMembershipContainers(de.uplanet.lucy.server.usermanager.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.
      IllegalArgumentException - If the given user is null.
    • getMembershipContainers

      public Collection<GroovyDsContainerNode> 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.
      IllegalArgumentException - If the given user GUID is null or invalid.
    • getMembership

      public List<AbstractGroovyDsNode> 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 List<AbstractGroovyDsNode> getMembership(de.uplanet.lucy.server.usermanager.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 and sets the given user is member of.
      Throws:
      SQLException - If a database error occurred.
      IllegalArgumentException - If the given user is null.
    • getMembership

      public List<AbstractGroovyDsNode> 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 and 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.
      IllegalArgumentException - If the given user GUID is null or invalid.
    • getMembers

      public List<GroovyUser> 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, AbstractGroovyDsNode), 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<GroovyUser> 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, AbstractGroovyDsNode), 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.