com.waveset.session
Class SessionUtil

java.lang.Object
  extended bycom.waveset.session.SessionUtil

public class SessionUtil
extends java.lang.Object

Utility class containing methods utilizing LighthouseContext or SessionUtil for IdM customization.


Field Summary
static java.lang.String code_id
           
 
Constructor Summary
SessionUtil()
           
 
Method Summary
static QueryOptions buildResAcctIdQueryOptions(Subject subj, java.lang.String resId, java.lang.String accountId)
          Utility method to create QueryOptions to find a resource account.
static WavesetResult changePassword(LighthouseContext lhContext, java.lang.String accountId, EncryptedData password)
          Change a user's lhContext password, propagating it to all accounts.
static WavesetResult changePassword(LighthouseContext lhContext, java.lang.String accountId, EncryptedData password, java.util.List targets)
          Change a user's lhContext password, with optional selection of specific target accounts.
static WavesetResult deleteResourceObject(LighthouseContext lhContext, java.lang.String resType, java.lang.String resName, java.lang.String resId, java.lang.String objType, java.lang.String objName, java.lang.String objId)
          Delete a resource object.
static WavesetResult deprovision(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets, boolean unassignResourceAccounts, boolean unlinkResourceAccounts)
          Deprovision a user, with optional selection of specific target accounts.
static WavesetResult deprovision(Session s, java.lang.String objectGroupName, Session.Scope scope, java.util.List targets, boolean unassignResourceAccounts, boolean unlinkResourceAccounts)
          Deprovision all accounts in the specified organization, with optional selection of specific target accounts.
static WavesetResult disable(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets)
          Disable a user, with optional selection of specific target accounts.
static WavesetResult disable(Session s, java.lang.String objectGroupName, Session.Scope scope, java.util.List targets)
          Disable all users in the specified organization, with optional selection of specific target accounts.
static WavesetResult enable(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets)
          Enable an account, with optional selection of specific target accounts.
static WavesetResult enable(Session s, java.lang.String objectGroupName, Session.Scope scope, java.util.List targets)
          Enable all accounts in the specified organization, with optional selection of specific target accounts.
static QueryResult getUsersWithResourceAccountId(LighthouseContext ctx, Subject subject, java.lang.String resId, java.lang.String accountId)
          This method will be invoked when searching for users by the attribute RESOURCE_ACCOUNT_ID.
static WavesetResult launchProcess(LighthouseContext lhContext, java.lang.String process, java.lang.String taskName, java.util.Map variables)
          Launch a process with the usual parameters.
static WavesetResult reprovision(LighthouseContext lhContext, ProvisioningOptions ops)
          Reprovision a user with options specified in a ProvisioningOptions object.
static WavesetResult reprovision(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets)
          Fully reprovision an account, with optional selection of specific target accounts.
static WavesetResult reprovision(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets, boolean doCreates, boolean doDeletes)
          Reprovision an user, with optional selection of specific target accounts.
static WavesetResult reprovision(Session s, java.lang.String objectGroupName, Session.Scope scope, java.util.List targets, boolean doCreates, boolean doDeletes)
          Reprovision all accounts in the specified organization, with optional selection of specific target accounts.
static WavesetResult resetPassword(LighthouseContext lhContext, java.lang.String accountId)
          Reset a user's lhContext password and propagate it to all accounts.
static WavesetResult resetPassword(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets)
          Reset a user's lhContext password, with optional selection of specific target accounts.
static WavesetResult startActiveSyncOnResource(LighthouseContext lhContext, java.lang.String resourceIdOrName)
          Start ActiveSync on the specified resource.
static WavesetResult startSPESyncOnResource(LighthouseContext lhContext, java.lang.String resourceId)
          Start SPE Sync on the specified resource.
static WavesetResult stopActiveSyncOnResource(LighthouseContext lhContext, java.lang.String resourceIdOrName)
          Stop ActiveSync on the specified resource.
static WavesetResult stopSPESyncOnResource(LighthouseContext lhContext, java.lang.String resourceId)
          Stop SPE Sync on the specified resource.
static WavesetResult unlock(LighthouseContext lhContext, java.lang.String accountId, java.util.List targets)
          Unlock a user, with optional selection of specific target accounts.
static WavesetResult unlock(Session s, java.lang.String objectGroupName, Session.Scope scope, java.util.List targets)
          Unlock all users in the specified organization, with optional selection of specific target accounts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

SessionUtil

public SessionUtil()
Method Detail

reprovision

public static WavesetResult reprovision(LighthouseContext lhContext,
                                        java.lang.String accountId,
                                        java.util.List targets,
                                        boolean doCreates,
                                        boolean doDeletes)
                                 throws WavesetException
Reprovision an user, with optional selection of specific target accounts.

We we will always update existing accounts.

Parameters:
lhContext - LighthouseContext
accountId - Account Id to reprovision
targets - List of target resources
doCreates - Whether to create any new accounts
doDeletes - Whether to delete any unassigned accounts
Returns:
WavesetResult
Throws:
WavesetException

reprovision

