|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.frontend.cli.MCRAbstractCommands
org.mycore.frontend.cli.MCRUserCommands
public class MCRUserCommands
This class provides a set of commands for the org.mycore.user management which can be used by the command line interface.
| Field Summary |
|---|
| Fields inherited from class org.mycore.frontend.cli.MCRAbstractCommands |
|---|
command, CONFIG |
| Constructor Summary | |
|---|---|
MCRUserCommands()
The constructor. |
|
| Method Summary | |
|---|---|
static void |
addMemberUserToGroup(String mbrUserID,
String groupID)
This method adds a user as a member to a group |
static void |
checkConsistency()
This method checks the data consistency of the user management and should be called after a system crash or after importing data from files, respectively. |
static void |
createGroupFromFile(String filename)
This method invokes MCRUserMgr.createGroup() with data from a file. |
static void |
createUserFromFile(String filename)
This method invokes MCRUserMgr.createUser() with data from a file. |
static void |
deleteGroup(String groupID)
This method invokes MCRUserMgr.deleteGroup() and permanently removes a group from the system. |
static void |
deleteUser(String userID)
This method invokes MCRUserMgr.deleteUser() and permanently removes a user from the system. |
static void |
disableUser(String userID)
This method invokes MCRUserMgr.disableUser() that disables a user |
static void |
enableUser(String userID)
This method invokes MCRUserMgr.enableUser() that enables a user |
static void |
encryptPasswordsInXMLFile(String oldFile,
String newFile)
A given XML file containing user data with cleartext passwords must be converted prior to loading the user data into the system. |
static void |
exportAllGroupsToFile(String filename)
This command takes a file name as a parameter, retrieves all groups from MCRUserMgr as JDOM document and export this to the given file. |
static void |
exportAllUsersToFile(String filename)
This command takes a file name as a parameter, retrieves all users from MCRUserMgr as JDOM document and export this to the given file. |
static void |
exportGroupToFile(String groupID,
String filename)
This command takes a groupID and file name as a parameter, retrieves the group from MCRUserMgr as JDOM document and export this to the given file. |
static void |
exportUserToFile(String userID,
String filename)
This command takes a userID and file name as a parameter, retrieves the user from MCRUserMgr as JDOM document and export this to the given file. |
static void |
importUserSystemFromFiles(String groupFileName,
String userFileName)
This method imports groups and user data from XML files. |
static void |
initSuperuser()
This method initializes the user and group system an creates a superuser with values set in mycore.properties.private As 'super' default, if no properties were set, mcradmin with password mycore will be used. |
static void |
listAllGroups()
This method invokes MCRUserMgr.getAllGroupIDs() and retrieves a ArrayList of all groups stored in the persistent datastore. |
static void |
listAllUsers()
This method invokes MCRUserMgr.getAllUserIDs() and retrieves a ArrayList of all users stored in the persistent datastore. |
static void |
listGroup(String groupID)
This method invokes MCRUserMgr.retrieveGroup() and then works with the retrieved group object to get an XML-Representation. |
static void |
listUser(String userID)
This method invokes MCRUserMgr.retrieveUser() and then works with the retrieved user object to get an XML-Representation. |
static void |
removeMemberUserFromGroup(String mbrUserID,
String groupID)
This method removes a member user from a group |
static void |
setLock()
This method sets the user management component to read only mode |
static void |
setPassword(String userID,
String password)
This method invokes MCRUserMgr.retrieveUser() and then works with the retrieved user object to change the password. |
static void |
unLock()
This method sets the user management component to read/write access mode |
static void |
updateUserFromFile(String filename)
This method invokes MCRUserMgr.updateUser() with data from a file. |
| Methods inherited from class org.mycore.frontend.cli.MCRAbstractCommands |
|---|
getPossibleCommands |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MCRUserCommands()
| Method Detail |
|---|
public static void initSuperuser()
throws MCRException
MCRException
public static void checkConsistency()
throws Exception
Exception
public static void deleteGroup(String groupID)
throws Exception
groupID - the ID of the group which will be deleted
Exception
public static void deleteUser(String userID)
throws Exception
userID - the ID of the user which will be deleted
Exception
public static void enableUser(String userID)
throws Exception
userID - the ID of the user which will be enabled
Exception
public static final void encryptPasswordsInXMLFile(String oldFile,
String newFile)
throws MCRException
oldFile - the filename of the user data inputnewFile - the filename of the user data output (encrypted passwords)
MCRException
public static void disableUser(String userID)
throws Exception
userID - the ID of the user which will be enabled
Exception
public static void listAllUsers()
throws Exception
Exception
public static void listAllGroups()
throws Exception
Exception
public static void exportAllGroupsToFile(String filename)
throws MCRException
filename - Name of the file in this the groups will be exported
MCRException
public static void exportAllUsersToFile(String filename)
throws MCRException
filename - Name of the file in this the users will be exported
MCRException
public static void exportGroupToFile(String groupID,
String filename)
throws Exception
groupID - ID of the group to be savedfilename - Name of the file to store the exported group
Exception
public static void exportUserToFile(String userID,
String filename)
throws MCRException
userID - ID of the user to be savedfilename - Name of the file to store the exported user
MCRException
public static void setPassword(String userID,
String password)
throws MCRException
userID - the ID of the user for which the password will be set
MCRException
public static void setLock()
throws MCRException
MCRException
public static void unLock()
throws MCRException
MCRException
public static final void listGroup(String groupID)
throws MCRException
groupID - the ID of the group for which the XML-representation is needed
MCRException
public static final void listUser(String userID)
throws MCRException
userID - the ID of the user for which the XML-representation is needed
MCRExceptionpublic static final void createUserFromFile(String filename)
filename - the filename of the user data input
public static final void createGroupFromFile(String filename)
throws MCRException
filename - the filename of the user data input
MCRException
public static final void importUserSystemFromFiles(String groupFileName,
String userFileName)
throws MCRException
groupFileName - the filename of the group data inputuserFileName - the filename of the user data input
MCRExceptionpublic static final void updateUserFromFile(String filename)
filename - the filename of the user data input
public static final void addMemberUserToGroup(String mbrUserID,
String groupID)
throws MCRException
mbrUserID - the ID of the user which will be a member of the group
represented by groupIDgroupID - the ID of the group to which the user with ID mbrUserID will
be added
MCRException
public static final void removeMemberUserFromGroup(String mbrUserID,
String groupID)
throws MCRException
mbrUserID - the ID of the user which will be removed from the group
represented by groupIDgroupID - the ID of the group from which the user with ID mbrUserID will
be removed
MCRException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||