|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.security.acl.DefaultGroupImpl | +--weblogic.security.acl.FlatGroup
Caching group implementation. Cooperates with classes that inherit from AbstractListableRealm, to provide a group implementation that remains up-to-date when its backing store changes.
FlatGroup attempts to avoid the problem of a Group object being created with a snapshot of the "real" group which is never afterwards updated. For example, if you store group information in a remote server and create a WebLogic ACL that refers to that group, the ACL will become out of date if the membership of that group ever changes on the remote server.
FlatGroup avoids that problem by maintaining its group membership in a cache, instead of a never-changing set. When the cache expires, this group implementation will query the realm that created it to obtain the most recent membership information. This query is performed by calling the FlatGroup.Source.getGroupMembers method (which is implemented by AsbtractListableRealm).
As a result of caching its membership information, a FlatGroup can occasionally become temporarily out-of-date with respect to its backing store, but this caching is necessary to maintain reasonable WebLogic Server performance.
By default, group membership information is cached for 5 minutes. If necessary, you can change this value by setting the weblogic.security.groupCacheTTL system property to the number of seconds you need (this value must be greater than zero).
AbstractListableRealm
Inner Class Summary | |
static interface |
FlatGroup.Source
Interface to be implemented by realm classes that use FlatGroup. |
Field Summary | |
static int |
LIFETIME_DEFAULT_SEC
Default cache lifetime, in seconds. |
protected java.util.Hashtable |
members
|
Constructor Summary | |
protected |
FlatGroup(java.lang.String name,
FlatGroup.Source source)
Create a new group, with no membership information. |
protected |
FlatGroup(java.lang.String name,
FlatGroup.Source source,
java.util.Hashtable members)
Create a new group, with the given membership information. |
Method Summary | |
protected boolean |
addMemberInternal(java.security.Principal principal)
Update this object's internal state when adding a member. |
protected void |
ensureFreshness()
Important method for implementors. |
boolean |
equals(java.lang.Object obj)
|
static long |
getCacheTTLMillis()
Get the current group membership cache TTL, in milliseconds |
protected abstract java.lang.Class |
getUserClass()
Return the class object used by users in this realm. |
int |
hashCode()
|
boolean |
isMember(java.security.Principal member)
Returns true if the passed principal is a member of the group. |
java.util.Enumeration |
members()
Returns an enumeration of the members in the group. |
protected boolean |
removeMemberInternal(java.security.Principal principal)
Update this object's internal state when removing a member. |
protected static void |
setCacheTTL(long millis)
Set this group's membership cache TTL. |
java.lang.String |
toString()
|
Methods inherited from class weblogic.security.acl.DefaultGroupImpl |
addMember,
getName,
removeMember |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int LIFETIME_DEFAULT_SEC
protected java.util.Hashtable members
Constructor Detail |
protected FlatGroup(java.lang.String name, FlatGroup.Source source)
protected FlatGroup(java.lang.String name, FlatGroup.Source source, java.util.Hashtable members)
Method Detail |
protected final void ensureFreshness()
public boolean isMember(java.security.Principal member)
member
- the principal whose membership is to be checked.public java.util.Enumeration members()
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object obj)
protected abstract java.lang.Class getUserClass()
protected boolean addMemberInternal(java.security.Principal principal)
protected boolean removeMemberInternal(java.security.Principal principal)
protected static final void setCacheTTL(long millis)
millis
- new TTL, in milliseconds (must be positive)public static final long getCacheTTLMillis()
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs60 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |