atg.security
Interface Account

All Superinterfaces:
AccountTypes
All Known Implementing Classes:
ClientAccount, GenericAccount, LDAPRepositoryAccount, RepositoryAccount

public interface Account
extends AccountTypes

An account, the persistent information associated with a Persona. These are similar to user profiles but are simplified for use by user-management GUIs.

See Also:
Persona, AccountManager

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from interface atg.security.AccountTypes
ANY_ACCOUNT, GROUP_ACCOUNT, LOGIN_ACCOUNT, PRIVILEGE_ACCOUNT
 
Method Summary
 void addGroup(java.lang.String newGroupName)
          Makes this account a member of a new group.
 AccountManager getAccountManager()
          Returns the account manager associated with this account.
 java.lang.String getAccountName()
          Returns the name of the account.
 int getAccountType()
          Returns the account type.
 java.lang.String getAttribute(java.lang.String attributeName)
          Retrieves the string value of a given attribute.
 java.util.Map getAttributes()
          Retrieves a mapping of all defined attributes and their values from the account.
 java.util.Iterator listGroups()
          Returns an enumeration of the groups that this account is a member of.
 java.util.Iterator listMembers()
          If this Account is a group, return the names of the members of the group.
 void removeGroup(java.lang.String groupName)
          Removes a group from the set of groups that this account is a member of.
 void setAttribute(java.lang.String attributeName, java.lang.String newValue)
          Changes the value of a given attribute.
 void setAttributes(java.util.Map newAttributes)
          Changes the values of a set of account attributes.
 void setGroups(java.lang.String[] newGroups)
          Makes this account a member of a set of groups.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Method Detail

getAccountManager

AccountManager getAccountManager()
Returns the account manager associated with this account.


getAccountName

java.lang.String getAccountName()
Returns the name of the account. This is usually either a login name or a group name.


getAccountType

int getAccountType()
Returns the account type.

See Also:
AccountTypes

getAttribute

java.lang.String getAttribute(java.lang.String attributeName)
Retrieves the string value of a given attribute.

Parameters:
attributeName - The name of the desired attribute.

getAttributes

java.util.Map getAttributes()
Retrieves a mapping of all defined attributes and their values from the account.


setAttribute

void setAttribute(java.lang.String attributeName,
                  java.lang.String newValue)
                  throws InvalidAttributeException
Changes the value of a given attribute.

Parameters:
attributeName - The name of the attribute to change.
newValue - The new value to give to the attribute. If this value is null, the attribute is removed.
Throws:
InvalidAttributeException

setAttributes

void setAttributes(java.util.Map newAttributes)
                   throws InvalidAttributeException
Changes the values of a set of account attributes. The mapping may contain a subset of existing attribute values; only those attributes that are present in the mapping are changed, and none are removed.

Parameters:
newAttributes - The set of attributes to change, and their associated values.
Throws:
InvalidAttributeException

listGroups

java.util.Iterator listGroups()
Returns an enumeration of the groups that this account is a member of.


addGroup

void addGroup(java.lang.String newGroupName)
              throws NoSuchAccountException,
                     PermissionDeniedException
Makes this account a member of a new group.

Parameters:
newGroupName - The name of the group to add membership to.
Throws:
NoSuchAccountException - Indicates that the specified group does not exist.
PermissionDeniedException

setGroups

void setGroups(java.lang.String[] newGroups)
               throws NoSuchAccountException,
                      PermissionDeniedException
Makes this account a member of a set of groups.

Parameters:
newGroups - An array of names of groups to remove membership from.
Throws:
NoSuchAccountException - Indicates that a specified group does not exist.
PermissionDeniedException

removeGroup

void removeGroup(java.lang.String groupName)
                 throws NoSuchAccountException,
                        PermissionDeniedException
Removes a group from the set of groups that this account is a member of.

Parameters:
groupName - The name of the group to remove membership from.
Throws:
NoSuchAccountException - Indicates that the account is not a member of the group.
PermissionDeniedException

listMembers

java.util.Iterator listMembers()
If this Account is a group, return the names of the members of the group. (Note that there is no way to add members to the group; rather, you add the group to the account and it automagically becomes a member.)