|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.beasys.commerce.axiom.contact.security.GroupCache
This class is responsible for creating and maintaining a pre-calculated cache of group membership information. It can be used to speed up group membership lookups in a system with a deep group hierarchy.
Field Summary | |
protected static java.lang.String |
CACHE_TABLE
Name of the table used to store precalculated group data |
static long |
DEFAULT_RELOAD_INTERVAL
The default value for the reload interval (in seconds) |
static long |
INITIAL_LOAD_INTERVAL
The interval to wait before performing the initial load (in seconds) |
protected long |
reloadInterval
The cache reload interval |
protected weblogic.common.T3ServicesDef |
services
The services object passed in by WLS |
static java.lang.String |
UPDATE_PROPERTY_NAME
flag to indicate that this copy should do the database updates |
protected boolean |
updateDb
Flag to indicate that database updates should occur |
static boolean |
VERBOSE
A flag used to indicate whether or not messages should be printed |
Constructor Summary | |
GroupCache()
Default Constructor A default constructor is required by WLS |
Method Summary | |
protected static void |
close(java.sql.Connection c)
|
protected static void |
close(java.sql.PreparedStatement ps)
|
protected static void |
close(java.sql.ResultSet rs)
|
static java.lang.String[] |
getCachedGroupNamesForUser(java.lang.String userName)
Gets a list of names of the groups to which a user has membership |
protected static java.sql.Connection |
getReadConnection()
Returns a connection for reading from the pre-calculated table. |
protected static java.sql.Connection |
getWriteConnection()
Returns a connection to use when regenerating the pre-calculated table. |
protected void |
insertGroupMembers(java.lang.String groupName,
java.util.Set members,
java.sql.Connection conn)
Get the user id's of the members of the group specified by groupId; add them to the members Set; insert them into the cache table for that group; then call itself recursively for each child of the given group, with the augmented set of members. |
protected void |
regenerateGroupTable()
Kicks off the pre-calculated membership table process by dropping all rows, getting a list of the top level groups, and then calling insertGroupMembers for each of them. |
protected void |
reloadCache()
Reloads the group cache |
long |
schedule(long time)
Determines schedule for trigger |
void |
setServices(weblogic.common.T3ServicesDef services)
Sets the T3ServicesDef object to be used by the instance of GroupCache |
java.lang.String |
startup(java.lang.String name,
java.util.Hashtable startupArgs)
Starts the instance of GroupCache |
void |
trigger(weblogic.time.common.Schedulable schedulable)
Call back for WLS time service to notify the group cache that a cache reload should be performed |
Field Detail |
public static final long DEFAULT_RELOAD_INTERVAL
public static final long INITIAL_LOAD_INTERVAL
public static final java.lang.String UPDATE_PROPERTY_NAME
public static final boolean VERBOSE
protected long reloadInterval
protected weblogic.common.T3ServicesDef services
protected boolean updateDb
protected static final java.lang.String CACHE_TABLE
Constructor Detail |
public GroupCache()
Method Detail |
public static java.lang.String[] getCachedGroupNamesForUser(java.lang.String userName) throws ServiceProviderException
userName
- A user namepublic long schedule(long time)
time
- The time to which the reload interval should be addedpublic void setServices(weblogic.common.T3ServicesDef services)
public java.lang.String startup(java.lang.String name, java.util.Hashtable startupArgs) throws java.lang.Exception
name
- The name GroupCache name set in weblogic.propertiesstartupArgs
- The startup args set in weblogic.propertiesString
A startup message that is sent to the logjava.lang.Exception
- Thrown if anything whatsoever goes wrongpublic void trigger(weblogic.time.common.Schedulable schedulable)
schedulable
- The cache reload schedulableprotected void regenerateGroupTable()
protected void insertGroupMembers(java.lang.String groupName, java.util.Set members, java.sql.Connection conn) throws java.sql.SQLException, ServiceProviderException
protected void reloadCache()
protected static void close(java.sql.ResultSet rs)
protected static void close(java.sql.PreparedStatement ps)
protected static void close(java.sql.Connection c)
protected static java.sql.Connection getReadConnection() throws java.sql.SQLException
protected static java.sql.Connection getWriteConnection() throws java.sql.SQLException
|
© 2001 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |