|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.edu.swin.synergy.plugin.userman.BUserManCLTools
This provides command tools for reading user and group information from the command line
Constructor Summary | |
BUserManCLTools(BUserMan userManager)
Creates a new tools object with the user maanger to communicate with. |
Method Summary | |
protected boolean |
doAdminCheck(boolean displayMessage)
This method will check to see if the currently logged in user is an administrator and if not display a message indicating that they do not have the required permission to perform the current operation. |
protected boolean |
doConfirm(String question,
InputStream in,
PrintStream out)
This will prompt the user for confirmation as to whether they wish to go through with the current operation and return true or false depending on their response. |
protected int |
doGetInt(String prompt,
InputStream in,
PrintStream out,
boolean nonNull,
int lowerLimit,
int upperLimit)
This will read an integer from user and make sure that the value they type is a valid integer. |
protected String |
doGetString(String prompt,
boolean nonNull,
InputStream in,
PrintStream out)
This will prompt the user with the given message and return their response. |
protected void |
doInitialisation()
This will make sure that the users and groups have been set initially. |
protected void |
doMessageSend(String message,
int messageType)
Provides a means of sending a message to standard out in a common place rather than re-writing everything. |
protected boolean |
doOwnerCheck(String userName,
boolean displayMessage)
This method will check to see whether the current user is the owner of the given user name |
protected void |
doShowAll(Vector items,
PrintStream out)
This will run through and display the names of all the BPrivileged items in the given Vector |
protected Vector |
getMembers(Vector members,
InputStream in,
PrintStream out)
This method will prompt the user to select the groups this new user should be a member of by displaying the options and reading in the users responses. |
protected String |
getPrivilege(BPrivileged item)
This will get the privilege from the given privileged item and return a String representing it in human readable format. |
protected BPrivileged |
getPrivileged(String name,
Vector list)
This will find the privileged item in the given list with the name provided and return it. |
protected void |
setInitialised(boolean initialised)
Allows the other plugins to indicate when they have been initialised. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public BUserManCLTools(BUserMan userManager)
userManager
- The user manager to queryMethod Detail |
protected void doShowAll(Vector items, PrintStream out)
items
- A list of BPrivileged items to be displayedprotected BPrivileged getPrivileged(String name, Vector list)
name
- The name of the item to returnlist
- The list to search throughprotected void doInitialisation()
protected void setInitialised(boolean initialised)
initialised
- True to indicate initialised, false otherwiseprotected Vector getMembers(Vector members, InputStream in, PrintStream out) throws IOException
members
- The available members to select fromin
- The input stream to read fromout
- The output stream to write toprotected String doGetString(String prompt, boolean nonNull, InputStream in, PrintStream out) throws IOException
If the user presses enter without giving a value, it will re-prompt them
prompt
- protected int doGetInt(String prompt, InputStream in, PrintStream out, boolean nonNull, int lowerLimit, int upperLimit) throws IOException
prompt
- The text to display to the userin
- The input stream to read fromout
- The output stream to write tononNull
- Indicates whether the response can be nothinglowerLimit
- The minimum value the user can enterupperLimit
- The maximum value the user can enterprotected boolean doConfirm(String question, InputStream in, PrintStream out) throws IOException
in
- The input stream to read fromout
- The output stream to write toprotected void doMessageSend(String message, int messageType)
message
- The message to sendmessageType
- The message type BStandardOutCE.kWarning, BStandardOutCE.kError, BStandardOutCE.kInfo, BStandardOutCE.kDefaultOptionprotected boolean doAdminCheck(boolean displayMessage)
out
- Indicates whether to display an error message or notprotected boolean doOwnerCheck(String userName, boolean displayMessage)
username
- The user to checkdisplayMessage
- Indicates whether or not to display the errorprotected String getPrivilege(BPrivileged item)
item
- The privileged item to get the privilege of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |