com.ibm.itim.apps.provisioning
Class AccountMO

java.lang.Object
  |
  +--com.ibm.itim.apps.provisioning.AccountMO
All Implemented Interfaces:
java.io.Serializable

public class AccountMO
extends java.lang.Object
implements java.io.Serializable

Managed object representing an account.

See Also:
Serialized Form

Constructor Summary
AccountMO(PlatformContext platform, javax.security.auth.Subject subject, DistinguishedName name)
          Constructs the the managed object with a platform context, a subject, and the distinguished name of the object to manage.
 
Method Summary
 void adopt(PersonMO owner)
          Adopts the account, or changes the account owner to the given person (identity).
 Request changePassword(java.lang.String password)
          Changes the password of the account.
 Account getData()
          Returns a current snapshot of the data defining the provisionng object.
 DistinguishedName getDistinguishedName()
          Returns the distinguished name of the managed object
 PersonMO getOwner()
          Returns the owner of the account (if any).
 ServiceMO getService()
          Returns the service hosting the account.
 void orphan()
          Orphans the account, or changes the account owner to unknown.
 Request remove(java.util.Date scheduledTime)
          Removes the managed object from the provisioning platform.
 Request restore(java.lang.String password, java.util.Date scheduledTime)
          Restores the account.
 Request suspend(java.util.Date scheduledTime)
          Suspends the account.
 Request update(Account a, java.util.Date scheduledTime)
          Updates the managed object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountMO

public AccountMO(PlatformContext platform,
                 javax.security.auth.Subject subject,
                 DistinguishedName name)
Constructs the the managed object with a platform context, a subject, and the distinguished name of the object to manage.
Parameters:
platform - PlatformContext holding platform connection information.
subject - Subject representing the authenticated caller.
name - DistinguishedName identifying the container.
Method Detail

getDistinguishedName

public DistinguishedName getDistinguishedName()
Returns the distinguished name of the managed object
Returns:
DistinguishedName of the managed object.

getData

public Account getData()
                throws java.rmi.RemoteException,
                       ApplicationException
Returns a current snapshot of the data defining the provisionng object.
Returns:
Account object holding attribute information.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
ApplicationException - Thrown if unable to retrieve data.

getOwner

public PersonMO getOwner()
                  throws java.rmi.RemoteException,
                         ApplicationException,
                         AuthorizationException
Returns the owner of the account (if any).
Returns:
PersonMO representing the account owner if present, null if not.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to view the owner of the account.
ApplicationException - Thrown if unable to retrieve the account's owner. This may possibly be caused by the account being removed by another client previous to this call.

getService

public ServiceMO getService()
                     throws java.rmi.RemoteException,
                            ApplicationException,
                            AuthorizationException
Returns the service hosting the account.
Returns:
ServiceMO representing the host service.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to view the service of the account.
ApplicationException - Thrown if unable to retrieve the account's service. This may possibly be caused by the account being removed by another client previous to this call.

orphan

public void orphan()
            throws java.rmi.RemoteException,
                   AuthorizationException,
                   ApplicationException
Orphans the account, or changes the account owner to unknown.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to orphan the account.
ApplicationException - Thrown if unable to orphan the account. This may possibly be caused by the account being removed by another client previous to this call.

adopt

public void adopt(PersonMO owner)
           throws java.rmi.RemoteException,
                  AuthorizationException,
                  ApplicationException
Adopts the account, or changes the account owner to the given person (identity).
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to change the account owner.
ApplicationException - Thrown if unable to adopt the account. This may possibly be caused by the account or owner being removed by another client previous to this call.

remove

public Request remove(java.util.Date scheduledTime)
               throws java.rmi.RemoteException,
                      ApplicationException,
                      AuthorizationException
Removes the managed object from the provisioning platform.
Parameters:
scheduledTime - Date holding the time the operation is to be executed.
Returns:
Request object representing the operation's status.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to remove the account.
ApplicationException - Thrown if unable to submit the request.

update

public Request update(Account a,
                      java.util.Date scheduledTime)
               throws java.rmi.RemoteException,
                      AuthorizationException,
                      SchemaViolationException,
                      ApplicationException
Updates the managed object. An account value object is provided with the changes to make.
Parameters:
a - Account value object with changes to make.
scheduledTime - Date holding the time the operation is to be executed.
Returns:
Request object representing the operation's status.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to change the account. Note, even if only one of the attributes being changed is not writeable for the client, the entire request will fail and this exception will be thrown.
SchemaViolationException - Thrown if any of the attributes in the value object are violate the managed object's schema.
ApplicationException - Thrown if unable to submit the request. This may possibly be caused by the account being removed by another client previous to this call.

suspend

public Request suspend(java.util.Date scheduledTime)
                throws java.rmi.RemoteException,
                       AuthorizationException,
                       ApplicationException
Suspends the account.
Parameters:
scheduledTime - Date holding the time the operation is to be executed.
Returns:
Request object representing the operation's status.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to suspend the account.
ApplicationException - Thrown if unable to submit the request. This may possibly be caused by the account being removed by another client previous to this call.

restore

public Request restore(java.lang.String password,
                       java.util.Date scheduledTime)
                throws java.rmi.RemoteException,
                       AuthorizationException,
                       ApplicationException,
                       InvalidPasswordException
Restores the account.
Parameters:
password - New password of the account.
scheduledTime - Date holding the time the operation is to be executed.
Returns:
Request object representing the operation's status.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to restore the account.
ApplicationException - Thrown if unable to submit the request. This may possibly be caused by the account being removed by another client previous to this call.

changePassword

public Request changePassword(java.lang.String password)
                       throws java.rmi.RemoteException,
                              AuthorizationException,
                              InvalidPasswordException,
                              ApplicationException
Changes the password of the account. Note, some accounts do not require password changes. This can be determined by checking the service the account is hosted on for password requirements (see ServiceMO.isPasswordRequired).
Parameters:
password - New password of the account.
Returns:
Request object representing the operation's status.
Throws:
java.rmi.RemoteException - Thrown if unable to communicate with platform.
AuthorizationException - Thrown if client is unauthorized to change the account's password.
InvalidPasswordException - Thrown if password does not pass a password policy check.
ApplicationException - Thrown if unable to submit the request. This may possibly be caused by the account being removed by another client previous to this call.