Class GroovyOrgBuilder
- Since:
- Intrexx 5.2.
-
Constructor Summary
ConstructorsConstructorDescriptionGroovyOrgBuilder
(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) -
Method Summary
Modifier and TypeMethodDescriptionvoid
aesGcmDecryptAndChangePassword
(Map<String, Object> p_params) Deprecated.Since Intrexx 9.0.void
changePassword
(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strNewPassword) Set the password of the specified user.boolean
changePassword
(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strNewPassword, Boolean p_checkAcceptablePassword) void
changePassword
(Map<String, Object> p_params) Set the password of the specified user.classifyGuids
(CharSequence p_chseq) classifyGuids
(CharSequence p_chseq, boolean p_bIncludeDeactivatedUsers) <T extends CharSequence>
Map<String,List<String>> classifyGuids
(Collection<T> p_guids) Classify the given GUIDs.<T extends CharSequence>
Map<String,List<String>> classifyGuids
(Collection<T> p_guids, boolean p_bIncludeDeactivatedUsers) Classify the given GUIDs.void
Clears the local user cache.createContainer
(String p_strClassName, groovy.lang.Closure<?> p_closure) Create a new container.createSaltedPasswordHash
(String p_strPassword) Create a standard salted password hash.createSession
(String p_strUserGuid) Create a session for a certain user.Create a new set.createUser
(groovy.lang.Closure<?> p_closure) Create a new user.void
deleteContainer
(String p_strGuid) Delete the container with the specified GUID.void
Delete the set with the specified GUID.void
deleteUser
(String p_strGuid) Delete the user with the specified GUID.boolean
existsUser
(long p_lId) Check if the specified user exists.boolean
existsUser
(long p_lId, boolean p_bIncludeDeactivated) Check if the specified user exists.boolean
existsUser
(String p_strGuid) Check if the specified user exists.boolean
existsUser
(String p_strGuid, boolean p_bIncludeDeactivated) Check if the specified user exists.boolean
existsUser
(String p_strLoginName, String p_strLoginDomain) Check if the specified user exists.boolean
existsUser
(String p_strLoginName, String p_strLoginDomain, boolean p_bIncludeDeactivated) Check if the specified user exists.void
generateAndSendPassword
(de.uplanet.lucy.server.usermanager.IUser p_user) Generate a password and send it to the specified user.void
generateAndSendPassword
(de.uplanet.lucy.server.usermanager.IUser p_user, String p_strLang) Generate a password and send it to the specified user.int
Get the number of active sessions.getContainingSets
(de.uplanet.lucy.server.usermanager.IUser p_user) Get a collection of sets that directly contain the given user.getContainingSets
(String p_strUserGuid) Get a collection of sets that directly contain the given user.getEncryptedPassword
(Map<String, Object> p_params) Derive an encrypted password suitable as an Intrexx user password stored in the user database.getGuidsFromText
(CharSequence p_chseq) Get a distinct set of GUIDs from the given text.List<de.uplanet.lucy.server.usermanager.IUser>
getLoggedOnUsers
(boolean p_bIncludeAnonymous) Get a list of users that are currently logged in.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.List<de.uplanet.lucy.server.usermanager.IUser>
Get a distinct list of non-anonymous users that are currently logged in.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.getMembers
(Object p_obj, boolean p_bIncludeDeactivated) Get a list of users that are referenced by the given object.getMembers
(Collection<?> p_collection, boolean p_bIncludeDeactivated) Get a list of users that are referenced by the given collection.getMembership
(de.uplanet.lucy.server.usermanager.IUser p_user) Get a list of containers and sets that directly or indirectly contain the given user.getMembership
(String p_strUserGuid) Get a list of containers and sets that directly or indirectly contain the given user.getMembership
(Subject p_subject) Get a list of containers and sets that are part of the given subject.getMembershipContainers
(de.uplanet.lucy.server.usermanager.IUser p_user) Get a collection of containers that directly or indirectly contain the given user.getMembershipContainers
(String p_strUserGuid) Get a collection of containers that directly or indirectly contain the given user.getMembershipSets
(de.uplanet.lucy.server.usermanager.IUser p_user) Get a collection of sets that directly or indirectly contain the given user.getMembershipSets
(String p_strUserGuid) Get a collection of sets that directly or indirectly contain the given user.int
Get the number of non-anonymous active sessions.Get the organizational structure.long
Get the password expiration timeout in milliseconds.Get a list of the currently active sessions.getUser
(long p_lId) Get the user with the specified integer ID.getUser
(long p_lId, boolean p_bIncludeDeactivated) Get the user with the specified integer ID.Get the user with the specified GUID.Get the user with the specified GUID.Get the user with the specified login name and domain.Get the user with the specified login name and domain.void
Invalidate the organizational structure after the current transaction has been committed.boolean
isContainer
(Object p_obj) Check if the given object represents a container.boolean
isDistList
(Object p_obj) Check if the given object represents a distribution list.boolean
Check if the given object represents a group.boolean
isOrganization
(Object p_obj) Check if the given object represents an organization.boolean
Check if the given object represents an organizational unit.boolean
isPasswordAcceptable
(String p_strPassword) Deprecated.Do not use this method.boolean
isPasswordAcceptable
(String p_strUserName, String p_strDomain, String p_strPassword, String p_strLang) Check if the given password is acceptable.boolean
Check if the given object represents a role.boolean
Check if the given object represents a set.boolean
Check if the given object represents a user.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.boolean
isUserOnline
(String p_strUserId) Test if the specified user is online, i.e. if she or he has an associated session.validatePassword
(String p_strUserName, String p_strDomain, String p_strPassword, String p_strLang) Validate a password.boolean
verifyCredentials
(Map<String, Object> p_params) Verify the given credentials using the specified authentication configuration.withOrgStructure
(groovy.lang.Closure<?> p_closure) Work with the organizational structure.
-
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
Work with the organizational structure.- Parameters:
p_closure
- A closure.- Returns:
- The closures return value, or
null
.
-
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
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, orfalse
otherwise.- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given user GUID isnull
or invalid.
-
existsUser
Check if the specified user exists.- Parameters:
p_strGuid
- The user's unique identifier (GUID).p_bIncludeDeactivated
-false
if deactivated users should be ignored, ortrue
otherwise.- Returns:
true
if the specified user exists, orfalse
otherwise.- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given user GUID isnull
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 isnull
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, ortrue
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 isnull
or invalid.- Since:
- Intrexx 6.0.
-
existsUser
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, orfalse
otherwise.- Throws:
SQLException
- If a database error occurred.- Since:
- Intrexx 6.0.
-
existsUser
Check if the specified user exists.- Parameters:
p_lId
- The user's integer identifier.p_bIncludeDeactivated
-false
if deactivated users should be ignored, ortrue
otherwise.- Returns:
true
if the specified user exists, orfalse
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, ortrue
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
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, orfalse
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, ortrue
otherwise.- Returns:
true
if the specified user exists, orfalse
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
- Ifp_strLoginName
isnull
.
-
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, ortrue
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
- Ifp_strLoginName
isnull
.- Since:
- Intrexx 6.0.
-
deleteUser
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 noname
orloginName
was provided, or an invalid container or membership was specified.SQLException
- If an SQL error occurred.IOException
- If an I/O error occurred.
-
deleteSet
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
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 noname
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 noname
was provided, or an invalid container was specified.SQLException
- If an SQL error occurred.
-
getEncryptedPassword
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
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, orfalse
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 ExceptionDeprecated.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, orfalse
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 totrue
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 benull
).- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- Ifp_strNewPassword
isnull
.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 benull
).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
- Ifp_strNewPassword
isnull
.Exception
- See Also:
-
isPasswordAcceptable
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, orfalse
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 benull
).p_strDomain
- The domain of the user (may benull
).p_strPassword
- The password to check (must not benull
).p_strLang
- The language to be used (must not benull
).- Returns:
true
if the password is valid.
Iffalse
is returned the explanation is logged as warning into theportal.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 benull
).p_strDomain
- The domain of the user (may benull
).p_strPassword
- The password to check (must not benull
).p_strLang
- The language to be used (must not benull
).- 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
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 wasnull
.- Since:
- Intrexx 6.0.
- See Also:
-
getPasswordExpirationTimeout
public long getPasswordExpirationTimeout()Get the password expiration timeout in milliseconds.- Returns:
- The password expiration timeout.
-
verifyCredentials
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 theLucyAuth.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 totrue
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 isnull
.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 isnull
.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 isnull
or invalid.de.uplanet.lucy.server.session.SessionException
LoginException
- Since:
- Intrexx 8.0.
-
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
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 isnull
.- 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 isnull
.- See Also:
-
getLoggedOnUsers
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, orfalse
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, orfalse
otherwise.- Returns:
- The (possibly empty) list of requested users.
- See Also:
-
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
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
- 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 isnull
.- 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, ortrue
otherwise.- Returns:
- A map that contains the classified GUIDs.
- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given input isnull
.- 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 isnull
.
-
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, ortrue
otherwise.- Returns:
- A map that contains the classified GUIDs.
- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given input isnull
.- Since:
- Intrexx 6.0.
-
isUser
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, orfalse
otherwise.- Throws:
SQLException
- If a database error occurred.
-
isSet
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, orfalse
otherwise.
-
isGroup
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, orfalse
otherwise.
-
isRole
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, orfalse
otherwise.
-
isDistList
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, orfalse
otherwise.
-
isContainer
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, orfalse
otherwise.
-
isOrganization
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, orfalse
otherwise.
-
isOrgUnit
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, orfalse
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 isnull
.
-
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 isnull
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 isnull
.
-
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 isnull
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 isnull
.
-
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 isnull
or invalid.
-
getMembership
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 isnull
.
-
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 isnull
or invalid.
-
getMembers
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, ortrue
otherwise.- Returns:
- The list of users referenced by the given object.
- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given object isnull
, 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, ortrue
otherwise.- Returns:
- The list of users referenced by the given collection.
- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given collection isnull
, or the contents of the collections is not of the above mentioned type.- Since:
- Intrexx 6.0.
-