org.tigris.scarab.services.security
Class ScarabDBSecurityService

java.lang.Object
  extended byorg.apache.fulcrum.BaseService
      extended byorg.apache.fulcrum.security.BaseSecurityService
          extended byorg.apache.fulcrum.security.impl.db.DBSecurityService
              extended byorg.tigris.scarab.services.security.ScarabDBSecurityService
All Implemented Interfaces:
org.apache.fulcrum.security.SecurityService, org.apache.fulcrum.Service

public class ScarabDBSecurityService
extends org.apache.fulcrum.security.impl.db.DBSecurityService

Implementation of turbine's SecurityService to account for the ScarabModule being the Group implementation.

Version:
$Id: ScarabDBSecurityService.java 9104 2004-05-10 21:04:51Z dabbous $
Author:
John D. McNally

Field Summary
 
Fields inherited from class org.apache.fulcrum.security.impl.db.DBSecurityService
USER_PEER_CLASS_DEFAULT, USER_PEER_CLASS_KEY
 
Fields inherited from class org.apache.fulcrum.security.BaseSecurityService
userManager
 
Fields inherited from class org.apache.fulcrum.BaseService
configuration, isInitialized, name, serviceBroker
 
Fields inherited from interface org.apache.fulcrum.security.SecurityService
ACL_CLASS_DEFAULT, ACL_CLASS_KEY, GROUP_CLASS_DEFAULT, GROUP_CLASS_KEY, PERMISSION_CLASS_DEFAULT, PERMISSION_CLASS_KEY, ROLE_CLASS_DEFAULT, ROLE_CLASS_KEY, SECURE_PASSWORDS_ALGORITHM_DEFAULT, SECURE_PASSWORDS_ALGORITHM_KEY, SECURE_PASSWORDS_DEFAULT, SECURE_PASSWORDS_KEY, SERVICE_NAME, USER_CLASS_DEFAULT, USER_CLASS_KEY, USER_MANAGER_DEFAULT, USER_MANAGER_KEY
 
Constructor Summary
ScarabDBSecurityService()
           
 
Method Summary
 org.apache.fulcrum.security.entity.Group addGroup(org.apache.fulcrum.security.entity.Group group)
          Creates a new group with specified attributes.
protected  boolean checkExists(org.apache.fulcrum.security.entity.Group group)
          Determines if the Group exists in the security system.
 org.apache.fulcrum.security.util.GroupSet getGroups(org.apache.torque.util.Criteria criteria)
          Retrieve a set of Groups that meet the specified Criteria.
 void removeGroup(org.apache.fulcrum.security.entity.Group group)
          Removes a Group from the system.
 void renameGroup(org.apache.fulcrum.security.entity.Group group, java.lang.String name)
          Renames an existing Group.
 void saveGroup(org.apache.fulcrum.security.entity.Group group)
          Stores Group's attributes.
 
Methods inherited from class org.apache.fulcrum.security.impl.db.DBSecurityService
addPermission, addRole, checkExists, checkExists, getACL, getNewGroup, getNewPermission, getNewRole, getPermissions, getPermissions, getRoles, getUserPeerClass, getUserPeerInstance, grant, grant, removePermission, removeRole, renamePermission, renameRole, revoke, revoke, revokeAll, revokeAll, savePermission, saveRole
 
Methods inherited from class org.apache.fulcrum.security.BaseSecurityService
accountExists, accountExists, addUser, changePassword, encryptPassword, forcePassword, getAclClass, getAclInstance, getAllGroups, getAllPermissions, getAllRoles, getAnonymousUser, getAuthenticatedUser, getFactoryService, getGlobalGroup, getGroup, getGroupClass, getGroupInstance, getGroupInstance, getPermission, getPermissionClass, getPermissionInstance, getPermissionInstance, getRole, getRoleClass, getRoleInstance, getRoleInstance, getUser, getUserClass, getUserInstance, getUserInstance, getUsers, init, lockExclusive, lockShared, removeUser, saveUser, unlockExclusive, unlockShared
 
Methods inherited from class org.apache.fulcrum.BaseService
getCategory, getConfiguration, getInit, getName, getRealPath, getServiceBroker, getServiceObject, getStatus, isInitialized, setInit, setName, setServiceBroker, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.fulcrum.Service
getCategory, getConfiguration, getRealPath, getStatus, isInitialized, setName, setServiceBroker, shutdown
 

Constructor Detail

ScarabDBSecurityService

public ScarabDBSecurityService()
Method Detail

getGroups

public org.apache.fulcrum.security.util.GroupSet getGroups(org.apache.torque.util.Criteria criteria)
                                                    throws org.apache.fulcrum.security.util.DataBackendException
Retrieve a set of Groups that meet the specified Criteria.

Returns:
a set of Groups that meet the specified Criteria.
Throws:
org.apache.fulcrum.security.util.DataBackendException

saveGroup

public void saveGroup(org.apache.fulcrum.security.entity.Group group)
               throws org.apache.fulcrum.security.util.DataBackendException,
                      org.apache.fulcrum.security.util.UnknownEntityException
Stores Group's attributes. The Groups is required to exist in the system.

Parameters:
group - The Group to be stored.
Throws:
org.apache.fulcrum.security.util.DataBackendException - if there was an error accessing the data backend.
org.apache.fulcrum.security.util.UnknownEntityException - if the group does not exist.

addGroup

public org.apache.fulcrum.security.entity.Group addGroup(org.apache.fulcrum.security.entity.Group group)
                                                  throws org.apache.fulcrum.security.util.DataBackendException,
                                                         org.apache.fulcrum.security.util.EntityExistsException
Creates a new group with specified attributes.

Parameters:
group - the object describing the group to be created.
Returns:
a new Group object that has id set up properly.
Throws:
org.apache.fulcrum.security.util.DataBackendException - if there was an error accessing the data backend.
org.apache.fulcrum.security.util.EntityExistsException - if the group already exists.

removeGroup

public void removeGroup(org.apache.fulcrum.security.entity.Group group)
                 throws org.apache.fulcrum.security.util.DataBackendException,
                        org.apache.fulcrum.security.util.UnknownEntityException
Removes a Group from the system.

Parameters:
group - the object describing group to be removed.
Throws:
org.apache.fulcrum.security.util.DataBackendException - if there was an error accessing the data backend.
org.apache.fulcrum.security.util.UnknownEntityException - if the group does not exist.

renameGroup

public void renameGroup(org.apache.fulcrum.security.entity.Group group,
                        java.lang.String name)
                 throws org.apache.fulcrum.security.util.DataBackendException,
                        org.apache.fulcrum.security.util.UnknownEntityException
Renames an existing Group.

Parameters:
group - the object describing the group to be renamed.
name - the new name for the group.
Throws:
org.apache.fulcrum.security.util.DataBackendException - if there was an error accessing the data backend.
org.apache.fulcrum.security.util.UnknownEntityException - if the group does not exist.

checkExists

protected boolean checkExists(org.apache.fulcrum.security.entity.Group group)
                       throws org.apache.fulcrum.security.util.DataBackendException,
                              java.lang.Exception
Determines if the Group exists in the security system.

Parameters:
group - a Group value
Returns:
true if the group exists in the system, false otherwise
Throws:
org.apache.fulcrum.security.util.DataBackendException - when more than one Group with the same name exists.
java.lang.Exception - a generic exception.


Copyright © 2000-2004 Tigris.org. All Rights Reserved.