|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.loco.perm.Permission
Creates and maintains a single atomic permission. Also contains a cache for all the permissions presently in the database, and methods to access it, as well as methods to create and remove new permissions.
Field Summary | |
static int |
DB_TYPE
|
Constructor Summary | |
Permission(java.sql.Connection conn,
java.lang.String name)
Loads the permission object with the given name from the database, and puts it in the cache. |
|
Permission(java.lang.String name,
int id)
Creates a permission associated by a name and id. |
Method Summary | |
static Permission |
createPermission(java.sql.Connection conn,
java.lang.String name)
Creates a new permission and puts it in the cache. |
static void |
deletePermission(java.sql.Connection conn,
java.lang.String perm_name)
deletes the permission with the specified name from the database |
static boolean |
exists(java.lang.String permName)
Checks the existence of a permission in the cache. |
static Permission |
get(java.lang.String permName)
Retrieves a permission from the permissions cache. |
int |
getId()
Returns the id of the permission. |
java.lang.String |
getName()
Returns the name of the permission. |
static java.util.Vector |
getPermissions(java.sql.Connection conn)
Returns all the permissions currently available. |
static int |
getSize()
Returns the number of permissions currently in the cache |
static void |
initializeCache(java.sql.Connection conn)
Reads permissions from the database and puts them into the permission hash. |
static java.util.Vector |
names()
Returns an Vector of all permission names presently in the cache. |
static java.util.Enumeration |
permissions()
Returns an enumeration of all the permissions currently in the cache |
static void |
reloadCache(java.sql.Connection conn)
Reloads the permissions from the database. |
java.lang.String |
toString()
Method for displaying permissions- prints only the name |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static int DB_TYPE
Constructor Detail |
public Permission(java.lang.String name, int id)
name
- String name of the permissionid
- int id of the permissionpublic Permission(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLException
get(java.lang.String)
Method Detail |
public java.lang.String getName()
public int getId()
public static void initializeCache(java.sql.Connection conn) throws java.sql.SQLException
conn
- Connection object to the databasepublic static void reloadCache(java.sql.Connection conn) throws java.sql.SQLException
conn
- the Database connection objectpublic static Permission get(java.lang.String permName)
permName
- String name of the permission to be retrievedpublic static boolean exists(java.lang.String permName)
permName
- String name of the permissionpublic static int getSize()
public static java.util.Enumeration permissions()
public static java.util.Vector names()
public static java.util.Vector getPermissions(java.sql.Connection conn) throws java.sql.SQLException
public static Permission createPermission(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLException
public static void deletePermission(java.sql.Connection conn, java.lang.String perm_name) throws java.sql.SQLException
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |