com.metamatrix.console.models
Class GroupsManager

java.lang.Object
  extended by com.metamatrix.console.models.Manager
      extended by com.metamatrix.console.models.GroupsManager

public class GroupsManager
extends Manager


Field Summary
static java.lang.String[][] PROPS_AND_DISPLAY_NAMES_FOR_METAMATRIX_GROUPS
           
 
Fields inherited from class com.metamatrix.console.models.Manager
MODEL_CHANGED, MODEL_STALE
 
Constructor Summary
GroupsManager(ConnectionInfo connection)
          Constructor
 
Method Summary
 void addPrincipalChangeListener(PrincipalChangeListener listener)
           
 void addPrincipalsToRole(java.util.Collection principals, java.lang.String role)
          Add collection of PrincipalNames to a Role
 java.util.List<java.lang.String> getDomainNames()
           
 java.util.Collection<Group> getGroupsForDomain(java.lang.String theDomain)
           
 java.util.Map getMetaMatrixPropNamesForGroups()
           
 java.util.Collection getPrincipalsForRole(java.lang.String roleName)
          Get Collection of Principals for the provided roleName.
 java.lang.String getRoleDescription(java.lang.String roleName)
          Get Role description for the provided role name.
 RoleDisplay getRoleDisplay(java.lang.String roleName)
          Get RoleDisplay for the provided role name from the roles Map.
 java.lang.String getRoleDisplayName(java.lang.String roleName)
          Get Role displayName for the provided role name.
 java.util.Map getRoles()
          Get map of Role name to RoleDisplay from the authorization api
 RoleDisplay[] getRolesForPrincipal(MetaMatrixPrincipalName principalName)
          Get Collection of Roles for the provided MetaMatrixPrincipalName
 RoleDisplay[] getRolesForPrincipal(MetaMatrixPrincipalName principal, boolean includeImplicit)
          Get Collection of Roles for the provided MetaMatrixPrincipals
 void init()
          Needs to be called by subclasses - sets up event listening.
 boolean isSkippedRole(java.lang.String roleName)
           
 void removePrincipalsFromRole(java.util.Collection principals, java.lang.String role)
          Remove collection of PrincipalNames from a Role
 void removeRolesFromPrincipal(java.lang.String[] roles, MetaMatrixPrincipalName principal)
          Remove array of Roles from a principal
 
Methods inherited from class com.metamatrix.console.models.Manager
addManagerListener, fireModelChangedEvent, fireModelChangedEvent, getConnection, getConnection, getEncryptor, getEventListeners, getIsStale, refresh, removeManagerListener, setIsStale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPS_AND_DISPLAY_NAMES_FOR_METAMATRIX_GROUPS

public static final java.lang.String[][] PROPS_AND_DISPLAY_NAMES_FOR_METAMATRIX_GROUPS
Constructor Detail

GroupsManager

public GroupsManager(ConnectionInfo connection)
Constructor

Parameters:
connection - the connectionInfo
Method Detail

init

public void init()
Description copied from class: Manager
Needs to be called by subclasses - sets up event listening. (Subclasses should call super.init() in the body of their init() method.)

TODO: Perhaps this superclass should set itself to stale as part of the initialization process (see commented code in method body). That would broadcast an event to listeners which would prompt them to begin calling methods on a Manager - or perhaps a start() method with this code should be defined that will be called after init() (allowing subclasses to extend init() before start() would be called)

Overrides:
init in class Manager

getRoles

public java.util.Map getRoles()
                       throws ExternalException,
                              AuthorizationException
Get map of Role name to RoleDisplay from the authorization api

Returns:
map of RoleDisplays
Throws:
ExternalException
AuthorizationException

getRoleDisplay

public RoleDisplay getRoleDisplay(java.lang.String roleName)
                           throws ExternalException,
                                  AuthorizationException
Get RoleDisplay for the provided role name from the roles Map.

Parameters:
roleName - the role name
Returns:
map of RoleDisplays
Throws:
ExternalException
AuthorizationException

getRoleDescription

public java.lang.String getRoleDescription(java.lang.String roleName)
                                    throws ExternalException,
                                           AuthorizationException
Get Role description for the provided role name.

Parameters:
roleName - the role name
Returns:
the Role description
Throws:
ExternalException
AuthorizationException

getRoleDisplayName

public java.lang.String getRoleDisplayName(java.lang.String roleName)
                                    throws ExternalException,
                                           AuthorizationException
Get Role displayName for the provided role name.

Parameters:
roleName - the role name
Returns:
the Role displayName
Throws:
ExternalException
AuthorizationException

getPrincipalsForRole

public java.util.Collection getPrincipalsForRole(java.lang.String roleName)
                                          throws ComponentNotFoundException,
                                                 AuthorizationException,
                                                 ExternalException
Get Collection of Principals for the provided roleName.

Parameters:
roleName - the role name
Returns:
the principals for the provided roleName
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException

getRolesForPrincipal

public RoleDisplay[] getRolesForPrincipal(MetaMatrixPrincipalName principalName)
                                   throws ComponentNotFoundException,
                                          AuthorizationException,
                                          ExternalException,
                                          MetaMatrixSecurityException
Get Collection of Roles for the provided MetaMatrixPrincipalName

Parameters:
principalName - the MetaMatrixPrincipalName
includeImplicit - flag to determine whether to include implicit
Returns:
array of RoleDisplays for the provided principal
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException
MetaMatrixSecurityException

getRolesForPrincipal

public RoleDisplay[] getRolesForPrincipal(MetaMatrixPrincipalName principal,
                                          boolean includeImplicit)
                                   throws ComponentNotFoundException,
                                          AuthorizationException,
                                          ExternalException,
                                          MetaMatrixSecurityException
Get Collection of Roles for the provided MetaMatrixPrincipals

Parameters:
principals - the collection of MetaMatrixPrincipals
includeImplicit - flag to determine whether to include implicit
Returns:
array of RoleDisplays for the provided principal
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException
MetaMatrixSecurityException

addPrincipalsToRole

public void addPrincipalsToRole(java.util.Collection principals,
                                java.lang.String role)
                         throws ComponentNotFoundException,
                                AuthorizationException,
                                ExternalException
Add collection of PrincipalNames to a Role

Parameters:
principals - the collection of MetaMatrixPrincipalNames
role - the role to add the principals to.
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException

removePrincipalsFromRole

public void removePrincipalsFromRole(java.util.Collection principals,
                                     java.lang.String role)
                              throws ComponentNotFoundException,
                                     AuthorizationException,
                                     ExternalException
Remove collection of PrincipalNames from a Role

Parameters:
principals - the collection of MetaMatrixPrincipalNames
role - the role to remove the principals from.
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException

removeRolesFromPrincipal

public void removeRolesFromPrincipal(java.lang.String[] roles,
                                     MetaMatrixPrincipalName principal)
                              throws ComponentNotFoundException,
                                     AuthorizationException,
                                     ExternalException
Remove array of Roles from a principal

Parameters:
roles - the array of roles to remove
principal - the principal to remove roles from.
Throws:
ComponentNotFoundException
AuthorizationException
ExternalException

getDomainNames

public java.util.List<java.lang.String> getDomainNames()

getGroupsForDomain

public java.util.Collection<Group> getGroupsForDomain(java.lang.String theDomain)

getMetaMatrixPropNamesForGroups

public java.util.Map getMetaMatrixPropNamesForGroups()

addPrincipalChangeListener

public void addPrincipalChangeListener(PrincipalChangeListener listener)

isSkippedRole

public boolean isSkippedRole(java.lang.String roleName)


Copyright © 2009. All Rights Reserved.