Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.engine.core.account
Interface AccountOperations


public interface AccountOperations

Operations for retrieving and querying user and group details.

Instance

The methods on AccountOperations can be invoked using AccountOperationsInstance.


Method Summary
 void checkForGroups(Collection<Account> accounts)
          Check that a set of accounts only contains users.
 void copy(Account source, Account destination)
          Copy the information relating to an account to another account.
 int dump(File folder)
          Dump all the account information into a folder.
 Account getAccountByName(String name, Account.Type type)
          Get a user or group by name.
 Account getAnonymousAccount()
          Get the anonymous account.
 Account getAuthenticatedAccount()
          Get the authenticated account.
 String getEmailAddress(Account account)
          Get an user's email address.
 Collection<Account> listAccountDetails(Collection<Account> accounts)
          Retrieve the name and account type from one or more account UUID values.
 Collection<Account> listAccounts(PageRange range)
          Lists accounts.
 Collection<Account> listMembership(Account account)
          List account group membership.
 UUID normalizeUuid(Account account)
          Normalize an account UUID or GUID into a standard UUID type.
 void purge(Account account)
          Purge all information relating to an account.
 int restore(File folder)
          Restore account information from a dump.
 void transfer(Account source, Account destination)
          Transfer all information relating to an account to another account.

 

Method Detail

getAnonymousAccount

Account getAnonymousAccount()
Get the anonymous account. For method invocations that are unauthenticated the getAuthenticatedAccount method will return the anonymous account. This method gives direct access to the anonymous account if it is unclear which account has been used as the anonymous account.
Returns:
the value of the property. This method will never return null.

getAuthenticatedAccount

Account getAuthenticatedAccount()
                                throws AuthorizationDeniedException
Get the authenticated account. Returns the authenticated user account for the current thread. If there is no authenticated user the method return a reference to the anonymous account.
Returns:
returns the authenticated account for the current thread. This method will never return null.
Throws:
AuthorizationDeniedException - if the authenticated user does not exist in the user store. This exception indicates that the authenticated user no longer exists in the user store but the authentication session is still valid.

getEmailAddress

String getEmailAddress(Account account)
                       throws UnknownAccountException
Get an user's email address. The account provided must represent a user account. If a group account is provide this method returns null.
Parameters:
account - the account to query.
Returns:
the email address. If no email is available then null is returned. This method can return null.
Throws:
UnknownAccountException - the account does not exist.

getAccountByName

Account getAccountByName(String name,
                         Account.Type type)
                         throws UnknownAccountException
Get a user or group by name. The name provided must be an exact match for the user or group name.
Parameters:
name - the user or group name.
type - user or group.
Returns:
the account. This method will never return null.
Throws:
UnknownAccountException - the account does not exist.

purge

void purge(Account account)
Purge all information relating to an account. This method removes all information relating to an account stored in the IRM system. This could, for example, un-assign rights and delete license related state relating to the account. This method is particularly useful if the account has been deleted from the external identity store and the corresponding details need to be removed from the IRM system.

This operation does not alter any of the account details stored in the external identity store.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
account - the account to purge. This account does not have to exist in the external identity store.

transfer

void transfer(Account source,
              Account destination)
              throws UnknownAccountException
Transfer all information relating to an account to another account. If an account is migrated from one external identity store to another the account Uuid may change. In this scenario the account information relating to the account UUID in the IRM system will be orphaned. This method allows all the rights of the orphaned account to be transferred to another account. An example of the things that are transferred would be administration rights and role assignments.

This operation does not alter any of the source account details stored in the external identity store.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
source - the source account.
destination - the destination account.
Throws:
UnknownAccountException - the destination account does not exist in the user store.

copy

void copy(Account source,
          Account destination)
          throws UnknownAccountException
Copy the information relating to an account to another account. This method duplicates all the information relating to an account and associates it with another account.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
source - the source account.
destination - the destination account.
Throws:
UnknownAccountException - the destination account does not exist in the user store.

dump

int dump(File folder)
         throws IOException
Dump all the account information into a folder. This operation queries for all user and group details that the system is using and writes this information out as a set of XML files in the provided folder. This information can be used when migrating user and groups from one repository to another where the UUID values are different.
Parameters:
folder - the output folder.
Returns:
the number of accounts processed.
Throws:
IOException - an error occurred writing out the account details.
Since:
11g Release 1 (11.1.1.3.0)

restore

int restore(File folder)
            throws IOException
Restore account information from a dump. This operation reads the user and group details from the provided folder and updates any UUID values stored in the system using the user or group name as the look up mechanism. Processed files are deleted from the provided folder.
Parameters:
folder - the input folder.
Returns:
the number of accounts processed.
Throws:
IOException - an error occurred reading the account details.
Since:
11g Release 1 (11.1.1.3.0)

listAccounts

Collection<Account> listAccounts(PageRange range)
Lists accounts. List the user and/or group accounts that the system is using. For example, if an account has been made a domain administrator then the account would be returned by this method. This method does not list all accounts stored in the user store (e.g. LDAP) just ones that are being referenced by system data.
Parameters:
range - the range of accounts to return.
Returns:
the list of accounts. If applicable, this method will return an empty collection rather than null to indicate no results.

listMembership

Collection<Account> listMembership(Account account)
                                   throws UnknownAccountException
List account group membership. Returns all the groups the account is a member of (including nested groups). If the account is not a member of any groups then an empty collection is returned.
Parameters:
account - the account to query.
Returns:
the list of groups this account belongs. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownAccountException - the account does not exist.

listAccountDetails

Collection<Account> listAccountDetails(Collection<Account> accounts)
Retrieve the name and account type from one or more account UUID values. If any of the provided UUID values do not correspond to a user or group the account is not returned in the results.
Parameters:
accounts - the accounts. This parameter is optional, it is valid to pass null or an empty collection.
Returns:
the account details. If applicable, this method will return an empty collection rather than null to indicate no results.

checkForGroups

void checkForGroups(Collection<Account> accounts)
                    throws GroupNotSupportedException
Check that a set of accounts only contains users. Methods that only work with user accounts can use this method as a validation check. If this method silently succeeds the provided accounts do not contain any groups.
Parameters:
accounts - accounts to check. This parameter is optional, it is valid to pass null or an empty collection.
Throws:
GroupNotSupportedException - one of the accounts is a group account.

normalizeUuid

UUID normalizeUuid(Account account)
                   throws IllegalArgumentException
Normalize an account UUID or GUID into a standard UUID type. The account Uuid property may or may not be in the standard UUID format 00000000-0000-0000-0000-000000000000 depending on the type of user store used. This method attempts to convert from the various formats into a standard UUID type.
Parameters:
account - account.
Returns:
the normalized UUID. This method will never return null.
Throws:
IllegalArgumentException - the account Uuid property is not in a supported UUID or GUID format.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.