|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.org.WTPrincipalCacheElement
This class is used to cache Principal objects in the WTPrincipalCache.
Objects of the class contain the Principal object being cached and the
time the object was added to the cache. The object can also contain the
parent groups for the Principal, the members associated with the principal
(if the principal is a group), and the subordinates associated with the
principal (if the principal is an organization).
The time the object is added to cache is used to implement a Time To
Live feature for cache entries. Each time a cache entry is read the time
the entry was cached is checked against the current time to see if the
amount of time the entry has resided in the cache exceeds an amount of
time specified by a property. If so, the entry has exceeded its "time
to live" and is removed from the cache.
Supported API: false
Extendable: false
Field Summary | |
private long |
cachedTime
|
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
private HashMap |
memberReferences
|
private ObjectIdentifier[] |
members
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private ObjectIdentifier |
organization
|
private ObjectIdentifier[] |
parentGroups
|
private HashMap |
parentReferences
|
private WTPrincipal |
principal
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private ObjectIdentifier[] |
subordinates
|
Constructor Summary | |
WTPrincipalCacheElement()
The no arg constructor. |
|
WTPrincipalCacheElement(WTPrincipal principal)
Constructor. |
Method Summary | |
boolean |
equals(Object rs)
Supported API: false |
long |
getCachedTime()
Supported API: false |
Map |
getMemberReferences()
Supported API: false |
ObjectIdentifier[] |
getMembers()
Supported API: false |
ObjectIdentifier |
getOrganization()
Supported API: false |
ObjectIdentifier[] |
getParentGroups()
Supported API: false |
Map |
getParentReferences()
Supported API: false |
WTPrincipal |
getPrincipal()
Supported API: false |
ObjectIdentifier[] |
getSubordinates()
Supported API: false |
int |
hashCode()
Supported API: false |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(WTPrincipalCacheElement thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
void |
setCachedTime(long cachedTime)
Sets the cachedTime attribute. |
void |
setCachedTime(long cachedTime,
long randomMaxValue)
Sets the cachedTime attribute. |
void |
setMembers(ObjectIdentifier[] members)
Supported API: false |
void |
setOrganization(ObjectIdentifier organization)
Supported API: false |
void |
setParentGroups(ObjectIdentifier[] parentGroups)
Supported API: false |
void |
setPrincipal(WTPrincipal principal)
Supported API: false |
void |
setSubordinates(ObjectIdentifier[] subordinates)
Supported API: false |
boolean |
timeToLiveExpired(long timeToLive)
Checks to see if the WTPrincipalCacheElement has resided in the cache for the specified period of time. |
String |
toString()
Supported API: false |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private long cachedTime
private ObjectIdentifier[] members
private ObjectIdentifier organization
private ObjectIdentifier[] parentGroups
private ObjectIdentifier[] subordinates
private WTPrincipal principal
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private volatile HashMap memberReferences
private volatile HashMap parentReferences
Constructor Detail |
public WTPrincipalCacheElement()
public WTPrincipalCacheElement(WTPrincipal principal)
principal
- The Principal object being cached.Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(WTPrincipalCacheElement thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public long getCachedTime()
public ObjectIdentifier[] getMembers()
public Map getMemberReferences() throws WTException
WTException
public ObjectIdentifier getOrganization()
public ObjectIdentifier[] getParentGroups()
public WTPrincipal getPrincipal()
public ObjectIdentifier[] getSubordinates()
public void setCachedTime(long cachedTime)
cachedTime
- The cachedTime value in milliseconds. If the value is less than or equal to 0, the cachedTime attribute is set to zero.public void setCachedTime(long cachedTime, long randomMaxValue)
cachedTime
- The cachedTime value in milliseconds. If the value is less than or equal to 0, the cachedTime attribute is set to zero.randomMaxValue
- Used to add a random amount of time to the input cachedTime value. Specify randomMaxValue in milliseconds. The random value added to cachedTime will be between 0 and randomMaxValue. If randomMaxValue is less than or equal to 0, the value added to cachedTime is 0.public void setMembers(ObjectIdentifier[] members)
members
- public void setOrganization(ObjectIdentifier organization)
organization
- public void setParentGroups(ObjectIdentifier[] parentGroups)
parentGroups
- public Map getParentReferences() throws WTException
WTException
public void setPrincipal(WTPrincipal principal)
principal
- public void setSubordinates(ObjectIdentifier[] subordinates)
subordinates
- public boolean timeToLiveExpired(long timeToLive)
timeToLive
- The amount of time, specified in seconds. If the element has been in cache for more than this amount, true is returned; otherwise, false is returned.
public boolean equals(Object rs)
rs
-
public int hashCode()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |