com.sun.electric.tool.project
Class Users

java.lang.Object
  extended by com.sun.electric.tool.project.Users

public class Users
extends java.lang.Object

This is the user management part of the Project Management tool.


Field Summary
static boolean LOWSECURITY
          There are two levels of security: low and medium.
 
Constructor Summary
Users()
           
 
Method Summary
static void addUser(java.lang.String user, java.lang.String encryptedPassword)
          Method to add a user to the user database.
static void changeEncryptedPassword(java.lang.String user, java.lang.String newEncryptedPassword)
          Method to change a user's encrypted password.
static void deleteUser(java.lang.String user)
          Method to remove a user name from the user database.
static java.lang.String encryptPassword(java.lang.String text)
          Method to encrypt a string in the most simple of ways.
static java.lang.String getEncryptedPassword(java.lang.String user)
          Method to return the encrypted password associated with a given user.
static int getNumUsers()
          Method to return the number of users in the user database.
static java.util.Iterator<java.lang.String> getUsers()
          Method to return an Iterator over the users in the user database.
static boolean isExistingUser(java.lang.String user)
          Method to tell whether a user name is in the user database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOWSECURITY

public static final boolean LOWSECURITY
There are two levels of security: low and medium. Medium security manages a list of user names/passwords and requires logging-in. It is only "medium" becuase the passwords are badly encrypted, and it is easy to add user names. Low security simply uses the user's name without questioning it.

See Also:
Constant Field Values
Constructor Detail

Users

public Users()
Method Detail

getNumUsers

public static int getNumUsers()
Method to return the number of users in the user database.

Returns:
the number of users in the user database.

getUsers

public static java.util.Iterator<java.lang.String> getUsers()
Method to return an Iterator over the users in the user database.

Returns:
an Iterator over the users in the user database.

isExistingUser

public static boolean isExistingUser(java.lang.String user)
Method to tell whether a user name is in the user database.

Parameters:
user - the user name.
Returns:
true if the user name is in the user database.

deleteUser

public static void deleteUser(java.lang.String user)
Method to remove a user name from the user database.

Parameters:
user - the user name to remove from the user database.

addUser

public static void addUser(java.lang.String user,
                           java.lang.String encryptedPassword)
Method to add a user to the user database.

Parameters:
user - the user name to add.
encryptedPassword - the encrypted password for the user.

getEncryptedPassword

public static java.lang.String getEncryptedPassword(java.lang.String user)
Method to return the encrypted password associated with a given user.

Parameters:
user - the user name.
Returns:
the user's encrypted password (null if not found).

changeEncryptedPassword

public static void changeEncryptedPassword(java.lang.String user,
                                           java.lang.String newEncryptedPassword)
Method to change a user's encrypted password.

Parameters:
user - the user name.
newEncryptedPassword - the new encrypted password for the user.

encryptPassword

public static java.lang.String encryptPassword(java.lang.String text)
Method to encrypt a string in the most simple of ways. A one-rotor machine designed along the lines of Enigma but considerably trivialized.

Parameters:
text - the text to encrypt.
Returns:
an encrypted version of the text.