public static WavesetResult reprovision(LighthouseContext lhContext,
                                        java.lang.String accountId,
                                        java.util.List targets)
                                 throws WavesetException
Fully reprovision an account, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Account Id to reprovision
targets - List of target resources
Returns:
WavesetResult
Throws:
WavesetException

reprovision

public static WavesetResult reprovision(Session s,
                                        java.lang.String objectGroupName,
                                        Session.Scope scope,
                                        java.util.List targets,
                                        boolean doCreates,
                                        boolean doDeletes)
                                 throws WavesetException
Reprovision all accounts in the specified organization, with optional selection of specific target accounts.

Parameters:
s - Session
objectGroupName - Object Group by which to filter users
scope -
targets - List of target resources
doCreates - Whether to create any new accounts
doDeletes - Whether to delete any unassigned accounts
Returns:
WavesetResult
Throws:
WavesetException

reprovision

public static WavesetResult reprovision(LighthouseContext lhContext,
                                        ProvisioningOptions ops)
                                 throws WavesetException
Reprovision a user with options specified in a ProvisioningOptions object. This is the most flexible of the reprovison methods.

Parameters:
lhContext - LighthouseContext
ops - ProvisioningOptions
Returns:
WavesetResult
Throws:
WavesetException

deprovision

public static WavesetResult deprovision(LighthouseContext lhContext,
                                        java.lang.String accountId,
                                        java.util.List targets,
                                        boolean unassignResourceAccounts,
                                        boolean unlinkResourceAccounts)
                                 throws WavesetException
Deprovision a user, with optional selection of specific target accounts.

If you want to delete the Lightouse user, the target list must either be null or contain the String "Lighthouse".

Parameters:
lhContext - LighthouseContext
accountId - Account Id to be deprovisioned
targets - List of target resources
unassignResourceAccounts - Whether to unnasign resource accounts
unlinkResourceAccounts - Whether to unlink any account that is assigned directly to the user
Returns:
WavesetResult
Throws:
WavesetException

deprovision

public static WavesetResult deprovision(Session s,
                                        java.lang.String objectGroupName,
                                        Session.Scope scope,
                                        java.util.List targets,
                                        boolean unassignResourceAccounts,
                                        boolean unlinkResourceAccounts)
                                 throws WavesetException
Deprovision all accounts in the specified organization, with optional selection of specific target accounts.

Parameters:
s - Session
objectGroupName - Object Group by which to filter users
scope -
targets - List of target resources
unassignResourceAccounts - Whether to unnasign resource accounts
unlinkResourceAccounts - Whether to unlink any account that is assigned directly to the user
Returns:
WavesetResult
Throws:
WavesetException

disable

public static WavesetResult disable(LighthouseContext lhContext,
                                    java.lang.String accountId,
                                    java.util.List targets)
                             throws WavesetException
Disable a user, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to disable
targets - List of target resources in which to disable accountId
Returns:
WavesetResult
Throws:
WavesetException

disable

public static WavesetResult disable(Session s,
                                    java.lang.String objectGroupName,
                                    Session.Scope scope,
                                    java.util.List targets)
                             throws WavesetException
Disable all users in the specified organization, with optional selection of specific target accounts.

Parameters:
s - Session
objectGroupName - organization of users which to disable
scope -
targets - List of target resources in which to disable accountId
Returns:
WavesetResult
Throws:
WavesetException

enable

public static WavesetResult enable(LighthouseContext lhContext,
                                   java.lang.String accountId,
                                   java.util.List targets)
                            throws WavesetException
Enable an account, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to enable
targets - List of target resources in which to enable accountId
Returns:
WavesetResult
Throws:
WavesetException

enable

public static WavesetResult enable(Session s,
                                   java.lang.String objectGroupName,
                                   Session.Scope scope,
                                   java.util.List targets)
                            throws WavesetException
Enable all accounts in the specified organization, with optional selection of specific target accounts.

Specification of enable options is more flexible with views, but harder if you just want something simple.

Parameters:
s - Session
objectGroupName - organization of users which to enable
scope -
targets - List of target resources in which to enable accountId
Returns:
WavesetResult
Throws:
WavesetException

unlock

public static WavesetResult unlock(LighthouseContext lhContext,
                                   java.lang.String accountId,
                                   java.util.List targets)
                            throws WavesetException
Unlock a user, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to unlock
targets - List of target resources in which to unlock accountId
Returns:
WavesetResult
Throws:
WavesetException

unlock

public static WavesetResult unlock(Session s,
                                   java.lang.String objectGroupName,
                                   Session.Scope scope,
                                   java.util.List targets)
                            throws WavesetException
Unlock all users in the specified organization, with optional selection of specific target accounts.

Parameters:
s - Session
objectGroupName - organization of users which to unlock
scope -
targets - List of target resources in which to unlock accountId
Returns:
WavesetResult
Throws:
WavesetException

resetPassword

public static WavesetResult resetPassword(LighthouseContext lhContext,
                                          java.lang.String accountId,
                                          java.util.List targets)
                                   throws WavesetException
Reset a user's lhContext password, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to reset password
targets - List of target resources
Returns:
WavesetResult
Throws:
WavesetException

resetPassword

public static WavesetResult resetPassword(LighthouseContext lhContext,
                                          java.lang.String accountId)
                                   throws WavesetException
Reset a user's lhContext password and propagate it to all accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to reset password
Returns:
WavesetResult
Throws:
WavesetException

changePassword

public static WavesetResult changePassword(LighthouseContext lhContext,
                                           java.lang.String accountId,
                                           EncryptedData password,
                                           java.util.List targets)
                                    throws WavesetException
Change a user's lhContext password, with optional selection of specific target accounts.

Parameters:
lhContext - LighthouseContext
accountId - Id for account to reset password
password - encrypted (new) password
targets - List of target resources
Returns:
WavesetResult
Throws:
WavesetException

changePassword

public static WavesetResult changePassword(LighthouseContext lhContext,
                                           java.lang.String accountId,
                                           EncryptedData password)
                                    throws WavesetException
Change a user's lhContext password, propagating it to all accounts.

Parameters:
lhContext - LighthouseContext
accountId - Account ID
password - new password
Returns:
WavesetResult
Throws:
WavesetException

deleteResourceObject

public static WavesetResult deleteResourceObject(LighthouseContext lhContext,
                                                 java.lang.String resType,
                                                 java.lang.String resName,
                                                 java.lang.String resId,
                                                 java.lang.String objType,
                                                 java.lang.String objName,
                                                 java.lang.String objId)
                                          throws WavesetException
Delete a resource object.

Parameters:
lhContext - LighthouseContext
resType - Resource Type
resName - Resource Name
resId - Resource Id
objType - Object Type
objName - Object Name
objId - Object Id
Returns:
WavesetResult
Throws:
WavesetException

launchProcess

public static WavesetResult launchProcess(LighthouseContext lhContext,
                                          java.lang.String process,
                                          java.lang.String taskName,
                                          java.util.Map variables)
                                   throws WavesetException
Launch a process with the usual parameters.

Parameters:
lhContext - LighthouseContext
process -
taskName -
variables -
Returns:
WavesetResult
Throws:
WavesetException

startActiveSyncOnResource

public static WavesetResult startActiveSyncOnResource(LighthouseContext lhContext,
                                                      java.lang.String resourceIdOrName)
                                               throws WavesetException
Start ActiveSync on the specified resource.

Parameters:
lhContext -
resourceIdOrName - Id (or name) for the resource to be started
Returns:
WavesetResult
Throws:
WavesetException

stopActiveSyncOnResource

public static WavesetResult stopActiveSyncOnResource(LighthouseContext lhContext,
                                                     java.lang.String resourceIdOrName)
                                              throws WavesetException
Stop ActiveSync on the specified resource.

Parameters:
lhContext -
resourceIdOrName - Id (or name) for the resource to be started
Returns:
WavesetResult
Throws:
WavesetException

startSPESyncOnResource

public static WavesetResult startSPESyncOnResource(LighthouseContext lhContext,
                                                   java.lang.String resourceId)
                                            throws WavesetException
Start SPE Sync on the specified resource.

Parameters:
lhContext -
resourceId - Id for the resource to be started
Returns:
WavesetResult
Throws:
WavesetException

stopSPESyncOnResource

public static WavesetResult stopSPESyncOnResource(LighthouseContext lhContext,
                                                  java.lang.String resourceId)
                                           throws WavesetException
Stop SPE Sync on the specified resource.

Parameters:
lhContext -
resourceId - Id for the resource to be started
Returns:
WavesetResult
Throws:
WavesetException

getUsersWithResourceAccountId

public static QueryResult getUsersWithResourceAccountId(LighthouseContext ctx,
                                                        Subject subject,
                                                        java.lang.String resId,
                                                        java.lang.String accountId)
                                                 throws WavesetException
This method will be invoked when searching for users by the attribute RESOURCE_ACCOUNT_ID. First, it will normalize the accountId since it could be a distinguished name (dn) according to RFC2253. This normalization accounts for extra spaces, component ordering, etc. to ensure that two dn's will compare if they have the same components and values. If the first search doesn't return any users, the search will be performed again without normalizing the accountId. This second search, if needed, will ensure backward compatibility for user object's whose resource account ids have not yet been normalized in their persisted form.

Util.normalizeString() method will standardize a string using an implementation of RFC2253 which specifies the standard for the string representation of distinguished names. RFC2253 addresses such aspects as component ordering, special characters, international characters, and extra spaces.

Since this is a session based call, the list of users returned will be scoped based on the calling subject's authorization

Parameters:
ctx - LighthouseContext
subject -
resId - resource Id
accountId - Resource account Id to locate
Returns:
QueryResult
Throws:
WavesetException

buildResAcctIdQueryOptions

public static QueryOptions buildResAcctIdQueryOptions(Subject subj,
                                                      java.lang.String resId,
                                                      java.lang.String accountId)
Utility method to create QueryOptions to find a resource account.

Parameters:
subj - Used to limit query to users this subject is authorized to see
resId - (optional) id for the resource to query, speeds up the search
accountId - Account ID to search for
Returns:
QueryOptions