|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wiki.auth.authorize.XMLGroupDatabase
public class XMLGroupDatabase
GroupDatabase implementation for loading, persisting and storing wiki groups,
using an XML file for persistence. Group entries are simple
<group>
elements under the root. Each group member is
representated by a <member>
element. For example:
<groups>
<group name="TV" created="Jun 20, 2006 2:50:54 PM" lastModified="Jan 21, 2006 2:50:54 PM">
<member principal="Archie Bunker" />
<member principal="BullwinkleMoose" />
<member principal="Fred Friendly" />
</group>
<group name="Literature" created="Jun 22, 2006 2:50:54 PM" lastModified="Jan 23, 2006 2:50:54 PM">
<member principal="Charles Dickens" />
<member principal="Homer" />
</group>
</groups>
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
static String |
PROP_DATABASE
The jspwiki.properties property specifying the file system location of the group database. |
Constructor Summary | |
---|---|
XMLGroupDatabase()
|
Method Summary | |
---|---|
void |
commit()
Deprecated. there is no need to call this method because the save and delete methods contain their own commit logic |
void |
delete(Group group)
Looks up and deletes a Group from the group database. |
Group[] |
groups()
Returns all wiki groups that are stored in the GroupDatabase as an array of Group objects. |
void |
initialize(WikiEngine engine,
Properties props)
Initializes the group database based on values from a Properties object. |
void |
save(Group group,
Principal modifier)
Saves a Group to the group database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger log
public static final String PROP_DATABASE
Constructor Detail |
---|
public XMLGroupDatabase()
Method Detail |
---|
public void commit() throws WikiSecurityException
save(Group, Principal)
and delete(Group)
methods
are atomic themselves.
commit
in interface GroupDatabase
WikiSecurityException
- never...public void delete(Group group) throws WikiSecurityException
Group
from the group database. If the
group database does not contain the supplied Group. this method throws a
NoSuchPrincipalException
. The method commits the results
of the delete to persistent storage.
delete
in interface GroupDatabase
group
- the group to remove
WikiSecurityException
- if the database does not contain the
supplied group (thrown as NoSuchPrincipalException
) or if
the commit did not succeedpublic Group[] groups() throws WikiSecurityException
groups
in interface GroupDatabase
WikiSecurityException
- if the groups cannot be returned by the back-endpublic void initialize(WikiEngine engine, Properties props) throws NoRequiredPropertyException, WikiSecurityException
PROP_DATABASE
.
initialize
in interface GroupDatabase
engine
- the wiki engineprops
- the properties used to initialize the group database
NoRequiredPropertyException
- if the user database cannot be
located, parsed, or opened
WikiSecurityException
- if the database could not be initialized successfullypublic void save(Group group, Principal modifier) throws WikiSecurityException
IllegalArgumentException
, if the
proposed group is the same name as one of the built-in Roles: e.g.,
Admin, Authenticated, etc. The database is responsible for setting
create/modify timestamps, upon a successful save, to the Group.
The method commits the results of the delete to persistent storage.
save
in interface GroupDatabase
group
- the Group to savemodifier
- the user who saved the Group
WikiSecurityException
- if the Group could not be saved successfully
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |