You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2002/07/09 15:58:19 UTC
cvs commit: jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util AccessControlException.java AccessControlList.java DataBackendException.java EntityExistsException.java GroupSet.java PasswordMismatchException.java PermissionSet.java RoleSet.java TurbineSecurityException.java UnknownEntityException.java
henning 2002/07/09 06:58:19
Modified: src/java/org/apache/fulcrum/security
BaseSecurityService.java SecurityService.java
TurbineSecurity.java UserManager.java
src/java/org/apache/fulcrum/security/entity Group.java
Permission.java Role.java SecurityEntity.java
User.java
src/java/org/apache/fulcrum/security/impl/passive
PassiveUserManager.java
src/java/org/apache/fulcrum/security/session
SessionBindingEvent.java
SessionBindingListener.java
src/java/org/apache/fulcrum/security/util
AccessControlException.java AccessControlList.java
DataBackendException.java
EntityExistsException.java GroupSet.java
PasswordMismatchException.java PermissionSet.java
RoleSet.java TurbineSecurityException.java
UnknownEntityException.java
Log:
Removes about 900 checkstyle errors from the Security Service (except the
impl.db package), reducing the number of errors not counting deprecation,
non-matching licenses and lines longer than 80 chars to zero.
(Happy now, Jon? ;-) )
Revision Changes Path
1.3 +90 -61 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/BaseSecurityService.java
Index: BaseSecurityService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/BaseSecurityService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BaseSecurityService.java 8 Jul 2002 23:24:07 -0000 1.2
+++ BaseSecurityService.java 9 Jul 2002 13:58:18 -0000 1.3
@@ -62,8 +62,6 @@
import org.apache.fulcrum.factory.FactoryService;
-import org.apache.fulcrum.security.UserManager;
-
import org.apache.fulcrum.security.entity.Group;
import org.apache.fulcrum.security.entity.Permission;
import org.apache.fulcrum.security.entity.Role;
@@ -76,7 +74,6 @@
import org.apache.fulcrum.security.util.PasswordMismatchException;
import org.apache.fulcrum.security.util.PermissionSet;
import org.apache.fulcrum.security.util.RoleSet;
-import org.apache.fulcrum.security.util.TurbineSecurityException;
import org.apache.fulcrum.security.util.UnknownEntityException;
import org.apache.torque.util.Criteria;
@@ -162,9 +159,9 @@
* @param password the password to process
* @return processed password
*/
- public String encryptPassword( String password )
+ public String encryptPassword(String password)
{
- if(password == null)
+ if (password == null)
{
return null;
}
@@ -208,7 +205,7 @@
/**
* Initializes the SecurityService, locating the apropriate UserManager
*
- * @param config a ServletConfig, to enforce early initialization
+ * @throws InitializationException A Problem occured while initializing the User Manager.
*/
public void init()
throws InitializationException
@@ -245,29 +242,29 @@
roleClass = Class.forName(roleClassName);
aclClass = Class.forName(aclClassName);
}
- catch(Exception e)
+ catch (Exception e)
{
- if(userClass == null)
+ if (userClass == null)
{
throw new InitializationException(
"Failed to create a Class object for User implementation", e);
}
- if(groupClass == null)
+ if (groupClass == null)
{
throw new InitializationException(
"Failed to create a Class object for Group implementation", e);
}
- if(permissionClass == null)
+ if (permissionClass == null)
{
throw new InitializationException(
"Failed to create a Class object for Permission implementation", e);
}
- if(roleClass == null)
+ if (roleClass == null)
{
throw new InitializationException(
"Failed to create a Class object for Role implementation", e);
}
- if(aclClass == null)
+ if (aclClass == null)
{
throw new InitializationException(
"Failed to create a Class object for ACL implementation", e);
@@ -276,21 +273,21 @@
try
{
- userManager = (UserManager)Class.
+ userManager = (UserManager) Class.
forName(userManagerClassName).newInstance();
}
- catch(Exception e)
+ catch (Exception e)
{
throw new InitializationException(
- "BaseSecurityService.init: Failed to instantiate UserManager" ,e);
+ "BaseSecurityService.init: Failed to instantiate UserManager", e);
}
try
{
- aclFactoryService = (FactoryService)TurbineServices.getInstance().
+ aclFactoryService = (FactoryService) TurbineServices.getInstance().
getService(FactoryService.SERVICE_NAME);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new InitializationException(
"BaseSecurityService.init: Failed to get the Factory Service object", e);
@@ -311,7 +308,7 @@
public Class getUserClass()
throws UnknownEntityException
{
- if ( userClass == null )
+ if (userClass == null)
{
throw new UnknownEntityException(
"Failed to create a Class object for User implementation");
@@ -334,9 +331,9 @@
User user;
try
{
- user = (User)getUserClass().newInstance();
+ user = (User) getUserClass().newInstance();
}
- catch(Exception e)
+ catch (Exception e)
{
throw new UnknownEntityException("Failed instantiate an User implementation object", e);
}
@@ -349,7 +346,10 @@
* This method calls getUserClass, and then creates a new object using
* the default constructor.
*
+ * @param userName The name of the user.
+ *
* @return an object implementing User interface.
+ *
* @throws UnknownEntityException if the object could not be instantiated.
*/
public User getUserInstance(String userName)
@@ -371,7 +371,7 @@
public Class getGroupClass()
throws UnknownEntityException
{
- if ( groupClass == null )
+ if (groupClass == null)
{
throw new UnknownEntityException(
"Failed to create a Class object for Group implementation");
@@ -394,9 +394,9 @@
Group group;
try
{
- group = (Group)getGroupClass().newInstance();
+ group = (Group) getGroupClass().newInstance();
}
- catch(Exception e)
+ catch (Exception e)
{
throw new UnknownEntityException("Failed instantiate an Group implementation object", e);
}
@@ -409,10 +409,13 @@
* This method calls getGroupClass, and then creates a new object using
* the default constructor.
*
+ * @param groupName The name of the Group
+ *
* @return an object implementing Group interface.
+ *
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Group getGroupInstance( String groupName )
+ public Group getGroupInstance(String groupName)
throws UnknownEntityException
{
Group group = getGroupInstance();
@@ -431,7 +434,7 @@
public Class getPermissionClass()
throws UnknownEntityException
{
- if ( permissionClass == null )
+ if (permissionClass == null)
{
throw new UnknownEntityException(
"Failed to create a Class object for Permission implementation");
@@ -454,9 +457,9 @@
Permission permission;
try
{
- permission = (Permission)getPermissionClass().newInstance();
+ permission = (Permission) getPermissionClass().newInstance();
}
- catch(Exception e)
+ catch (Exception e)
{
throw new UnknownEntityException("Failed instantiate an Permission implementation object", e);
}
@@ -469,6 +472,8 @@
* This method calls getPermissionClass, and then creates a new object using
* the default constructor.
*
+ * @param permName The name of the permission.
+ *
* @return an object implementing Permission interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
@@ -491,7 +496,7 @@
public Class getRoleClass()
throws UnknownEntityException
{
- if ( roleClass == null )
+ if (roleClass == null)
{
throw new UnknownEntityException(
"Failed to create a Class object for Role implementation");
@@ -514,9 +519,9 @@
Role role;
try
{
- role = (Role)getRoleClass().newInstance();
+ role = (Role) getRoleClass().newInstance();
}
- catch(Exception e)
+ catch (Exception e)
{
throw new UnknownEntityException("Failed instantiate an Role implementation object", e);
}
@@ -529,7 +534,10 @@
* This method calls getRoleClass, and then creates a new object using
* the default constructor.
*
+ * @param roleName The name of the role.
+ *
* @return an object implementing Role interface.
+ *
* @throws UnknownEntityException if the object could not be instantiated.
*/
public Role getRoleInstance(String roleName)
@@ -551,7 +559,7 @@
public Class getAclClass()
throws UnknownEntityException
{
- if ( aclClass == null )
+ if (aclClass == null)
{
throw new UnknownEntityException(
"Failed to create a Class object for ACL implementation");
@@ -575,7 +583,7 @@
throws UnknownEntityException
{
Object[] objects = { roles, permissions };
- String[] signatures = {"java.util.Map","java.util.Map"};
+ String[] signatures = {"java.util.Map", "java.util.Map"};
AccessControlList accessControlList;
try
@@ -585,7 +593,7 @@
objects,
signatures);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new UnknownEntityException(
"Failed instantiate an ACL implementation object", e);
@@ -603,7 +611,7 @@
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( User user )
+ public boolean accountExists(User user)
throws DataBackendException
{
return userManager.accountExists(user);
@@ -614,14 +622,16 @@
*
* The login name is used for looking up the account.
*
- * @param usename The name of the user to be checked.
+ * @param userName The name of the user to be checked.
+ *
* @return true if the specified account exists
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( String username )
+ public boolean accountExists(String userName)
throws DataBackendException
{
- return userManager.accountExists(username);
+ return userManager.accountExists(userName);
}
/**
@@ -638,7 +648,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User getAuthenticatedUser( String username, String password )
+ public User getAuthenticatedUser(String username, String password)
throws DataBackendException, UnknownEntityException,
PasswordMismatchException
{
@@ -655,7 +665,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User getUser( String username )
+ public User getUser(String username)
throws DataBackendException, UnknownEntityException
{
return userManager.retrieve(username);
@@ -675,7 +685,7 @@
* @throws DataBackendException if there is a problem accessing the
* storage.
*/
- public User[] getUsers( Criteria criteria )
+ public User[] getUsers(Criteria criteria)
throws DataBackendException
{
return userManager.retrieve(criteria);
@@ -699,13 +709,15 @@
/**
* Saves User's data in the permanent storage. The user account is required
* to exist in the storage.
+ *
+ * @param user The user Object to store.
*
* @exception UnknownEntityException if the user's account does not
* exist in the database.
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void saveUser( User user )
+ public void saveUser(User user)
throws UnknownEntityException, DataBackendException
{
userManager.store(user);
@@ -715,10 +727,12 @@
* Creates new user account with specified attributes.
*
* @param user the object describing account to be created.
+ * @param password The password to use for the account.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the user account already exists.
*/
- public void addUser( User user, String password )
+ public void addUser(User user, String password)
throws DataBackendException, EntityExistsException
{
userManager.createAccount(user, password);
@@ -731,7 +745,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the user account is not present.
*/
- public void removeUser( User user )
+ public void removeUser(User user)
throws DataBackendException, UnknownEntityException
{
// revoke all roles form the user
@@ -753,7 +767,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void changePassword( User user, String oldPassword, String newPassword )
+ public void changePassword(User user, String oldPassword, String newPassword)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException
{
@@ -775,10 +789,10 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void forcePassword( User user, String password )
+ public void forcePassword(User user, String password)
throws UnknownEntityException, DataBackendException
{
- userManager.forcePassword( user, password );
+ userManager.forcePassword(user, password);
}
/**
@@ -813,13 +827,13 @@
*/
protected void lockExclusive()
{
- while(readerCount>0)
+ while (readerCount > 0)
{
try
{
this.wait();
}
- catch(InterruptedException e)
+ catch (InterruptedException e)
{
}
}
@@ -845,11 +859,11 @@
*/
public Group getGlobalGroup()
{
- if(globalGroup == null)
+ if (globalGroup == null)
{
- synchronized(BaseSecurityService.class)
+ synchronized (BaseSecurityService.class)
{
- if(globalGroup == null)
+ if (globalGroup == null)
{
try
{
@@ -872,13 +886,18 @@
*
* @param name the name of the Group.
* @return an object representing the Group with specified name.
+ *
+ * @exception UnknownEntityException if the object does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Group getGroup( String name )
+ public Group getGroup(String name)
throws DataBackendException, UnknownEntityException
{
GroupSet groups = getAllGroups();
Group group = groups.getGroup(name);
- if(group != null)
+ if (group != null)
{
return group;
}
@@ -893,13 +912,18 @@
*
* @param name the name of the Role.
* @return an object representing the Role with specified name.
+ *
+ * @exception UnknownEntityException if the object does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Role getRole( String name )
+ public Role getRole(String name)
throws DataBackendException, UnknownEntityException
{
RoleSet roles = getAllRoles();
Role role = roles.getRole(name);
- if(role != null)
+ if (role != null)
{
role.setPermissions(getPermissions(role));
return role;
@@ -915,13 +939,18 @@
*
* @param name the name of the Permission.
* @return an object representing the Permission with specified name.
+ *
+ * @exception UnknownEntityException if the permission does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Permission getPermission( String name )
+ public Permission getPermission(String name)
throws DataBackendException, UnknownEntityException
{
PermissionSet permissions = getAllPermissions();
Permission permission = permissions.getPermission(name);
- if(permission != null)
+ if (permission != null)
{
return permission;
}
@@ -940,7 +969,7 @@
public GroupSet getAllGroups()
throws DataBackendException
{
- return getGroups( new Criteria() );
+ return getGroups(new Criteria());
}
/**
@@ -952,7 +981,7 @@
public RoleSet getAllRoles()
throws DataBackendException
{
- return getRoles( new Criteria() );
+ return getRoles(new Criteria());
}
/**
@@ -964,6 +993,6 @@
public PermissionSet getAllPermissions()
throws DataBackendException
{
- return getPermissions( new Criteria() );
+ return getPermissions(new Criteria());
}
}
1.3 +130 -85 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/SecurityService.java
Index: SecurityService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/SecurityService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SecurityService.java 8 Jul 2002 23:24:07 -0000 1.2
+++ SecurityService.java 9 Jul 2002 13:58:18 -0000 1.3
@@ -63,8 +63,6 @@
import org.apache.fulcrum.security.entity.Role;
import org.apache.fulcrum.security.entity.User;
-import org.apache.fulcrum.security.impl.db.entity.UserPeer;
-
import org.apache.fulcrum.security.util.AccessControlList;
import org.apache.fulcrum.security.util.DataBackendException;
import org.apache.fulcrum.security.util.EntityExistsException;
@@ -72,7 +70,6 @@
import org.apache.fulcrum.security.util.PasswordMismatchException;
import org.apache.fulcrum.security.util.PermissionSet;
import org.apache.fulcrum.security.util.RoleSet;
-import org.apache.fulcrum.security.util.TurbineSecurityException;
import org.apache.fulcrum.security.util.UnknownEntityException;
import org.apache.torque.util.Criteria;
@@ -161,7 +158,7 @@
* @throws UnknownEntityException if the system's implementation of User
* interface could not be determined.
*/
- public Class getUserClass()
+ Class getUserClass()
throws UnknownEntityException;
/**
@@ -173,7 +170,7 @@
* @return an object implementing User interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public User getUserInstance()
+ User getUserInstance()
throws UnknownEntityException;
/**
@@ -182,10 +179,12 @@
* This method calls getUserClass, and then creates a new object using
* the default constructor.
*
+ * @param userName The name of the user.
+ *
* @return an object implementing User interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public User getUserInstance(String userName)
+ User getUserInstance(String userName)
throws UnknownEntityException;
/**
@@ -196,7 +195,7 @@
* @throws UnknownEntityException if the system's implementation of Group
* interface could not be determined.
*/
- public Class getGroupClass()
+ Class getGroupClass()
throws UnknownEntityException;
/**
@@ -208,7 +207,7 @@
* @return an object implementing Group interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Group getGroupInstance()
+ Group getGroupInstance()
throws UnknownEntityException;
/**
@@ -217,10 +216,12 @@
* This method calls getGroupClass, and then creates a new object using
* the default constructor.
*
+ * @param groupName The name of the Group
+ *
* @return an object implementing Group interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Group getGroupInstance( String groupName )
+ Group getGroupInstance(String groupName)
throws UnknownEntityException;
/**
@@ -231,7 +232,7 @@
* @throws UnknownEntityException if the system's implementation of Permission
* interface could not be determined.
*/
- public Class getPermissionClass()
+ Class getPermissionClass()
throws UnknownEntityException;
/**
@@ -243,7 +244,7 @@
* @return an object implementing Permission interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Permission getPermissionInstance()
+ Permission getPermissionInstance()
throws UnknownEntityException;
/**
@@ -252,10 +253,12 @@
* This method calls getPermissionClass, and then creates a new object using
* the default constructor.
*
+ * @param permName The name of the Permission
+ *
* @return an object implementing Permission interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Permission getPermissionInstance(String permName)
+ Permission getPermissionInstance(String permName)
throws UnknownEntityException;
/**
@@ -266,7 +269,7 @@
* @throws UnknownEntityException if the system's implementation of Role
* interface could not be determined.
*/
- public Class getRoleClass()
+ Class getRoleClass()
throws UnknownEntityException;
/**
@@ -278,7 +281,7 @@
* @return an object implementing Role interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Role getRoleInstance()
+ Role getRoleInstance()
throws UnknownEntityException;
/**
@@ -287,10 +290,12 @@
* This method calls getRoleClass, and then creates a new object using
* the default constructor.
*
+ * @param roleName The name of the Role
+ *
* @return an object implementing Role interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public Role getRoleInstance(String roleName)
+ Role getRoleInstance(String roleName)
throws UnknownEntityException;
/**
@@ -301,7 +306,7 @@
* @throws UnknownEntityException if the system's implementation of AccessControlList
* interface could not be determined.
*/
- public Class getAclClass()
+ Class getAclClass()
throws UnknownEntityException;
/**
@@ -316,7 +321,7 @@
* @return an object implementing ACL interface.
* @throws UnknownEntityException if the object could not be instantiated.
*/
- public AccessControlList getAclInstance(Map roles, Map permissions)
+ AccessControlList getAclInstance(Map roles, Map permissions)
throws UnknownEntityException;
/**
@@ -324,23 +329,26 @@
*
* The login name is used for looking up the account.
*
- * @param user The user to be checked.
+ * @param userName The user to be checked.
+ *
* @return true if the specified account exists
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( String username )
+ boolean accountExists(String userName)
throws DataBackendException;
/**
* Check whether a specified user's account exists.
+ * An User object is used for looking up the account.
*
- * The login name is used for looking up the account.
+ * @param user The user object to be checked.
*
- * @param usename The name of the user to be checked.
* @return true if the specified account exists
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( User user )
+ boolean accountExists(User user)
throws DataBackendException;
/**
@@ -353,7 +361,7 @@
* @throws UnknownEntityException if user account is not present.
* @throws PasswordMismatchException if the supplied password was incorrect.
*/
- public User getAuthenticatedUser( String username, String password )
+ User getAuthenticatedUser(String username, String password)
throws DataBackendException, UnknownEntityException, PasswordMismatchException;
/**
@@ -364,7 +372,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account is not present.
*/
- public User getUser( String username )
+ User getUser(String username)
throws DataBackendException, UnknownEntityException;
/**
@@ -381,7 +389,7 @@
* @throws DataBackendException if there is a problem accessing the
* storage.
*/
- public User[] getUsers( Criteria criteria )
+ User[] getUsers(Criteria criteria)
throws DataBackendException;
/**
@@ -391,19 +399,21 @@
* @throws UnknownEntityException if the anonymous User object couldn't be
* constructed.
*/
- public User getAnonymousUser()
+ User getAnonymousUser()
throws UnknownEntityException;
/**
* Saves User's data in the permanent storage. The user account is required
* to exist in the storage.
*
+ * @param user The user object to save.
+ *
* @exception UnknownEntityException if the user's account does not
* exist in the database.
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void saveUser( User user )
+ void saveUser(User user)
throws UnknownEntityException, DataBackendException;
/*-----------------------------------------------------------------------
@@ -414,10 +424,12 @@
* Creates new user account with specified attributes.
*
* @param user the object describing account to be created.
+ * @param password The password to use.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the user account already exists.
*/
- public void addUser( User user, String password )
+ void addUser(User user, String password)
throws DataBackendException, EntityExistsException;
/**
@@ -427,7 +439,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the user account is not present.
*/
- public void removeUser( User user )
+ void removeUser(User user)
throws DataBackendException, UnknownEntityException;
/*-----------------------------------------------------------------------
@@ -444,7 +456,7 @@
* @param password the password to process
* @return processed password
*/
- public String encryptPassword( String password );
+ String encryptPassword(String password);
/**
* Change the password for an User.
@@ -459,7 +471,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void changePassword( User user, String oldPassword, String newPassword )
+ void changePassword(User user, String oldPassword, String newPassword)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException;
@@ -478,7 +490,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void forcePassword( User user, String password )
+ void forcePassword(User user, String password)
throws UnknownEntityException, DataBackendException;
/*-----------------------------------------------------------------------
@@ -489,20 +501,26 @@
* Constructs an AccessControlList for a specific user.
*
* @param user the user for whom the AccessControlList are to be retrieved
+ *
+ * @return A new AccessControlList object.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account is not present.
*/
- public AccessControlList getACL( User user )
+ AccessControlList getACL(User user)
throws DataBackendException, UnknownEntityException;
/**
* Retrieves all permissions associated with a role.
*
* @param role the role name, for which the permissions are to be retrieved.
+ *
+ * @return A Permission set for the Role.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role is not present.
*/
- public PermissionSet getPermissions( Role role )
+ PermissionSet getPermissions(Role role)
throws DataBackendException, UnknownEntityException;
/*-----------------------------------------------------------------------
@@ -512,25 +530,25 @@
/**
* Grant an User a Role in a Group.
*
- * @param User the user.
- * @param Group the group.
- * @param Role the role.
+ * @param user the user.
+ * @param group the group.
+ * @param role the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account, group or role is not present.
*/
- public void grant( User user, Group group, Role role )
+ void grant(User user, Group group, Role role)
throws DataBackendException, UnknownEntityException;
/**
* Revoke a Role in a Group from an User.
*
- * @param User the user.
- * @param Group the group.
- * @param Role the role.
+ * @param user the user.
+ * @param group the group.
+ * @param role the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account, group or role is not present.
*/
- public void revoke( User user, Group group, Role role )
+ void revoke(User user, Group group, Role role)
throws DataBackendException, UnknownEntityException;
/**
@@ -542,7 +560,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the account is not present.
*/
- public void revokeAll( User user )
+ void revokeAll(User user)
throws DataBackendException, UnknownEntityException;
/**
@@ -553,7 +571,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if role or permission is not present.
*/
- public void grant( Role role, Permission permission )
+ void grant(Role role, Permission permission)
throws DataBackendException, UnknownEntityException;
/**
@@ -564,7 +582,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if role or permission is not present.
*/
- public void revoke( Role role, Permission permission )
+ void revoke(Role role, Permission permission)
throws DataBackendException, UnknownEntityException;
/**
@@ -576,7 +594,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the Role is not present.
*/
- public void revokeAll( Role role )
+ void revokeAll(Role role)
throws DataBackendException, UnknownEntityException;
/*-----------------------------------------------------------------------
@@ -587,77 +605,104 @@
* Provides a reference to the Group object that represents the
* <a href="#global">global group</a>.
*
- * @return a Group object that represents the global group.
+ * @return A Group object that represents the global group.
*/
- public Group getGlobalGroup();
+ Group getGlobalGroup();
/**
* @deprecated Use getGroupInstance(String name) instead.
*/
- public Group getNewGroup( String groupName );
+ Group getNewGroup(String groupName);
/**
* @deprecated Use getRoleInstance(String name) instead.
*/
- public Role getNewRole( String roleName );
+ Role getNewRole(String roleName);
/**
* @deprecated Use getPermissionInstance(String name) instead.
*/
- public Permission getNewPermission( String permissionName );
+ Permission getNewPermission(String permissionName);
/**
* Retrieve a Group object with specified name.
*
* @param name the name of the Group.
+ *
* @return an object representing the Group with specified name.
+ *
+ * @exception UnknownEntityException if the permission does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Group getGroup( String name )
+ Group getGroup(String name)
throws DataBackendException, UnknownEntityException;
/**
* Retrieve a Role object with specified name.
*
* @param name the name of the Role.
+ *
* @return an object representing the Role with specified name.
+ *
+ * @exception UnknownEntityException if the permission does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Role getRole( String name )
+ Role getRole(String name)
throws DataBackendException, UnknownEntityException;
/**
* Retrieve a Permission object with specified name.
*
* @param name the name of the Permission.
+ *
* @return an object representing the Permission with specified name.
+ *
+ * @exception UnknownEntityException if the permission does not
+ * exist in the database.
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public Permission getPermission( String name )
+ Permission getPermission(String name)
throws DataBackendException, UnknownEntityException;
/**
* Retrieve a set of Groups that meet the specified Criteria.
*
- * @param a Criteria of Group selection.
+ * @param criteria a Criteria of Group selection.
* @return a set of Groups that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public GroupSet getGroups( Criteria criteria )
+ GroupSet getGroups(Criteria criteria)
throws DataBackendException;
/**
* Retrieve a set of Roles that meet the specified Criteria.
*
- * @param a Criteria of Roles selection.
+ * @param criteria a Criteria of Roles selection.
* @return a set of Roles that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public RoleSet getRoles( Criteria criteria )
+ RoleSet getRoles(Criteria criteria)
throws DataBackendException;
/**
* Retrieve a set of Permissions that meet the specified Criteria.
*
- * @param a Criteria of Permissions selection.
+ * @param criteria a Criteria of Permissions selection.
* @return a set of Permissions that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public PermissionSet getPermissions( Criteria criteria )
+ PermissionSet getPermissions(Criteria criteria)
throws DataBackendException;
/**
@@ -666,7 +711,7 @@
* @return the names of all groups defined in the system.
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public GroupSet getAllGroups()
+ GroupSet getAllGroups()
throws DataBackendException;
/**
@@ -675,7 +720,7 @@
* @return the names of all roles defined in the system.
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public RoleSet getAllRoles()
+ RoleSet getAllRoles()
throws DataBackendException;
/**
@@ -684,16 +729,16 @@
* @return the names of all roles defined in the system.
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public PermissionSet getAllPermissions()
+ PermissionSet getAllPermissions()
throws DataBackendException;
- /**
+ /**
* Stores Group's attributes. The Groups is required to exist in the system.
*
* @param group The Group to be stored.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public void saveGroup( Group group )
+ void saveGroup(Group group)
throws DataBackendException, UnknownEntityException;
/**
@@ -703,7 +748,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public void saveRole( Role role )
+ void saveRole(Role role)
throws DataBackendException, UnknownEntityException;
/**
@@ -713,7 +758,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public void savePermission( Permission permission )
+ void savePermission(Permission permission)
throws DataBackendException, UnknownEntityException;
/*-----------------------------------------------------------------------
@@ -728,91 +773,91 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the group already exists.
*/
- public Group addGroup( Group group )
+ Group addGroup(Group group)
throws DataBackendException, EntityExistsException;
/**
* Creates a new role with specified attributes.
*
- * @param group the objects describing the group to be created.
+ * @param role The object describing the role to be created.
* @return the new Role object.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the role already exists.
*/
- public Role addRole( Role role )
+ Role addRole(Role role)
throws DataBackendException, EntityExistsException;
/**
* Creates a new permission with specified attributes.
*
- * @param group the objects describing the group to be created.
+ * @param permission The object describing the permission to be created.
* @return the new Permission object.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the permission already exists.
*/
- public Permission addPermission( Permission permission )
+ Permission addPermission(Permission permission)
throws DataBackendException, EntityExistsException;
/**
* Removes a Group from the system.
*
- * @param the object describing group to be removed.
+ * @param group The object describing group to be removed.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public void removeGroup( Group group )
+ void removeGroup(Group group)
throws DataBackendException, UnknownEntityException;
/**
* Removes a Role from the system.
*
- * @param the object describing role to be removed.
+ * @param role The object describing role to be removed.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public void removeRole( Role role )
+ void removeRole(Role role)
throws DataBackendException, UnknownEntityException;
/**
* Removes a Permission from the system.
*
- * @param the object describing permission to be removed.
+ * @param permission The object describing permission to be removed.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public void removePermission( Permission permission )
+ void removePermission(Permission permission)
throws DataBackendException, UnknownEntityException;
/**
* Renames an existing Group.
*
- * @param the object describing the group to be renamed.
+ * @param group The object describing the group to be renamed.
* @param name the new name for the group.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public void renameGroup( Group group, String name )
+ void renameGroup(Group group, String name)
throws DataBackendException, UnknownEntityException;
/**
* Renames an existing Role.
*
- * @param the object describing the role to be renamed.
+ * @param role The object describing the role to be renamed.
* @param name the new name for the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public void renameRole( Role role, String name )
+ void renameRole(Role role, String name)
throws DataBackendException, UnknownEntityException;
/**
* Renames an existing Permission.
*
- * @param the object describing the permission to be renamed.
+ * @param permission The object describing the permission to be renamed.
* @param name the new name for the permission.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public void renamePermission( Permission permission, String name )
+ void renamePermission(Permission permission, String name)
throws DataBackendException, UnknownEntityException;
}
1.4 +118 -69 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/TurbineSecurity.java
Index: TurbineSecurity.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/TurbineSecurity.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TurbineSecurity.java 8 Jul 2002 23:24:07 -0000 1.3
+++ TurbineSecurity.java 9 Jul 2002 13:58:18 -0000 1.4
@@ -61,8 +61,6 @@
import org.apache.fulcrum.security.entity.Role;
import org.apache.fulcrum.security.entity.User;
-import org.apache.fulcrum.security.impl.db.entity.UserPeer;
-
import org.apache.fulcrum.security.util.AccessControlList;
import org.apache.fulcrum.security.util.GroupSet;
import org.apache.fulcrum.security.util.RoleSet;
@@ -102,7 +100,7 @@
*/
public static SecurityService getService()
{
- return (SecurityService)TurbineServices.getInstance().
+ return (SecurityService) TurbineServices.getInstance().
getService(SecurityService.SERVICE_NAME);
}
@@ -110,7 +108,7 @@
Management of User objects
-----------------------------------------------------------------------*/
- /*
+ /**
* This method provides client-side encryption of passwords.
*
* This is an utility method that is used by other classes to maintain
@@ -120,7 +118,7 @@
* @param password the password to process
* @return processed password
*/
- public static String encryptPassword( String password )
+ public static String encryptPassword(String password)
{
return getService().encryptPassword(password);
}
@@ -163,7 +161,7 @@
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public static boolean accountExists( User user )
+ public static boolean accountExists(User user)
throws DataBackendException
{
return getService().accountExists(user);
@@ -174,14 +172,16 @@
*
* The login name is used for looking up the account.
*
- * @param usename The name of the user to be checked.
+ * @param userName The name of the user to be checked.
+ *
* @return true if the specified account exists
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public static boolean accountExists( String username )
+ public static boolean accountExists(String userName)
throws DataBackendException
{
- return getService().accountExists(username);
+ return getService().accountExists(userName);
}
/**
@@ -192,9 +192,9 @@
* @return An authenticated Turbine User.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account is not present.
- * @throws PasswordMissmatchException if the supplied password was incorrect.
+ * @throws PasswordMismatchException if the supplied password was incorrect.
*/
- public static User getAuthenticatedUser( String username, String password)
+ public static User getAuthenticatedUser(String username, String password)
throws DataBackendException, UnknownEntityException, PasswordMismatchException
{
return getService().getAuthenticatedUser(username, password);
@@ -208,7 +208,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account is not present.
*/
- public static User getUser( String username )
+ public static User getUser(String username)
throws DataBackendException, UnknownEntityException
{
return getService().getUser(username);
@@ -228,7 +228,7 @@
* @throws DataBackendException if there is a problem accessing the
* storage.
*/
- public static User[] getUsers( Criteria criteria )
+ public static User[] getUsers(Criteria criteria)
throws DataBackendException
{
return getService().getUsers(criteria);
@@ -251,12 +251,14 @@
* Saves User's data in the permanent storage. The user account is required
* to exist in the storage.
*
+ * @param user The User object to save.
+ *
* @exception UnknownEntityException if the user's account does not
* exist in the database.
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public static void saveUser( User user )
+ public static void saveUser(User user)
throws UnknownEntityException, DataBackendException
{
getService().saveUser(user);
@@ -275,7 +277,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public static void changePassword( User user, String oldPassword, String newPassword )
+ public static void changePassword(User user, String oldPassword, String newPassword)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException
{
@@ -297,10 +299,10 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public static void forcePassword( User user, String password )
+ public static void forcePassword(User user, String password)
throws UnknownEntityException, DataBackendException
{
- getService().forcePassword( user, password );
+ getService().forcePassword(user, password);
}
/*-----------------------------------------------------------------------
@@ -311,10 +313,13 @@
* Constructs an AccessControlList for a specific user.
*
* @param user the user for whom the AccessControlList are to be retrieved
+ *
+ * @return The AccessControList object constructed from the user object.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account is not present.
*/
- public static AccessControlList getACL( User user )
+ public static AccessControlList getACL(User user)
throws DataBackendException, UnknownEntityException
{
return getService().getACL(user);
@@ -327,13 +332,13 @@
/**
* Grant an User a Role in a Group.
*
- * @param User the user.
- * @param Group the group.
- * @param Role the role.
+ * @param user the user.
+ * @param group the group.
+ * @param role the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account, group or role is not present.
*/
- public static void grant( User user, Group group, Role role )
+ public static void grant(User user, Group group, Role role)
throws DataBackendException, UnknownEntityException
{
getService().grant(user, group, role);
@@ -342,13 +347,13 @@
/**
* Revoke a Role in a Group from an User.
*
- * @param User the user.
- * @param Group the group.
- * @param Role the role.
+ * @param user the user.
+ * @param group the group.
+ * @param role the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if user account, group or role is not present.
*/
- public static void revoke( User user, Group group, Role role )
+ public static void revoke(User user, Group group, Role role)
throws DataBackendException, UnknownEntityException
{
getService().revoke(user, group, role);
@@ -363,7 +368,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the account is not present.
*/
- public static void revokeAll( User user )
+ public static void revokeAll(User user)
throws DataBackendException, UnknownEntityException
{
getService().revokeAll(user);
@@ -377,7 +382,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if role or permission is not present.
*/
- public static void grant( Role role, Permission permission )
+ public static void grant(Role role, Permission permission)
throws DataBackendException, UnknownEntityException
{
getService().grant(role, permission);
@@ -391,7 +396,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if role or permission is not present.
*/
- public static void revoke( Role role, Permission permission )
+ public static void revoke(Role role, Permission permission)
throws DataBackendException, UnknownEntityException
{
getService().revoke(role, permission);
@@ -406,7 +411,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the Role is not present.
*/
- public static void revokeAll( Role role )
+ public static void revokeAll(Role role)
throws DataBackendException, UnknownEntityException
{
getService().revokeAll(role);
@@ -422,10 +427,12 @@
* <strong>TODO</strong> throw more specific exception<br>
*
* @param user the object describing account to be created.
+ * @param password The password to use.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the user account already exists.
*/
- public static void addUser( User user, String password )
+ public static void addUser(User user, String password)
throws DataBackendException, EntityExistsException
{
getService().addUser(user, password);
@@ -441,7 +448,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the user account is not present.
*/
- public static void removeUser( User user )
+ public static void removeUser(User user)
throws DataBackendException, UnknownEntityException
{
getService().removeUser(user);
@@ -470,7 +477,7 @@
* @return An object representing the new Group.
* @throws TurbineSecurityException if the Group could not be created.
*/
- public static Group createGroup( String name )
+ public static Group createGroup(String name)
throws TurbineSecurityException
{
return getService().addGroup(getNewGroup(name));
@@ -484,7 +491,7 @@
* @return An object representing the new Permission.
* @throws TurbineSecurityException if the Permission could not be created.
*/
- public static Permission createPermission( String name )
+ public static Permission createPermission(String name)
throws TurbineSecurityException
{
return getService().addPermission(getNewPermission(name));
@@ -495,10 +502,12 @@
* method.
*
* @param name The name of the Role.
+ *
* @return An object representing the new Role.
+ *
* @throws TurbineSecurityException if the Role could not be created.
*/
- public static Role createRole( String name )
+ public static Role createRole(String name)
throws TurbineSecurityException
{
return getService().addRole(getNewRole(name));
@@ -508,10 +517,13 @@
* Retrieves a named Group.
*
* @param groupName The name of the Group to be retrieved.
+ *
+ * @return an object representing the Group with specified name.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the Group is not present.
*/
- public static Group getGroup( String groupName )
+ public static Group getGroup(String groupName)
throws DataBackendException, UnknownEntityException
{
return getService().getGroup(groupName);
@@ -524,9 +536,12 @@
* point.
*
* @param groupName The name of the Group to be retrieved.
+ *
+ * @return an object representing the Group with specified name.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public static Group getNewGroup( String groupName )
+ public static Group getNewGroup(String groupName)
throws DataBackendException
{
return getService().getNewGroup(groupName);
@@ -539,9 +554,12 @@
* point.
*
* @param roleName The name of the Role to be retrieved.
- * @throws DataBackendException if there was an error accessing the data backend.
+ *
+ * @return an object representing the Role with specified name.
+ *
+ * @throws TurbineSecurityException if the Role could not be created.
*/
- public static Role getNewRole( String roleName )
+ public static Role getNewRole(String roleName)
throws TurbineSecurityException
{
return getService().getNewRole(roleName);
@@ -553,10 +571,13 @@
* to pass in null or "" here and then use Permission.setName() at a later
* point.
*
- * @param groupName The name of the Permission to be retrieved.
+ * @param permissionName The name of the Permission to be retrieved.
+ *
+ * @return an object representing the Permission with specified name.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public static Permission getNewPermission( String permissionName )
+ public static Permission getNewPermission(String permissionName)
throws DataBackendException
{
return getService().getNewPermission(permissionName);
@@ -566,10 +587,13 @@
* Retrieves a named Role.
*
* @param roleName The name of the Role to be retrieved.
+ *
+ * @return an object representing the Role with specified name.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the Role is not present.
*/
- public static Role getRole( String roleName )
+ public static Role getRole(String roleName)
throws DataBackendException, UnknownEntityException
{
return getService().getRole(roleName);
@@ -579,10 +603,13 @@
* Retrieves a named Permission.
*
* @param permissionName The name of the Permission to be retrieved.
+ *
+ * @return an object representing the Permission with specified name.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the Permission is not present.
*/
- public static Permission getPermission( String permissionName )
+ public static Permission getPermission(String permissionName)
throws DataBackendException, UnknownEntityException
{
return getService().getPermission(permissionName);
@@ -591,10 +618,14 @@
/**
* Retrieve a set of Groups that meet the specified Criteria.
*
- * @param a Criteria of Group selection.
+ * @param criteria A Criteria of Group selection.
+ *
* @return a set of Groups that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public static GroupSet getGroups( Criteria criteria )
+ public static GroupSet getGroups(Criteria criteria)
throws DataBackendException
{
return getService().getGroups(criteria);
@@ -606,8 +637,11 @@
*
* @param criteria a Criteria of Roles selection.
* @return a set of Roles that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public static RoleSet getRoles( Criteria criteria )
+ public static RoleSet getRoles(Criteria criteria)
throws DataBackendException
{
return getService().getRoles(criteria);
@@ -617,9 +651,13 @@
* Retrieve a set of Permissions that meet the specified Criteria.
*
* @param criteria a Criteria of Permissions selection.
+ *
* @return a set of Permissions that meet the specified Criteria.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
- public static PermissionSet getPermissions( Criteria criteria )
+ public static PermissionSet getPermissions(Criteria criteria)
throws DataBackendException
{
return getService().getPermissions(criteria);
@@ -629,6 +667,9 @@
* Retrieves all groups defined in the system.
*
* @return the names of all groups defined in the system.
+ *
+ * @exception DataBackendException if there is a problem accessing the
+ * storage.
*/
public static GroupSet getAllGroups()
throws DataBackendException
@@ -640,6 +681,7 @@
* Retrieves all roles defined in the system.
*
* @return the names of all roles defined in the system.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
public static RoleSet getAllRoles()
@@ -652,6 +694,7 @@
* Retrieves all permissions defined in the system.
*
* @return the names of all roles defined in the system.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
*/
public static PermissionSet getAllPermissions()
@@ -664,10 +707,13 @@
* Retrieves all permissions associated with a role.
*
* @param role the role name, for which the permissions are to be retrieved.
+ *
+ * @return an PermissionSet with all permissions for the supplied role.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role is not present.
*/
- public static PermissionSet getPermissions( Role role )
+ public static PermissionSet getPermissions(Role role)
throws DataBackendException, UnknownEntityException
{
return getService().getPermissions(role);
@@ -677,10 +723,11 @@
* Stores Group's attributes. The Groups is required to exist in the system.
*
* @param group The Group to be stored.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public static void saveGroup( Group group )
+ public static void saveGroup(Group group)
throws DataBackendException, UnknownEntityException
{
getService().saveGroup(group);
@@ -690,10 +737,11 @@
* Stores Role's attributes. The Roles is required to exist in the system.
*
* @param role The Role to be stored.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public static void saveRole( Role role )
+ public static void saveRole(Role role)
throws DataBackendException, UnknownEntityException
{
getService().saveRole(role);
@@ -707,7 +755,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public static void savePermission( Permission permission )
+ public static void savePermission(Permission permission)
throws DataBackendException, UnknownEntityException
{
getService().savePermission(permission);
@@ -720,7 +768,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the group already exists.
*/
- public static void addGroup( Group group )
+ public static void addGroup(Group group)
throws DataBackendException, EntityExistsException
{
getService().addGroup(group);
@@ -729,11 +777,11 @@
/**
* Creates a new role with specified attributes.
*
- * @param group the objects describing the group to be created.
+ * @param role the objects describing the role to be created.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the role already exists.
*/
- public static void addRole( Role role )
+ public static void addRole(Role role)
throws DataBackendException, EntityExistsException
{
getService().addRole(role);
@@ -742,11 +790,11 @@
/**
* Creates a new permission with specified attributes.
*
- * @param group the objects describing the group to be created.
+ * @param permission the objects describing the permission to be created.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the permission already exists.
*/
- public static void addPermission( Permission permission )
+ public static void addPermission(Permission permission)
throws DataBackendException, EntityExistsException
{
getService().addPermission(permission);
@@ -755,11 +803,12 @@
/**
* Removes a Group from the system.
*
- * @param the object describing group to be removed.
+ * @param group the object describing group to be removed.
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public static void removeGroup( Group group )
+ public static void removeGroup(Group group)
throws DataBackendException, UnknownEntityException
{
getService().removeGroup(group);
@@ -768,11 +817,11 @@
/**
* Removes a Role from the system.
*
- * @param the object describing role to be removed.
+ * @param role The object describing role to be removed.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public static void removeRole( Role role )
+ public static void removeRole(Role role)
throws DataBackendException, UnknownEntityException
{
getService().removeRole(role);
@@ -781,11 +830,11 @@
/**
* Removes a Permission from the system.
*
- * @param the object describing permission to be removed.
+ * @param permission The object describing permission to be removed.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public static void removePermission( Permission permission )
+ public static void removePermission(Permission permission)
throws DataBackendException, UnknownEntityException
{
getService().removePermission(permission);
@@ -794,12 +843,12 @@
/**
* Renames an existing Group.
*
- * @param the object describing the group to be renamed.
+ * @param group The object describing the group to be renamed.
* @param name the new name for the group.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the group does not exist.
*/
- public static void renameGroup( Group group, String name )
+ public static void renameGroup(Group group, String name)
throws DataBackendException, UnknownEntityException
{
getService().renameGroup(group, name);
@@ -808,12 +857,12 @@
/**
* Renames an existing Role.
*
- * @param the object describing the role to be renamed.
+ * @param role The object describing the role to be renamed.
* @param name the new name for the role.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the role does not exist.
*/
- public static void renameRole( Role role, String name )
+ public static void renameRole(Role role, String name)
throws DataBackendException, UnknownEntityException
{
getService().renameRole(role, name);
@@ -822,12 +871,12 @@
/**
* Renames an existing Permission.
*
- * @param the object describing the permission to be renamed.
+ * @param permission The object describing the permission to be renamed.
* @param name the new name for the permission.
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the permission does not exist.
*/
- public static void renamePermission( Permission permission, String name )
+ public static void renamePermission(Permission permission, String name)
throws DataBackendException, UnknownEntityException
{
getService().renamePermission(permission, name);
1.2 +15 -13 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/UserManager.java
Index: UserManager.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/UserManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UserManager.java 30 May 2002 02:27:30 -0000 1.1
+++ UserManager.java 9 Jul 2002 13:58:18 -0000 1.2
@@ -84,7 +84,7 @@
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( User user )
+ boolean accountExists(User user)
throws DataBackendException;
/**
@@ -92,11 +92,11 @@
*
* The login name is used for looking up the account.
*
- * @param usename The name of the user to be checked.
+ * @param userName The name of the user to be checked.
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( String username )
+ boolean accountExists(String userName)
throws DataBackendException;
/**
@@ -110,7 +110,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User retrieve( String username )
+ User retrieve(String username)
throws UnknownEntityException, DataBackendException;
/**
@@ -127,7 +127,7 @@
* @throws DataBackendException if there is a problem accessing the
* storage.
*/
- public User[] retrieve( Criteria criteria )
+ User[] retrieve(Criteria criteria)
throws DataBackendException;
/**
@@ -146,7 +146,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User retrieve( String username, String password )
+ User retrieve(String username, String password)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException;
@@ -160,7 +160,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void store( User user )
+ void store(User user)
throws UnknownEntityException, DataBackendException;
/**
@@ -177,7 +177,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void authenticate( User user, String password )
+ void authenticate(User user, String password)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException;
@@ -185,10 +185,12 @@
* Creates new user account with specified attributes.
*
* @param user the object describing account to be created.
+ * @param password The password to use for the object creation
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the user account already exists.
*/
- public void createAccount( User user, String initialPassword )
+ void createAccount(User user, String password)
throws EntityExistsException, DataBackendException;
/**
@@ -198,7 +200,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the user account is not present.
*/
- public void removeAccount( User user )
+ void removeAccount(User user)
throws UnknownEntityException, DataBackendException;
/**
* Change the password for an User.
@@ -213,7 +215,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void changePassword( User user, String oldPassword, String newPassword )
+ void changePassword(User user, String oldPassword, String newPassword)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException;
@@ -232,6 +234,6 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void forcePassword( User user, String password )
+ void forcePassword(User user, String password)
throws UnknownEntityException, DataBackendException;
}
1.2 +10 -10 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Group.java
Index: Group.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Group.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Group.java 30 May 2002 02:27:31 -0000 1.1
+++ Group.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -78,14 +78,14 @@
*
* @return The name of the object.
*/
- public String getName();
+ String getName();
/**
* Sets the name of this object.
*
* @param name The name of the object.
*/
- public void setName(String name);
+ void setName(String name);
/**
* Makes changes made to the Group attributes permanent.
@@ -93,7 +93,7 @@
* @throws TurbineSecurityException if there is a problem while
* saving data.
*/
- public void save()
+ void save()
throws TurbineSecurityException;
/**
@@ -101,7 +101,7 @@
*
* @throws TurbineSecurityException if the Group could not be removed.
*/
- public void remove()
+ void remove()
throws TurbineSecurityException;
/**
@@ -110,7 +110,7 @@
* @param name The new Group name.
* @throws TurbineSecurityException if the Group could not be renamed.
*/
- public void rename(String name)
+ void rename(String name)
throws TurbineSecurityException;
/**
@@ -121,7 +121,7 @@
* @throws TurbineSecurityException if there is a problem while assigning
* the Role.
*/
- public void grant(User user, Role role)
+ void grant(User user, Role role)
throws TurbineSecurityException;
/**
@@ -132,7 +132,7 @@
* @throws TurbineSecurityException if there is a problem while assigning
* the Roles.
*/
- public void grant(User user, RoleSet roleSet)
+ void grant(User user, RoleSet roleSet)
throws TurbineSecurityException;
/**
@@ -143,7 +143,7 @@
* @throws TurbineSecurityException if there is a problem while unassigning
* the Role.
*/
- public void revoke(User user, Role role)
+ void revoke(User user, Role role)
throws TurbineSecurityException;
/**
@@ -154,7 +154,7 @@
* @throws TurbineSecurityException if there is a problem while unassigning
* the Roles.
*/
- public void revoke(User user, RoleSet roleSet)
+ void revoke(User user, RoleSet roleSet)
throws TurbineSecurityException;
}
1.2 +4 -4 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Permission.java
Index: Permission.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Permission.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Permission.java 30 May 2002 02:27:31 -0000 1.1
+++ Permission.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -75,7 +75,7 @@
* @throws TurbineSecurityException if there is a problem while
* saving data.
*/
- public void save()
+ void save()
throws TurbineSecurityException;
/**
@@ -83,7 +83,7 @@
*
* @throws TurbineSecurityException if the Permission could not be removed.
*/
- public void remove()
+ void remove()
throws TurbineSecurityException;
/**
@@ -92,6 +92,6 @@
* @param name The new Permission name.
* @throws TurbineSecurityException if the Permission could not be renamed.
*/
- public void rename(String name)
+ void rename(String name)
throws TurbineSecurityException;
}
1.2 +12 -12 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Role.java
Index: Role.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/Role.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Role.java 30 May 2002 02:27:31 -0000 1.1
+++ Role.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -72,9 +72,9 @@
* Returns the set of Permissions associated with this Role.
*
* @return A PermissionSet.
- * @exception Exception, a generic exception.
+ * @exception Exception A generic exception.
*/
- public PermissionSet getPermissions()
+ PermissionSet getPermissions()
throws Exception;
/**
@@ -82,7 +82,7 @@
*
* @param permissionSet A PermissionSet.
*/
- public void setPermissions(PermissionSet permissionSet);
+ void setPermissions(PermissionSet permissionSet);
// These following methods are wrappers around TurbineSecurity
@@ -93,7 +93,7 @@
* @return An object representing the new Role.
* @throws TurbineSecurityException if the Role could not be created.
*/
- public Role create( String name )
+ Role create(String name)
throws TurbineSecurityException;
/**
@@ -102,7 +102,7 @@
* @throws TurbineSecurityException if there is a problem while
* saving data.
*/
- public void save()
+ void save()
throws TurbineSecurityException;
/**
@@ -110,7 +110,7 @@
*
* @throws TurbineSecurityException if the Role could not be removed.
*/
- public void remove()
+ void remove()
throws TurbineSecurityException;
/**
@@ -119,7 +119,7 @@
* @param name The new Role name.
* @throws TurbineSecurityException if the Role could not be renamed.
*/
- public void rename(String name)
+ void rename(String name)
throws TurbineSecurityException;
/**
@@ -129,7 +129,7 @@
* @throws TurbineSecurityException if there is a problem while assigning
* the Permission.
*/
- public void grant(Permission permission)
+ void grant(Permission permission)
throws TurbineSecurityException;
/**
@@ -139,7 +139,7 @@
* @throws TurbineSecurityException if there is a problem while assigning
* the Permissions.
*/
- public void grant(PermissionSet permissionSet)
+ void grant(PermissionSet permissionSet)
throws TurbineSecurityException;
/**
@@ -149,7 +149,7 @@
* @throws TurbineSecurityException if there is a problem while unassigning
* the Permission.
*/
- public void revoke(Permission permission)
+ void revoke(Permission permission)
throws TurbineSecurityException;
/**
@@ -159,6 +159,6 @@
* @throws TurbineSecurityException if there is a problem while unassigning
* the Permissions.
*/
- public void revoke(PermissionSet permissionSet)
+ void revoke(PermissionSet permissionSet)
throws TurbineSecurityException;
}
1.4 +3 -3 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/SecurityEntity.java
Index: SecurityEntity.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/SecurityEntity.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SecurityEntity.java 2 Jul 2002 16:36:36 -0000 1.3
+++ SecurityEntity.java 9 Jul 2002 13:58:19 -0000 1.4
@@ -73,12 +73,12 @@
*
* @return The Name of the SecurityEntity.
*/
- public String getName();
+ String getName();
/**
* Set the Name of the SecurityEntity.
*
* @param name Name of the SecurityEntity.
*/
- public void setName(String name);
+ void setName(String name);
}
1.2 +44 -47 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/User.java
Index: User.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/entity/User.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- User.java 30 May 2002 02:27:31 -0000 1.1
+++ User.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -54,7 +54,6 @@
* <http://www.apache.org/>.
*/
-import java.util.Date;
import java.util.Hashtable;
import java.io.Serializable;
@@ -114,14 +113,14 @@
*
* @return The access counter for the user.
*/
- public int getAccessCounter();
+ int getAccessCounter();
/**
* Gets the access counter for a user during a session.
*
* @return The access counter for the user for the session.
*/
- public int getAccessCounterForSession();
+ int getAccessCounterForSession();
/**
* Gets the last access date for this User. This is the last time
@@ -129,7 +128,7 @@
*
* @return A Java Date with the last access date for the user.
*/
- public java.util.Date getLastAccessDate();
+ java.util.Date getLastAccessDate();
/**
* Gets the create date for this User. This is the time at which
@@ -137,14 +136,14 @@
*
* @return A Java Date with the date of creation for the user.
*/
- public java.util.Date getCreateDate();
+ java.util.Date getCreateDate();
/**
* Returns the user's last login date.
*
* @return A Java Date with the last login date for the user.
*/
- public java.util.Date getLastLogin();
+ java.util.Date getLastLogin();
/**
* Returns the user's password. This method should not be used by
@@ -158,7 +157,7 @@
*
* @return A String with the password for the user.
*/
- public String getPassword();
+ String getPassword();
/**
* Get an object from permanent storage.
@@ -166,7 +165,7 @@
* @param name The object's name.
* @return An Object with the given name.
*/
- public Object getPerm ( String name );
+ Object getPerm(String name);
/**
* Get an object from permanent storage; return default if value
@@ -176,7 +175,7 @@
* @param def A default value to return.
* @return An Object with the given name.
*/
- public Object getPerm ( String name, Object def );
+ Object getPerm(String name, Object def);
/**
* This should only be used in the case where we want to save the
@@ -184,7 +183,7 @@
*
* @return A Hashtable.
*/
- public Hashtable getPermStorage();
+ Hashtable getPermStorage();
/**
* This should only be used in the case where we want to save the
@@ -192,7 +191,7 @@
*
* @return A Hashtable.
*/
- public Hashtable getTempStorage();
+ Hashtable getTempStorage();
/**
* Get an object from temporary storage.
@@ -200,7 +199,7 @@
* @param name The object's name.
* @return An Object with the given name.
*/
- public Object getTemp ( String name );
+ Object getTemp(String name);
/**
* Get an object from temporary storage; return default if value
@@ -210,14 +209,14 @@
* @param def A default value to return.
* @return An Object with the given name.
*/
- public Object getTemp ( String name, Object def );
+ Object getTemp(String name, Object def);
/**
* Returns the username for this user.
*
* @return A String with the username.
*/
- public String getUserName();
+ String getUserName();
/**
* Returns the first name for this user.
@@ -225,21 +224,21 @@
* @return A String with the user's first name.
*/
- public String getFirstName();
+ String getFirstName();
/**
* Returns the last name for this user.
*
* @return A String with the user's last name.
*/
- public String getLastName();
+ String getLastName();
/**
* Returns the email address for this user.
*
* @return A String with the user's email address.
*/
- public String getEmail();
+ String getEmail();
/**
* This sets whether or not someone has logged in. hasLoggedIn()
@@ -247,24 +246,24 @@
*
* @param value Whether someone has logged in or not.
*/
- public void setHasLoggedIn(Boolean value);
+ void setHasLoggedIn(Boolean value);
/**
* The user is considered logged in if they have not timed out.
*
* @return True if the user has logged in.
*/
- public boolean hasLoggedIn();
+ boolean hasLoggedIn();
/**
* Increments the permanent hit counter for the user.
*/
- public void incrementAccessCounter();
+ void incrementAccessCounter();
/**
* Increments the session hit counter for the user.
*/
- public void incrementAccessCounterForSession();
+ void incrementAccessCounterForSession();
/**
* Remove an object from temporary storage and return the object.
@@ -272,14 +271,14 @@
* @param name The name of the object to remove.
* @return An Object.
*/
- public Object removeTemp ( String name );
+ Object removeTemp(String name);
/**
* Sets the access counter for a user, saved in perm storage.
*
* @param cnt The new count.
*/
- public void setAccessCounter(int cnt);
+ void setAccessCounter(int cnt);
/**
* Sets the session access counter for a user, saved in temp
@@ -287,20 +286,20 @@
*
* @param cnt The new count.
*/
- public void setAccessCounterForSession(int cnt);
+ void setAccessCounterForSession(int cnt);
/**
* Sets the last access date for this User. This is the last time
* that the user object was referenced.
*/
- public void setLastAccessDate();
+ void setLastAccessDate();
/**
* Set last login date/time.
*
- * @param date The last login date.
+ * @param lastLogin The last login date.
*/
- public void setLastLogin(java.util.Date lastLogin);
+ void setLastLogin(java.util.Date lastLogin);
/**
* Set password. Application should not use this method
@@ -310,7 +309,7 @@
* @param password The new password.
*/
- public void setPassword(String password);
+ void setPassword(String password);
/**
* Put an object into permanent storage.
@@ -318,16 +317,16 @@
* @param name The object's name.
* @param value The object.
*/
- public void setPerm ( String name,
- Object value );
+ void setPerm(String name,
+ Object value);
/**
* This should only be used in the case where we want to save the
* data to the database.
*
- * @param stuff A Hashtable.
+ * @param storage A Hashtable.
*/
- public void setPermStorage(Hashtable stuff);
+ void setPermStorage(Hashtable storage);
/**
* This should only be used in the case where we want to save the
@@ -335,7 +334,7 @@
*
* @param storage A Hashtable.
*/
- public void setTempStorage(Hashtable stuff);
+ void setTempStorage(Hashtable storage);
/**
* Put an object into temporary storage.
@@ -343,73 +342,71 @@
* @param name The object's name.
* @param value The object.
*/
- public void setTemp ( String name, Object value );
+ void setTemp(String name, Object value);
/**
* Sets the username for this user.
*
* @param username The user's username.
*/
- public void setUserName(String username);
+ void setUserName(String username);
/**
* Sets the first name for this user.
*
* @param firstName User's first name.
*/
- public void setFirstName(String firstName);
+ void setFirstName(String firstName);
/**
* Sets the last name for this user.
*
* @param lastName User's last name.
*/
- public void setLastName(String lastName);
+ void setLastName(String lastName);
/**
* Sets the creation date for this user.
*
* @param date Creation date
*/
- public void setCreateDate(java.util.Date date);
+ void setCreateDate(java.util.Date date);
/**
* Sets the email address.
*
* @param address The email address.
*/
- public void setEmail(String address);
+ void setEmail(String address);
/**
* This method reports whether or not the user has been confirmed
* in the system by checking the TurbineUserPeer.CONFIRM_VALUE
* column to see if it is equal to CONFIRM_DATA.
*
- * @param user The User object.
* @return True if the user has been confirmed.
- * @exception Exception, a generic exception.
*/
- public boolean isConfirmed();
+ boolean isConfirmed();
/**
* Sets the confirmation value.
*
* @param value The confirmation key value.
*/
- public void setConfirmed(String value);
+ void setConfirmed(String value);
/**
* Gets the confirmation value.
*
* @return The confirmed value
*/
- public String getConfirmed();
+ String getConfirmed();
/**
* Updates the last login date in the database.
*
- * @exception Exception, a generic exception.
+ * @exception Exception A generic exception.
*/
- public void updateLastLogin()
+ void updateLastLogin()
throws Exception;
}
1.2 +17 -15 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/impl/passive/PassiveUserManager.java
Index: PassiveUserManager.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/impl/passive/PassiveUserManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PassiveUserManager.java 30 May 2002 02:27:34 -0000 1.1
+++ PassiveUserManager.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -85,7 +85,7 @@
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( User user )
+ public boolean accountExists(User user)
throws DataBackendException
{
throw new DataBackendException("PassiveUserManager knows no users");
@@ -96,17 +96,17 @@
*
* The login name is used for looking up the account.
*
- * @param usename The name of the user to be checked.
+ * @param userName The name of the user to be checked.
* @return true if the specified account exists
* @throws DataBackendException if there was an error accessing the data backend.
*/
- public boolean accountExists( String username )
+ public boolean accountExists(String userName)
throws DataBackendException
{
throw new DataBackendException("PassiveUserManager knows no users");
}
- /**
+ /**
* Retrieve a user from persistent storage using username as the
* key.
*
@@ -117,7 +117,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User retrieve( String username )
+ public User retrieve(String username)
throws UnknownEntityException, DataBackendException
{
throw new DataBackendException("PassiveUserManager knows no users");
@@ -137,7 +137,7 @@
* @throws DataBackendException if there is a problem accessing the
* storage.
*/
- public User[] retrieve( Criteria criteria )
+ public User[] retrieve(Criteria criteria)
throws DataBackendException
{
throw new DataBackendException("PassiveUserManager knows no users");
@@ -159,7 +159,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public User retrieve( String username, String password )
+ public User retrieve(String username, String password)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException
{
@@ -176,7 +176,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void store( User user )
+ public void store(User user)
throws UnknownEntityException, DataBackendException
{
throw new DataBackendException("PassiveUserManager does not support saving user data");
@@ -196,7 +196,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void authenticate( User user, String password )
+ public void authenticate(User user, String password)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException
{
@@ -207,13 +207,15 @@
* Creates new user account with specified attributes.
*
* @param user the object describing account to be created.
+ * @param password The password to use for the object creation
+ *
* @throws DataBackendException if there was an error accessing the data backend.
* @throws EntityExistsException if the user account already exists.
*/
- public void createAccount( User user, String initialPassword )
+ public void createAccount(User user, String password)
throws EntityExistsException, DataBackendException
{
- throw new DataBackendException("PassiveUserManager does not support creting accounts");
+ throw new DataBackendException("PassiveUserManager does not support creating accounts");
}
/**
@@ -223,7 +225,7 @@
* @throws DataBackendException if there was an error accessing the data backend.
* @throws UnknownEntityException if the user account is not present.
*/
- public void removeAccount( User user )
+ public void removeAccount(User user)
throws UnknownEntityException, DataBackendException
{
throw new DataBackendException("PassiveUserManager does not support removing accounts");
@@ -242,7 +244,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void changePassword( User user, String oldPassword, String newPassword )
+ public void changePassword(User user, String oldPassword, String newPassword)
throws PasswordMismatchException, UnknownEntityException,
DataBackendException
{
@@ -264,7 +266,7 @@
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void forcePassword( User user, String password )
+ public void forcePassword(User user, String password)
throws UnknownEntityException, DataBackendException
{
throw new DataBackendException("PassiveUserManager does not support setting passwords");
1.2 +7 -3 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/session/SessionBindingEvent.java
Index: SessionBindingEvent.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/session/SessionBindingEvent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SessionBindingEvent.java 30 May 2002 02:27:34 -0000 1.1
+++ SessionBindingEvent.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -66,12 +66,16 @@
/**
* Returns the name with which the object is bound to or unbound
* from the session.
+ *
+ * @return The name used for binding.
*/
- public String getName();
+ String getName();
/**
* Returns the session to or from which the object is bound or
* unbound.
+ *
+ * @return A session object.
*/
- public Session getSession();
+ Session getSession();
}
1.2 +7 -3 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/session/SessionBindingListener.java
Index: SessionBindingListener.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/session/SessionBindingListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SessionBindingListener.java 30 May 2002 02:27:34 -0000 1.1
+++ SessionBindingListener.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -66,12 +66,16 @@
/**
* Notifies the object that it is being bound to a session and
* identifies the session.
+ *
+ * @param event A SessionBindingEvent object.
*/
- public void valueBound(SessionBindingEvent event);
+ void valueBound(SessionBindingEvent event);
/**
* Notifies the object that it is being unbound from a session and
* identifies the session.
+ *
+ * @param event A SessionBindingEvent object.
*/
- public void valueUnbound(SessionBindingEvent event);
+ void valueUnbound(SessionBindingEvent event);
}
1.2 +2 -2 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/AccessControlException.java
Index: AccessControlException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/AccessControlException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AccessControlException.java 30 May 2002 02:27:34 -0000 1.1
+++ AccessControlException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -69,7 +69,7 @@
*
* @param msg The detail message.
*/
- public AccessControlException( String msg )
+ public AccessControlException(String msg)
{
super(msg);
}
1.3 +19 -28 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/AccessControlList.java
Index: AccessControlList.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/AccessControlList.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AccessControlList.java 8 Jul 2002 23:24:08 -0000 1.2
+++ AccessControlList.java 9 Jul 2002 13:58:19 -0000 1.3
@@ -56,15 +56,10 @@
import java.io.Serializable;
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-
import org.apache.fulcrum.security.entity.Group;
import org.apache.fulcrum.security.entity.Permission;
import org.apache.fulcrum.security.entity.Role;
-import org.apache.fulcrum.security.TurbineSecurity;
/**
* This interface describes a control class that makes it
@@ -91,12 +86,11 @@
* @param group the Group
* @return the set of Roles this user has within the Group.
*/
- RoleSet getRoles( Group group );
+ RoleSet getRoles(Group group);
/**
* Retrieves a set of Roles an user is assigned in the global Group.
*
- * @param group the Group
* @return the set of Roles this user has within the global Group.
*/
RoleSet getRoles();
@@ -107,12 +101,11 @@
* @param group the Group
* @return the set of Permissions this user has within the Group.
*/
- PermissionSet getPermissions( Group group );
+ PermissionSet getPermissions(Group group);
/**
* Retrieves a set of Permissions an user is assigned in the global Group.
*
- * @param group the Group
* @return the set of Permissions this user has within the global Group.
*/
PermissionSet getPermissions();
@@ -124,7 +117,7 @@
* @param group the Group
* @return <code>true</code> if the user is assigned the Role in the Group.
*/
- boolean hasRole( Role role, Group group );
+ boolean hasRole(Role role, Group group);
/**
* Checks if the user is assigned a specific Role in any of the given
@@ -135,7 +128,7 @@
* @return <code>true</code> if the user is assigned the Role in any of
* the given Groups.
*/
- boolean hasRole( Role role, GroupSet groupset );
+ boolean hasRole(Role role, GroupSet groupset);
/**
* Checks if the user is assigned a specific Role in the Group.
@@ -144,7 +137,7 @@
* @param group the Group
* @return <code>true</code> if the user is assigned the Role in the Group.
*/
- boolean hasRole( String role, String group );
+ boolean hasRole(String role, String group);
/**
* Checks if the user is assigned a specifie Role in any of the given
@@ -155,25 +148,23 @@
* @return <code>true</code> if the user is assigned the Role in any of
* the given Groups.
*/
- boolean hasRole( String rolename, GroupSet groupset );
+ boolean hasRole(String rolename, GroupSet groupset);
/**
* Checks if the user is assigned a specific Role in the global Group.
*
* @param role the Role
- * @param group the Group
* @return <code>true</code> if the user is assigned the Role in the global Group.
*/
- public boolean hasRole( Role role );
+ boolean hasRole(Role role);
/**
* Checks if the user is assigned a specific Role in the global Group.
*
* @param role the Role
- * @param group the Group
* @return <code>true</code> if the user is assigned the Role in the global Group.
*/
- public boolean hasRole( String role );
+ boolean hasRole(String role);
/**
* Checks if the user is assigned a specific Permission in the Group.
@@ -182,7 +173,7 @@
* @param group the Group
* @return <code>true</code> if the user is assigned the Permission in the Group.
*/
- public boolean hasPermission( Permission permission, Group group );
+ boolean hasPermission(Permission permission, Group group);
/**
* Checks if the user is assigned a specific Permission in any of the given
@@ -193,7 +184,7 @@
* @return <code>true</code> if the user is assigned the Permission in any
* of the given Groups.
*/
- public boolean hasPermission( Permission permission, GroupSet groupset );
+ boolean hasPermission(Permission permission, GroupSet groupset);
/**
* Checks if the user is assigned a specific Permission in the Group.
@@ -202,7 +193,7 @@
* @param group the Group
* @return <code>true</code> if the user is assigned the Permission in the Group.
*/
- public boolean hasPermission( String permission, String group );
+ boolean hasPermission(String permission, String group);
/**
* Checks if the user is assigned a specific Permission in the Group.
@@ -211,7 +202,7 @@
* @param group the Group
* @return <code>true</code> if the user is assigned the Permission in the Group.
*/
- public boolean hasPermission( String permission, Group group );
+ boolean hasPermission(String permission, Group group);
/**
* Checks if the user is assigned a specifie Permission in any of the given
@@ -222,34 +213,34 @@
* @return <code>true</code> if the user is assigned the Permission in any
* of the given Groups.
*/
- public boolean hasPermission( String permissionName, GroupSet groupset );
+ boolean hasPermission(String permissionName, GroupSet groupset);
/**
* Checks if the user is assigned a specific Permission in the global Group.
*
* @param permission the Permission
- * @param group the Group
* @return <code>true</code> if the user is assigned the Permission in the global Group.
*/
- public boolean hasPermission( Permission permission );
+ boolean hasPermission(Permission permission);
/**
* Checks if the user is assigned a specific Permission in the global Group.
*
* @param permission the Permission
- * @param group the Group
* @return <code>true</code> if the user is assigned the Permission in the global Group.
*/
- public boolean hasPermission( String permission );
+ boolean hasPermission(String permission);
/**
* Returns all groups definded in the system.
*
+ * @return A Group [] of all defined Groups
+ *
* This is useful for debugging, when you want to display all roles
* and permissions an user is assigned. This method is needed
* because you can't call static methods of TurbineSecurity class
* from within WebMacro/Velocity template
*/
- public Group[] getAllGroups();
+ Group [] getAllGroups();
}
1.2 +3 -5 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/DataBackendException.java
Index: DataBackendException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/DataBackendException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataBackendException.java 30 May 2002 02:27:35 -0000 1.1
+++ DataBackendException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -68,10 +68,8 @@
* Construct an DataBackendException with specified detail message.
*
* @param msg The detail message.
- * @param nested the exception or error that caused this exception
- * to be thrown.
*/
- public DataBackendException( String msg )
+ public DataBackendException(String msg)
{
super(msg);
}
@@ -84,7 +82,7 @@
* @param nested the exception or error that caused this exception
* to be thrown.
*/
- public DataBackendException( String msg, Throwable nested )
+ public DataBackendException(String msg, Throwable nested)
{
super(msg, nested);
}
1.2 +2 -2 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/EntityExistsException.java
Index: EntityExistsException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/EntityExistsException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EntityExistsException.java 30 May 2002 02:27:35 -0000 1.1
+++ EntityExistsException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -69,7 +69,7 @@
*
* @param msg The detail message.
*/
- public EntityExistsException( String msg )
+ public EntityExistsException(String msg)
{
super(msg);
}
1.2 +21 -19 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/GroupSet.java
Index: GroupSet.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/GroupSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GroupSet.java 30 May 2002 02:27:35 -0000 1.1
+++ GroupSet.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -56,7 +56,6 @@
import java.io.Serializable;
-import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.TreeSet;
@@ -110,13 +109,14 @@
*/
public boolean add(Group group)
{
- return set.add( (Object)group );
+ return set.add((Object) group);
}
/**
* Adds the Groups in a Collection to this GroupSet.
*
- * @param groupSet A Collection of Groups.
+ * @param groups A Collection of Groups.
+ *
* @return True if this GroupSet changed as a result; false
* if no change to this GroupSet occurred (this GroupSet
* already contained all members of the added GroupSet).
@@ -136,7 +136,7 @@
*/
public boolean add(GroupSet groupSet)
{
- return add((Collection)groupSet.set);
+ return add((Collection) groupSet.set);
}
/**
@@ -148,7 +148,7 @@
*/
public boolean remove(Group group)
{
- return set.remove( (Object)group );
+ return set.remove((Object) group);
}
/**
@@ -168,7 +168,7 @@
*/
public boolean contains(Group group)
{
- return set.contains( (Object)group );
+ return set.contains((Object) group);
}
/**
@@ -182,11 +182,11 @@
public boolean contains(String groupName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Group group = (Group)iter.next();
- if ( groupName != null &&
- groupName.equals( group.getName() ) )
+ Group group = (Group) iter.next();
+ if (groupName != null &&
+ groupName.equals(group.getName()))
{
return true;
}
@@ -205,11 +205,11 @@
public Group getGroup(String groupName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Group group = (Group)iter.next();
- if ( groupName != null &&
- groupName.equals( group.getName() ) )
+ Group group = (Group) iter.next();
+ if (groupName != null &&
+ groupName.equals(group.getName()))
{
return group;
}
@@ -218,17 +218,19 @@
}
/**
- * Returns an Groups[] of Groups in this GroupSet.
+ * Returns an Groups [] of Groups in this GroupSet.
*
- * @return A Group[].
+ * @return A Group [].
*/
- public Group[] getGroupsArray()
+ public Group [] getGroupsArray()
{
- return (Group[])set.toArray(new Group[0]);
+ return (Group []) set.toArray(new Group[0]);
}
/**
* Returns an Iterator for Groups in this GroupSet.
+ *
+ * @return An Iterator for the GroupSet.
*/
public Iterator elements()
{
1.2 +2 -2 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/PasswordMismatchException.java
Index: PasswordMismatchException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/PasswordMismatchException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PasswordMismatchException.java 30 May 2002 02:27:35 -0000 1.1
+++ PasswordMismatchException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -68,7 +68,7 @@
*
* @param msg The detail message.
*/
- public PasswordMismatchException( String msg )
+ public PasswordMismatchException(String msg)
{
super(msg);
}
1.2 +34 -28 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/PermissionSet.java
Index: PermissionSet.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/PermissionSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PermissionSet.java 30 May 2002 02:27:35 -0000 1.1
+++ PermissionSet.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -56,7 +56,6 @@
import java.io.Serializable;
-import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.TreeSet;
@@ -106,19 +105,20 @@
/**
* Adds a Permission to this PermissionSet.
*
- * @param group A Permission.
+ * @param permission A Permission.
* @return True if Permission was added; false if PermissionSet
* already contained the Permission.
*/
public boolean add(Permission permission)
{
- return set.add( (Object)permission );
+ return set.add((Object) permission);
}
/**
* Adds the Permissions in a Collection to this PermissionSet.
*
- * @param permissionSet A Collection of Permissions.
+ * @param permissions A Collection of Permissions.
+ *
* @return True if this PermissionSet changed as a result; false
* if no change to this PermissionSet occurred (this PermissionSet
* already contained all members of the added PermissionSet).
@@ -132,26 +132,27 @@
* Adds the Permissions in another PermissionSet to this
* PermissionSet.
*
- * @param groupSet A PermissionSet.
+ * @param permissionSet A PermissionSet.
+ *
* @return True if this PermissionSet changed as a result; false
* if no change to this PermissionSet occurred (this PermissionSet
* already contained all members of the added PermissionSet).
*/
public boolean add(PermissionSet permissionSet)
{
- return set.addAll( (Collection) permissionSet.set );
+ return set.addAll((Collection) permissionSet.set);
}
/**
* Removes a Permission from this PermissionSet.
*
- * @param group A Permission.
+ * @param permission A Permission.
* @return True if this PermissionSet contained the Permission
* before it was removed.
*/
public boolean remove(Permission permission)
{
- return set.remove( (Object)permission );
+ return set.remove((Object) permission);
}
/**
@@ -165,31 +166,32 @@
/**
* Checks whether this PermissionSet contains a Permission.
*
- * @param group A Permission.
+ * @param permission A Permission.
* @return True if this PermissionSet contains the Permission,
* false otherwise.
*/
public boolean contains(Permission permission)
{
- return set.contains( (Object)permission );
+ return set.contains((Object) permission);
}
/**
* Compares by name a Permission with the Permissions contained in
* this PermissionSet.
*
- * @param groupName Name of Permission.
+ * @param permissionName Name of Permission.
+ *
* @return True if argument matched a Permission in this
* PermissionSet; false if no match.
*/
public boolean contains(String permissionName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Permission permission = (Permission)iter.next();
- if ( permissionName != null &&
- permissionName.equals( ((SecurityEntity)permission).getName() ) )
+ Permission permission = (Permission) iter.next();
+ if (permissionName != null &&
+ permissionName.equals(((SecurityEntity) permission).getName()))
{
return true;
}
@@ -201,18 +203,18 @@
* Returns a Permission with the given name, if it is contained in
* this PermissionSet.
*
- * @param groupName Name of Permission.
+ * @param permissionName Name of Permission.
* @return Permission if argument matched a Permission in this
* PermissionSet; null if no match.
*/
public Permission getPermission(String permissionName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Permission permission = (Permission)iter.next();
- if ( permissionName != null &&
- permissionName.equals( ((SecurityEntity)permission).getName() ) )
+ Permission permission = (Permission) iter.next();
+ if (permissionName != null &&
+ permissionName.equals(((SecurityEntity) permission).getName()))
{
return permission;
}
@@ -221,17 +223,19 @@
}
/**
- * Returns an Permissions[] of Permissions in this PermissionSet.
+ * Returns an Permissions [] of Permissions in this PermissionSet.
*
- * @return A Permission[].
+ * @return A Permission [].
*/
- public Permission[] getPermissionsArray()
+ public Permission [] getPermissionsArray()
{
- return (Permission[])set.toArray(new Permission[0]);
+ return (Permission []) set.toArray(new Permission[0]);
}
/**
* Returns an Iterator for Permissions in this PermissionSet.
+ *
+ * @return An Iterator for this Permission Set.
*/
public Iterator elements()
{
@@ -250,14 +254,16 @@
/**
* list of permission names in this set
+ *
+ * @return A String representation of this Permission Set.
*/
public String toString()
{
- StringBuffer sbuf = new StringBuffer(12*size());
+ StringBuffer sbuf = new StringBuffer(12 * size());
Iterator i = set.iterator();
- while ( i.hasNext() )
+ while (i.hasNext())
{
- sbuf.append(((Permission)i.next()).getName())
+ sbuf.append(((Permission) i.next()).getName())
.append(", ");
}
return sbuf.toString();
1.2 +26 -23 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/RoleSet.java
Index: RoleSet.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/RoleSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RoleSet.java 30 May 2002 02:27:36 -0000 1.1
+++ RoleSet.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -56,13 +56,11 @@
import java.io.Serializable;
-import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.TreeSet;
import org.apache.fulcrum.security.entity.Role;
-import org.apache.fulcrum.security.entity.SecurityEntity;
/**
* This class represents a set of Roles. It makes it easy to build a
@@ -111,13 +109,14 @@
*/
public boolean add(Role role)
{
- return set.add( (Object)role );
+ return set.add((Object) role);
}
/**
* Adds the Roles in a Collection to this RoleSet.
*
- * @param roleSet A Collection of Roles.
+ * @param roles A Collection of Roles.
+ *
* @return True if this RoleSet changed as a result; false
* if no change to this RoleSet occurred (this RoleSet
* already contained all members of the added RoleSet).
@@ -137,7 +136,7 @@
*/
public boolean add(RoleSet roleSet)
{
- return set.add((Collection)roleSet.set);
+ return set.add((Collection) roleSet.set);
}
/**
@@ -149,7 +148,7 @@
*/
public boolean remove(Role role)
{
- return set.remove( (Object)role );
+ return set.remove((Object) role);
}
/**
@@ -169,7 +168,7 @@
*/
public boolean contains(Role role)
{
- return set.contains( (Object)role );
+ return set.contains((Object) role);
}
/**
@@ -183,11 +182,11 @@
public boolean contains(String roleName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Role role = (Role)iter.next();
- if ( roleName != null &&
- roleName.equals( role.getName() ) )
+ Role role = (Role) iter.next();
+ if (roleName != null &&
+ roleName.equals(role.getName()))
{
return true;
}
@@ -206,11 +205,11 @@
public Role getRole(String roleName)
{
Iterator iter = set.iterator();
- while ( iter.hasNext() )
+ while (iter.hasNext())
{
- Role role = (Role)iter.next();
- if ( roleName != null &&
- roleName.equals( role.getName() ) )
+ Role role = (Role) iter.next();
+ if (roleName != null &&
+ roleName.equals(role.getName()))
{
return role;
}
@@ -219,17 +218,19 @@
}
/**
- * Returns an Roles[] of Roles in this RoleSet.
+ * Returns an Roles [] of Roles in this RoleSet.
*
- * @return A Role[].
+ * @return A Role [].
*/
- public Role[] getRolesArray()
+ public Role [] getRolesArray()
{
- return (Role[])set.toArray(new Role[0]);
+ return (Role []) set.toArray(new Role[0]);
}
/**
* Returns an Iterator for Roles in this RoleSet.
+ *
+ * @return An iterator for the RoleSet
*/
public Iterator elements()
{
@@ -248,14 +249,16 @@
/**
* list of role names in this set
+ *
+ * @return The string representation of this RoleSet.
*/
public String toString()
{
- StringBuffer sbuf = new StringBuffer(12*size());
+ StringBuffer sbuf = new StringBuffer(12 * size());
Iterator i = set.iterator();
- while ( i.hasNext() )
+ while (i.hasNext())
{
- sbuf.append(((Role)i.next()).getName())
+ sbuf.append(((Role) i.next()).getName())
.append(", ");
}
return sbuf.toString();
1.2 +3 -3 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/TurbineSecurityException.java
Index: TurbineSecurityException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/TurbineSecurityException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TurbineSecurityException.java 30 May 2002 02:27:36 -0000 1.1
+++ TurbineSecurityException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -70,7 +70,7 @@
*
* @param msg The detail message.
*/
- public TurbineSecurityException( String msg )
+ public TurbineSecurityException(String msg)
{
super(msg);
}
@@ -83,7 +83,7 @@
* @param nested the exception or error that caused this exception
* to be thrown.
*/
- public TurbineSecurityException( String msg, Throwable nested )
+ public TurbineSecurityException(String msg, Throwable nested)
{
super(msg, nested);
}
1.2 +3 -3 jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/UnknownEntityException.java
Index: UnknownEntityException.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/util/UnknownEntityException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- UnknownEntityException.java 30 May 2002 02:27:36 -0000 1.1
+++ UnknownEntityException.java 9 Jul 2002 13:58:19 -0000 1.2
@@ -69,7 +69,7 @@
*
* @param msg The detail message.
*/
- public UnknownEntityException( String msg )
+ public UnknownEntityException(String msg)
{
super(msg);
}
@@ -82,7 +82,7 @@
* @param nested the exception or error that caused this exception
* to be thrown.
*/
- public UnknownEntityException( String msg, Throwable nested )
+ public UnknownEntityException(String msg, Throwable nested)
{
super(msg, nested);
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>