Skip navigation links

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

E12907-01


oracle.irm.engine.core.account
Class AccountOperationsInstance

java.lang.Object
  extended by oracle.irm.engine.core.account.AccountOperationsInstance


public final class AccountOperationsInstance
extends Object

Operations for retrieving and querying user and group details.

This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.

import static oracle.irm.engine.core.account.AccountOperationsInstance.*;

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

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getAnonymousAccount

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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

public static 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.

listAccounts

public static 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

public static 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

public static 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

public static 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

public static 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-01


Copyright © 2010, Oracle. All rights reserved.