Class GroovyOrgBuilder
- java.lang.Object
-
- de.uplanet.lucy.server.usermanager.groovy.GroovyOrgBuilder
-
@Scriptable public final class GroovyOrgBuilder extends Object
- Since:
- Intrexx 5.2.
-
-
Constructor Summary
Constructors Constructor Description 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, DsClass p_dsUserClass, IDsucObject p_dsucObject, IDsucUser p_dsucUser, IDsucSet p_dsucSet, IDsucGetMembers p_dsucGetMembers, Path p_dirUserImage, de.uplanet.lucy.usermanager.ISecurityConfiguration p_securityConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
aesGcmDecryptAndChangePassword(Map<String,Object> p_params)
Deprecated.Since Intrexx 9.0.void
changePassword(IUser p_user, String p_strNewPassword)
Set the password of the specified user.boolean
changePassword(IUser p_user, String p_strNewPassword, Boolean p_checkAcceptablePassword)
void
changePassword(Map<String,Object> p_params)
Set the password of the specified user.Map<String,List<String>>
classifyGuids(CharSequence p_chseq)
Map<String,List<String>>
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
clearLocalUserCache()
Clears the local user cache.GroovyDsContainerNode
createContainer(String p_strClassName, groovy.lang.Closure<?> p_closure)
Create a new container.List<String>
createSaltedPasswordHash(String p_strPassword)
Create a standard salted password hash.GroovySession
createSession(String p_strUserGuid)
Create a session for a certain user.GroovyDsSetNode
createSet(String p_strClassName, groovy.lang.Closure<?> p_closure)
Create a new set.GroovyUser
createUser(groovy.lang.Closure<?> p_closure)
Create a new user.void
deleteContainer(String p_strGuid)
Delete the container with the specified GUID.void
deleteSet(String p_strGuid)
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(IUser p_user)
Generate a password and send it to the specified user.void
generateAndSendPassword(IUser p_user, String p_strLang)
Generate a password and send it to the specified user.int
getActiveSessionCount()
Get the number of active sessions.Collection<GroovyDsSetNode>
getContainingSets(IUser p_user)
Get a collection of sets that directly contain the given user.Collection<GroovyDsSetNode>
getContainingSets(String p_strUserGuid)
Get a collection of sets that directly contain the given user.String
getEncryptedPassword(Map<String,Object> p_params)
Derive an encrypted password suitable as an Intrexx user password stored in the user database.Set<String>
getGuidsFromText(CharSequence p_chseq)
Get a distinct set of GUIDs from the given text.List<IUser>
getLoggedOnUsers(boolean p_bIncludeAnonymous)
Get a list of users that are currently logged in.List<IUser>
getLoggedOnUsers(boolean p_bIncludeAnonymous, groovy.lang.Closure<?> p_closure)
Get a list of users that are currently logged in.List<IUser>
getLoggedOnUsersDistinct()
Get a distinct list of non-anonymous users that are currently logged in.List<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.List<GroovyUser>
getMembers(Object p_obj, boolean p_bIncludeDeactivated)
Get a list of users that are referenced by the given object.List<GroovyUser>
getMembers(Collection<?> p_collection, boolean p_bIncludeDeactivated)
Get a list of users that are referenced by the given collection.List<AbstractGroovyDsNode>
getMembership(IUser p_user)
Get a list of containers and sets that directly or indirectly contain the given user.List<AbstractGroovyDsNode>
getMembership(String p_strUserGuid)
Get a list of containers and sets that directly or indirectly contain the given user.List<AbstractGroovyDsNode>
getMembership(Subject p_subject)
Get a list of containers and sets that are part of the given subject.Collection<GroovyDsContainerNode>
getMembershipContainers(IUser p_user)
Get a collection of containers that directly or indirectly contain the given user.Collection<GroovyDsContainerNode>
getMembershipContainers(String p_strUserGuid)
Get a collection of containers that directly or indirectly contain the given user.Collection<GroovyDsSetNode>
getMembershipSets(IUser p_user)
Get a collection of sets that directly or indirectly contain the given user.Collection<GroovyDsSetNode>
getMembershipSets(String p_strUserGuid)
Get a collection of sets that directly or indirectly contain the given user.int
getNonAnonymousActiveSessionCount()
Get the number of non-anonymous active sessions.GroovyOrgStructureWrapper
getOrgStructure()
Get the organizational structure.long
getPasswordExpirationTimeout()
Get the password expiration timeout in milliseconds.List<GroovySession>
getSessions()
Get a list of the currently active sessions.GroovyUser
getUser(long p_lId)
Get the user with the specified integer ID.GroovyUser
getUser(long p_lId, boolean p_bIncludeDeactivated)
Get the user with the specified integer ID.GroovyUser
getUser(String p_strGuid)
Get the user with the specified GUID.GroovyUser
getUser(String p_strGuid, boolean p_bIncludeDeactivated)
Get the user with the specified GUID.GroovyUser
getUser(String p_strLoginName, String p_strLoginDomain)
Get the user with the specified login name and domain.GroovyUser
getUser(String p_strLoginName, String p_strLoginDomain, boolean p_bIncludeDeactivated)
Get the user with the specified login name and domain.void
invalidateOrgStructureAfterCommit()
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
isGroup(Object p_obj)
Check if the given object represents a group.boolean
isOrganization(Object p_obj)
Check if the given object represents an organization.boolean
isOrgUnit(Object p_obj)
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
isRole(Object p_obj)
Check if the given object represents a role.boolean
isSet(Object p_obj)
Check if the given object represents a set.boolean
isUser(Object p_obj)
Check if the given object represents a user.boolean
isUserOnline(IUser p_user)
Test if the specified user is online, i.e.boolean
isUserOnline(String p_strUserId)
Test if the specified user is online, i.e.List<String>
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.Object
withOrgStructure(groovy.lang.Closure<?> p_closure)
Work with the organizational structure.
-
-
-
Constructor Detail
-
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, DsClass p_dsUserClass, IDsucObject p_dsucObject, IDsucUser p_dsucUser, IDsucSet p_dsucSet, 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 Detail
-
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, orfalse
otherwise.- Throws:
SQLException
- If a database error occurred.IllegalArgumentException
- If the given user GUID isnull
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, 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
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, orfalse
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, 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
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, 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
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 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
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 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
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:
createSaltedPasswordHash(String)
-
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, 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:
changePassword(IUser, String)
-
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, 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(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(Map)
-
changePassword
public boolean changePassword(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:
changePassword(Map)
-
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, 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.p_strDomain
- The domain of the user.p_strPassword
- The password to check.p_strLang
- The language to be used.- 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.p_strDomain
- The domain of the user.p_strPassword
- The password to check.p_strLang
- The language to be used.- 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 wasnull
.- Since:
- Intrexx 6.0.
- See Also:
getEncryptedPassword(Map)
-
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 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(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(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
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:
LoggedOnUsers.getActiveSessionCount()
-
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:
LoggedOnUsers.getNonAnonymousActiveSessionCount()
-
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 isnull
.- See Also:
LoggedOnUsers.isUserOnline(String)
-
isUserOnline
public boolean isUserOnline(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:
LoggedOnUsers.isUserOnline(String)
-
getLoggedOnUsers
public List<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, orfalse
otherwise.- Returns:
- The (possibly empty) list of requested users.
- See Also:
LoggedOnUsers.getLoggedOnUsers(boolean)
-
getLoggedOnUsers
public List<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:
LoggedOnUsers.getLoggedOnUsers(boolean, Closure)
-
getLoggedOnUsersDistinct
public List<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:
LoggedOnUsers.getLoggedOnUsersDistinct()
-
getLoggedOnUsersDistinct
public List<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:
LoggedOnUsers.getLoggedOnUsersDistinct(Closure)
-
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:
GuidParser.getGuids(CharSequence)
-
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 isnull
.- See Also:
getGuidsFromText(CharSequence)
,classifyGuids(Collection)
-
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:
getGuidsFromText(CharSequence)
,classifyGuids(Collection, boolean)
-
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
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, orfalse
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, orfalse
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, orfalse
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, orfalse
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, orfalse
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, orfalse
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, orfalse
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, orfalse
otherwise.
-
getContainingSets
public Collection<GroovyDsSetNode> 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.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(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(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
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(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
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, 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.
-
-