org.codehaus.plexus.redback.role
Class DefaultRoleManager

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.redback.role.DefaultRoleManager
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, RoleManager

public class DefaultRoleManager
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements RoleManager, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

RoleProfileManager:


Field Summary
 
Fields inherited from interface org.codehaus.plexus.redback.role.RoleManager
ROLE
 
Constructor Summary
DefaultRoleManager()
           
 
Method Summary
 void assignRole(java.lang.String roleId, java.lang.String principal)
          Assigns the role indicated by the roleId to the given principal
 void assignTemplatedRole(java.lang.String templateId, java.lang.String resource, java.lang.String principal)
          Assigns the templated role indicated by the templateId fails if the templated role has not been created
 void createTemplatedRole(java.lang.String templateId, java.lang.String resource)
          create a role for the given roleName using the resource passed in for resolving the ${resource} expression
 RedbackRoleModel getModel()
          get the blessed model, the current operating instructions for all things role management
 void initialize()
           
 void loadApplication(ModelApplication app)
           
 void loadRoleModel(RedbackRoleModel roleModel)
           
 void loadRoleModel(java.net.URL resource)
          load the model and create/verify operations, resources, etc exist and make static roles
 void removeTemplatedRole(java.lang.String templateId, java.lang.String resource)
          remove the role corresponding to the role using the resource passed in for resolving the ${resource} expression
 boolean roleExists(java.lang.String roleId)
          true of a role exists with the given roleId
 boolean templatedRoleExists(java.lang.String templateId, java.lang.String resource)
          true of a role exists with the given roleId
 void unassignRole(java.lang.String roleId, java.lang.String principal)
          Unassigns the role indicated by the role id from the given principal
 void updateRole(java.lang.String templateId, java.lang.String oldResource, java.lang.String newResource)
          update the role from templateId from oldResource to newResource NOTE: this requires removal and creation of the role since the jdo store does not tolerate renaming because of the use of the name as an identifier
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRoleManager

public DefaultRoleManager()
Method Detail

loadRoleModel

public void loadRoleModel(java.net.URL resource)
                   throws RoleManagerException
Description copied from interface: RoleManager
load the model and create/verify operations, resources, etc exist and make static roles

Specified by:
loadRoleModel in interface RoleManager
Throws:
RoleManagerException

loadRoleModel

public void loadRoleModel(RedbackRoleModel roleModel)
                   throws RoleManagerException
Specified by:
loadRoleModel in interface RoleManager
Throws:
RoleManagerException

loadApplication

public void loadApplication(ModelApplication app)
                     throws RoleManagerException
Throws:
RoleManagerException

createTemplatedRole

public void createTemplatedRole(java.lang.String templateId,
                                java.lang.String resource)
                         throws RoleManagerException
create a role for the given roleName using the resource passed in for resolving the ${resource} expression

Specified by:
createTemplatedRole in interface RoleManager
Throws:
RoleManagerException

removeTemplatedRole

public void removeTemplatedRole(java.lang.String templateId,
                                java.lang.String resource)
                         throws RoleManagerException
remove the role corresponding to the role using the resource passed in for resolving the ${resource} expression

Specified by:
removeTemplatedRole in interface RoleManager
Throws:
RoleManagerException

updateRole

public void updateRole(java.lang.String templateId,
                       java.lang.String oldResource,
                       java.lang.String newResource)
                throws RoleManagerException
update the role from templateId from oldResource to newResource NOTE: this requires removal and creation of the role since the jdo store does not tolerate renaming because of the use of the name as an identifier

Specified by:
updateRole in interface RoleManager
Throws:
RoleManagerException

assignRole

public void assignRole(java.lang.String roleId,
                       java.lang.String principal)
                throws RoleManagerException
Description copied from interface: RoleManager
Assigns the role indicated by the roleId to the given principal

Specified by:
assignRole in interface RoleManager
Throws:
RoleManagerException

assignTemplatedRole

public void assignTemplatedRole(java.lang.String templateId,
                                java.lang.String resource,
                                java.lang.String principal)
                         throws RoleManagerException
Description copied from interface: RoleManager
Assigns the templated role indicated by the templateId fails if the templated role has not been created

Specified by:
assignTemplatedRole in interface RoleManager
Throws:
RoleManagerException

unassignRole

public void unassignRole(java.lang.String roleId,
                         java.lang.String principal)
                  throws RoleManagerException
Description copied from interface: RoleManager
Unassigns the role indicated by the role id from the given principal

Specified by:
unassignRole in interface RoleManager
Throws:
RoleManagerException

roleExists

public boolean roleExists(java.lang.String roleId)
                   throws RoleManagerException
Description copied from interface: RoleManager
true of a role exists with the given roleId

Specified by:
roleExists in interface RoleManager
Returns:
Throws:
RoleManagerException

templatedRoleExists

public boolean templatedRoleExists(java.lang.String templateId,
                                   java.lang.String resource)
                            throws RoleManagerException
Description copied from interface: RoleManager
true of a role exists with the given roleId

Specified by:
templatedRoleExists in interface RoleManager
Returns:
Throws:
RoleManagerException

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

getModel

public RedbackRoleModel getModel()
Description copied from interface: RoleManager
get the blessed model, the current operating instructions for all things role management

Specified by:
getModel in interface RoleManager


Copyright © 2006-2008 Codehaus. All Rights Reserved.