git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[utils]
/
security
/
impl
/
src
/
main
/
java
/
org
/
wamblee
/
security
/
authentication
/
UserAdministration.java
diff --git
a/security/impl/src/main/java/org/wamblee/security/authentication/UserAdministration.java
b/security/impl/src/main/java/org/wamblee/security/authentication/UserAdministration.java
index 321481d0d79313b5035131c7f41eac8272449792..7ed58086f5083a3532e34937552be296fb9bcab0 100644
(file)
--- a/
security/impl/src/main/java/org/wamblee/security/authentication/UserAdministration.java
+++ b/
security/impl/src/main/java/org/wamblee/security/authentication/UserAdministration.java
@@
-15,7
+15,7
@@
*/
package org.wamblee.security.authentication;
*/
package org.wamblee.security.authentication;
-import java.util.
Se
t;
+import java.util.
Lis
t;
/**
* Interface for user administration. Manages the users and groups.
/**
* Interface for user administration. Manages the users and groups.
@@
-30,16
+30,13
@@
public interface UserAdministration {
* Username.
* @param aPassword
* Password.
* Username.
* @param aPassword
* Password.
- * @param aGroup
- * Group.
*
* @return User.
*
* @throws UserMgtException
* In case there is a conflict with an existing user.
*/
*
* @return User.
*
* @throws UserMgtException
* In case there is a conflict with an existing user.
*/
- User createUser(String aUser, String aPassword, Group aGroup)
- throws UserMgtException;
+ void createUser(String aUser, String aPassword);
/**
* Creates a new group.
/**
* Creates a new group.
@@
-52,63
+49,88
@@
public interface UserAdministration {
* @throws UserMgtException
* In case there is a conflict with an existing group.
*/
* @throws UserMgtException
* In case there is a conflict with an existing group.
*/
- Group createGroup(String aName) throws UserMgtException;
-
+ void createGroup(String aName);
+
+ /**
+ * Checks if a user exists.
+ * @param aUser User to check.
+ * @return True iff user exists.
+ */
+ boolean checkUser(String aUser);
+
+
/**
/**
+ * Check if a group exists.
+ * @param aGroup Group.
+ * @return True iff group exists.
+ */
+ boolean checkGroup(String aGroup);
+
+ /**
+ * Checks the password.
*
*
- * @return Number of users.
+ * @param aUser
+ * User to check password for.
+ * @param aPassword
+ * Password to check.
+ * @throws UserMgtException In case user does not exist.
+ * @return True iff password is ok.
*/
*/
-
int getUserCount(
);
+
boolean checkPassword(String aUser, String aPassword
);
/**
/**
+ * Changes the password.
*
*
- * @return Number of groups.
+ * @param aUser
+ * User.
+ * @param aOldPassword
+ * Old password.
+ * @param aNewPassword
+ * New password.
+ *
+ * @throws UserMgtException Inc ase the user does not exist.
+ * @return True if the password was changed.
*/
*/
-
int getGroupCount(
);
+
boolean changePassword(String aUser, String aOldPassword, String aNewPassword
);
/**
/**
- * Must be called when the user is modified.
*
* @param aUser
* User.
*
* @param aUser
* User.
- * @return The modified user. The user passed in to this call should be considered invalid.
+ * @param aPassword
+ * The password to set.
+ *
+ * @throws UserMgtException Inc ase the user does not exist.
*/
*/
- void
userModified(User aUser
);
+ void
setPassword(String aUser, String aPassword
);
/**
/**
- * Must be called when the group is modified.
- *
- * @param aGroup
- * Group.
+ * Checks if the user belongs to the given group.
+ * @param aUser User
+ * @param aGroup Group.
+ * @return True iff user is in group
+ * @throws UserMgtException In case the user or group do not exist.
*/
*/
- void groupModified(Group aGroup);
+ boolean isInGroup(String aUser, String aGroup);
/**
/**
- * Gets the user for a given name.
- *
- * @param aName
- * User name.
*
*
- * @return
User or null if not found
.
+ * @return
Number of users
.
*/
*/
-
User getUser(String aName
);
+
int getUserCount(
);
/**
/**
- * Gets the group for a given group name.
- *
- * @param aName
- * Group name.
*
*
- * @return
Group or null if not found
.
+ * @return
Number of groups
.
*/
*/
-
Group getGroup(String aName
);
+
int getGroupCount(
);
/**
* Get the users.
*
* @return All known users.
*/
/**
* Get the users.
*
* @return All known users.
*/
-
Set<User
> getUsers();
+
List<String
> getUsers();
/**
* Gets the users for a given group.
/**
* Gets the users for a given group.
@@
-117,20
+139,28
@@
public interface UserAdministration {
* Group.
* @return Set of users (always non-null).
*/
* Group.
* @return Set of users (always non-null).
*/
-
Set<User> getUsers(Group
aGroup);
+
List<String> getUsers(String
aGroup);
/**
/**
- * Gets all
known
groups.
+ * Gets all groups.
*
* @return Groups.
*/
*
* @return Groups.
*/
-
Set<Group
> getGroups();
+
List<String
> getGroups();
+ /**
+ * Gets all groups for a given user.
+ *
+ * @param aUser user.
+ * @return Groups.
+ */
+ List<String> getGroups(String aUser);
+
/**
* Renames a user.
*
/**
* Renames a user.
*
- * @param a
User
- *
User object for which user name must be changed
.
+ * @param a
OldUserName
+ *
Current user name
.
* @param aUserName
* New user name.
*
* @param aUserName
* New user name.
*
@@
-138,7
+168,7
@@
public interface UserAdministration {
* In case the user is not known or the new user name is already
* in use by another user.
*/
* In case the user is not known or the new user name is already
* in use by another user.
*/
- void renameUser(
User aUser, String aUserName) throws UserMgtException
;
+ void renameUser(
String aOldUserName, String aUserName)
;
/**
* Renames a group.
/**
* Renames a group.
@@
-152,7
+182,7
@@
public interface UserAdministration {
* In case the new group name is already used by another group
* of if the existing group is unknown.
*/
* In case the new group name is already used by another group
* of if the existing group is unknown.
*/
- void renameGroup(
Group aGroup, String aGroupName) throws UserMgtException
;
+ void renameGroup(
String aOldGroup, String aGroupName)
;
/**
* Removes the user.
/**
* Removes the user.
@@
-163,7
+193,7
@@
public interface UserAdministration {
* @throws UserMgtException
* In case the user does not exist.
*/
* @throws UserMgtException
* In case the user does not exist.
*/
- void removeUser(
User aUser) throws UserMgtException
;
+ void removeUser(
String aUser)
;
/**
* Removes the group.
/**
* Removes the group.
@@
-174,7
+204,7
@@
public interface UserAdministration {
* @throws UserMgtException
* In case there are still users that are in the given group.
*/
* @throws UserMgtException
* In case there are still users that are in the given group.
*/
- void removeGroup(
Group aGroup) throws UserMgtException
;
+ void removeGroup(
String aGroup)
;
/**
* Adds a user to a group.
/**
* Adds a user to a group.
@@
-188,7
+218,7
@@
public interface UserAdministration {
* In case the user or group or not known or if the user is
* already part of the group.
*/
* In case the user or group or not known or if the user is
* already part of the group.
*/
- void addUserToGroup(
User aUser, Group aGroup) throws UserMgtException
;
+ void addUserToGroup(
String aUser, String aGroup)
;
/**
* Removes a user from a group.
/**
* Removes a user from a group.
@@
-202,5
+232,5
@@
public interface UserAdministration {
* In case the user or group are unknown or if the user is not
* part of the group.
*/
* In case the user or group are unknown or if the user is not
* part of the group.
*/
- void removeUserFromGroup(
User aUser, Group aGroup) throws UserMgtException
;
+ void removeUserFromGroup(
String aUser, String aGroup)
;
}
}