|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.anwrt.anycontent.plugins.core.group.AbstractGroupManager
com.anwrt.anycontent.plugins.core.group.DefaultGroupManager
Standard implementation of the group manager from the core database.
| Field Summary | |
protected static java.lang.String |
__GROUP_TABLE
Name of the table group. |
protected static java.lang.String |
__ID_GROUP_COL
Name of the column for group id in the table group. |
protected static java.lang.String |
__ID_USER_GROUP_COL
Name of the column for group id in the table group/user. |
protected static java.lang.String |
__LABEL_COL
Name of the column for group label. |
protected static java.lang.String |
__LOGIN_COL
Name of the column for user's login. |
protected static java.lang.String |
__USER_GROUP_TABLE
Name of the table group/user. |
protected java.util.List |
_listeners
Group listeners |
protected Logger |
_logger
Logger for traces. |
| Fields inherited from class com.anwrt.anycontent.plugins.core.group.AbstractGroupManager |
__GROUP_ID_ATTR, __GROUP_LABEL_TAG, __GROUP_TAG, __ROOT_TAG, __USER_TAG, __USERS_TAG |
| Constructor Summary | |
DefaultGroupManager()
|
|
| Method Summary | |
protected void |
_cleanup(java.sql.Connection con,
java.sql.Statement stmt,
java.sql.ResultSet rs)
Clean a connection to the database by closing all resources. |
protected void |
_fillGroup(UserGroup group,
java.sql.Connection connection)
Fill users set in a group. |
protected java.sql.Connection |
_getConnection()
Get the connection pool. |
UserGroup |
add(java.lang.String name)
Add a new group of users. |
void |
configure(Configuration configuration)
Configure an extension with its parameters. |
UserGroup |
getGroup(java.lang.String groupID)
Returns a particular group. |
java.util.Set |
getGroups()
Returns all groups. |
java.util.List |
getListeners()
Get the list of user listeners |
java.util.Set |
getUserGroups(java.lang.String login)
Get all groups a particular is in. |
void |
initialize()
Initialize the plugin with deploy parameters. |
void |
onAddUser(java.lang.String login)
When an user is added |
void |
onModifyUser(java.lang.String login)
When an user is modify |
void |
onRemoveUser(java.lang.String login)
When an user is deleted |
void |
registerListener(GroupListener listener)
Registers an user listener |
void |
remove(java.lang.String groupID)
Remove a group of users. |
void |
removeListener(GroupListener listener)
Removes an user listener |
void |
removeUserGroups(java.lang.String login)
Removes all groups associated with a user |
void |
update(UserGroup userGroup)
Modify an existing group of users. |
| Methods inherited from class com.anwrt.anycontent.plugins.core.group.AbstractGroupManager |
toSAX |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.anwrt.anycontent.extensions.group.GroupManager |
toSAX |
| Field Detail |
protected static final java.lang.String __GROUP_TABLE
protected static final java.lang.String __USER_GROUP_TABLE
protected static final java.lang.String __ID_GROUP_COL
protected static final java.lang.String __LABEL_COL
protected static final java.lang.String __ID_USER_GROUP_COL
protected static final java.lang.String __LOGIN_COL
protected Logger _logger
protected java.util.List _listeners
| Constructor Detail |
public DefaultGroupManager()
| Method Detail |
public void configure(Configuration configuration)
throws ConfigurationException
GroupManager
configure in interface GroupManagerconfiguration - The configuration.
ConfigurationExceptionpublic java.util.List getListeners()
ModifiableGroupManager
getListeners in interface ModifiableGroupManagerpublic void registerListener(GroupListener listener)
ModifiableGroupManager
registerListener in interface ModifiableGroupManagerlistener - the user listenerpublic void removeListener(GroupListener listener)
ModifiableGroupManager
removeListener in interface ModifiableGroupManagerlistener - the user listenerpublic void initialize()
GroupManager
initialize in interface GroupManagerpublic UserGroup getGroup(java.lang.String groupID)
GroupManager
getGroup in interface GroupManagergroupID - The id of the group.
public java.util.Set getGroups()
GroupManager
getGroups in interface GroupManagerpublic java.util.Set getUserGroups(java.lang.String login)
GroupManager
getUserGroups in interface GroupManagerlogin - The login of the user.
public void removeUserGroups(java.lang.String login)
login - the login of the userpublic void onAddUser(java.lang.String login)
UserListener
onAddUser in interface UserListenerlogin - the user's loginpublic void onModifyUser(java.lang.String login)
UserListener
onModifyUser in interface UserListenerlogin - the user's loginpublic void onRemoveUser(java.lang.String login)
UserListener
onRemoveUser in interface UserListenerlogin - the user's login
protected void _fillGroup(UserGroup group,
java.sql.Connection connection)
throws java.sql.SQLException
group - The group to fill.connection - The SQL connection.
java.sql.SQLException - If a problem occurs.protected java.sql.Connection _getConnection()
protected void _cleanup(java.sql.Connection con,
java.sql.Statement stmt,
java.sql.ResultSet rs)
con - The connection to the database to close.stmt - The statement to close.rs - The result set to close.
public UserGroup add(java.lang.String name)
throws InvalidModificationException
ModifiableGroupManager
add in interface ModifiableGroupManagername - The name of the user group to create
InvalidModificationException - if the group id exists yet or
if at least one of the parameter is invalid.
public void remove(java.lang.String groupID)
throws InvalidModificationException
ModifiableGroupManager
remove in interface ModifiableGroupManagergroupID - The id of the group.
InvalidModificationException - if the group id does not exists.
public void update(UserGroup userGroup)
throws InvalidModificationException
ModifiableGroupManager
update in interface ModifiableGroupManageruserGroup - Informations about the new group.
InvalidModificationException - if the group id does not exists yet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||