org.mycore.user
Interface MCRUserStore

All Known Implementing Classes:
MCRHIBUserStore

public interface MCRUserStore

The purpose of this interface is to make the choice of the persistence layer configurable. Any concrete database-class which stores MyCoRe user, group and privilege information must implement this interface. Which database actually will be used can then be configured by reading the value MCR.Persistence.User.Store.Class from mycore.properties.

Version:
$Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
Author:
Detlev Degenhardt

Method Summary
 void createGroup(MCRGroup newGroup)
          This method creates a MyCoRe group object in the persistent datastore.
 void createUser(MCRUser newUser)
          This method creates a MyCoRe user object in the persistent datastore.
 void deleteGroup(String delGroupID)
          This method deletes a MyCoRe group object in the persistent datastore.
 void deleteUser(String delUserID)
          This method deletes a MyCoRe user object in the persistent datastore.
 boolean existsGroup(String groupID)
          This method tests if a MyCoRe group object is available in the persistent datastore.
 boolean existsUser(int numID, String userID)
          This method tests if a MyCoRe user object is available in the persistent datastore.
 boolean existsUser(String userID)
          This method tests if a MyCoRe user object is available in the persistent datastore.
 List<String> getAllGroupIDs()
          This method gets all group IDs and returns them as a ArrayList of strings.
 List<String> getAllUserIDs()
          This method gets all user IDs and returns them as a ArrayList of strings.
 List<String> getGroupIDsWithAdminUser(String userID)
          This method gets all group IDs where a given user ID can manage the group (i.e.
 int getMaxUserNumID()
          This method returns the maximum value of the numerical user IDs
 List<String> getUserIDsWithPrimaryGroup(String groupID)
          This method gets all user IDs with a given primary group and returns them as a ArrayList of strings.
 MCRGroup retrieveGroup(String groupID)
          This method retrieves a MyCoRe group object from the persistent datastore.
 MCRUser retrieveUser(String userID)
          This method retrieves a MyCoRe user object from the persistent datastore.
 void updateGroup(MCRGroup group)
          This method updates a MyCoRe group object in the persistent datastore.
 void updateUser(MCRUser user)
          This method updates a MyCoRe user object in the persistent datastore.
 

Method Detail

createUser

void createUser(MCRUser newUser)
                throws MCRException
This method creates a MyCoRe user object in the persistent datastore.

Parameters:
newUser - the new user object to be stored
Throws:
MCRException

createGroup

void createGroup(MCRGroup newGroup)
                 throws MCRException
This method creates a MyCoRe group object in the persistent datastore.

Parameters:
newGroup - the new group object to be stored
Throws:
MCRException

deleteUser

void deleteUser(String delUserID)
                throws MCRException
This method deletes a MyCoRe user object in the persistent datastore.

Parameters:
delUserID - a String representing the MyCoRe user object which is to be deleted
Throws:
MCRException

deleteGroup

void deleteGroup(String delGroupID)
                 throws MCRException
This method deletes a MyCoRe group object in the persistent datastore.

Parameters:
delGroupID - a String representing the MyCoRe group object which is to be deleted
Throws:
MCRException

existsUser

boolean existsUser(String userID)
                   throws MCRException
This method tests if a MyCoRe user object is available in the persistent datastore.

Parameters:
userID - a String representing the MyCoRe user object which is to be looked for
Throws:
MCRException

existsUser

boolean existsUser(int numID,
                   String userID)
                   throws MCRException
This method tests if a MyCoRe user object is available in the persistent datastore. The numerical userID is taken into account, too.

Parameters:
numID - (int) numerical userID of the MyCoRe user object
userID - a String representing the MyCoRe user object which is to be looked for
Throws:
MCRException

existsGroup

boolean existsGroup(String groupID)
                    throws MCRException
This method tests if a MyCoRe group object is available in the persistent datastore.

Parameters:
groupID - a String representing the MyCoRe group object which is to be looked for
Throws:
MCRException

getAllUserIDs

List<String> getAllUserIDs()
                           throws MCRException
This method gets all user IDs and returns them as a ArrayList of strings.

Returns:
ArrayList of strings including the user IDs of the system
Throws:
MCRException

getAllGroupIDs

List<String> getAllGroupIDs()
                            throws MCRException
This method gets all group IDs and returns them as a ArrayList of strings.

Returns:
ArrayList of strings including the group IDs of the system
Throws:
MCRException

getMaxUserNumID

int getMaxUserNumID()
                    throws MCRException
This method returns the maximum value of the numerical user IDs

Returns:
maximum value of the numerical user IDs
Throws:
MCRException

getGroupIDsWithAdminUser

List<String> getGroupIDsWithAdminUser(String userID)
                                      throws MCRException
This method gets all group IDs where a given user ID can manage the group (i.e. is in the administrator user IDs list) as a ArrayList of strings.

Parameters:
userID - a String representing the administrative user
Returns:
ArrayList of strings including the group IDs of the system which have userID in their administrators list
Throws:
MCRException

getUserIDsWithPrimaryGroup

List<String> getUserIDsWithPrimaryGroup(String groupID)
                                        throws MCRException
This method gets all user IDs with a given primary group and returns them as a ArrayList of strings.

Parameters:
groupID - a String representing a primary Group
Returns:
ArrayList of strings including the user IDs of the system which have groupID as primary group
Throws:
MCRException

retrieveUser

MCRUser retrieveUser(String userID)
                     throws MCRException
This method retrieves a MyCoRe user object from the persistent datastore.

Parameters:
userID - a String representing the MyCoRe user object which is to be retrieved
Returns:
the requested user object
Throws:
MCRException

retrieveGroup

MCRGroup retrieveGroup(String groupID)
                       throws MCRException
This method retrieves a MyCoRe group object from the persistent datastore.

Parameters:
groupID - a String representing the MyCoRe group object which is to be retrieved
Returns:
the requested group object
Throws:
MCRException

updateGroup

void updateGroup(MCRGroup group)
                 throws MCRException
This method updates a MyCoRe group object in the persistent datastore.

Parameters:
group - the group to be updated
Throws:
MCRException

updateUser

void updateUser(MCRUser user)
                throws MCRException
This method updates a MyCoRe user object in the persistent datastore.

Parameters:
user - the user to be updated
Throws:
MCRException