|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.axiom.contact.security.GroupCache
This class implements a periodically self-refreshing cache of security groups. The cache maintained by this class is reloaded periodically. Reloads are triggered by the WLS time service, and the reload period is determined by a property provided in weblogic.properties
Field Summary | |
protected static java.lang.String |
CACHE_TABLE
|
static long |
DEFAULT_RELOAD_INTERVAL
The default value for the reload interval (in seconds) |
protected boolean |
firstTime
|
static long |
INITIAL_LOAD_INTERVAL
The interval to wait before performing the initial load (in seconds) |
static java.lang.String |
JNDI_LOCATION
|
protected static java.lang.String |
p13nTablePrefix
|
static java.lang.String |
RELOAD_INTERVAL_PROPERTY_NAME
The name of the property in weblogic.properties that specifies the reload interval (in seconds) for the instance of GroupCache |
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 |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String JNDI_LOCATION
public static final long DEFAULT_RELOAD_INTERVAL
public static final long INITIAL_LOAD_INTERVAL
public static final java.lang.String RELOAD_INTERVAL_PROPERTY_NAME
public static final java.lang.String UPDATE_PROPERTY_NAME
public static final boolean VERBOSE
protected long reloadInterval
protected weblogic.common.T3ServicesDef services
protected boolean firstTime
protected boolean updateDb
protected static java.lang.String p13nTablePrefix
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 logpublic 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
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |