Class CacheBlockBase
- java.lang.Object
-
- com.iplanet.am.sdk.common.CacheBlockBase
-
- Direct Known Subclasses:
CacheBlock
,IdCacheBlock
public abstract class CacheBlockBase extends Object
This class represents the value part stored in the AMCacheManager's cache. Each CacheBlock object would represent a Directory entry. It caches the attributes corresponding to that entry. It also keeps track of the other details such as the Organization DN for the entry.Also, this cache block can be used to serve as dummy block representing a non-existent directory entry (negative caching). This prevents making un-necessary directory calls for non-existent directory entries.
Since the attributes that can be retrieved depends on the principal performing the operation (ACI's set), the result set would vary. The attributes that are returned are the ones that are readable by the principal. Each cache block keeps account of these differences in result sets by storing all the attributes readable (and writable) on a per principal basis. This information is stored in a PrincipalAccess object. In order to avoid duplicate copy of the values, the all attribute values are not cached per principal. A single copy of the attributes is stored in the CacheBlock object. Also this copy of attributes stored in the cache block keeps track of non-existent directory attributes (invalid attributes). This would also prevent un-necessary directory calls for non-existent entry attributes. The attribute copy is dirtied by removing the entries which get modified.
-
-
Constructor Summary
Constructors Constructor Description CacheBlockBase(String entryDN, boolean validEntry)
CacheBlockBase(String entryDN, String orgDN, boolean validEntry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Should be cleared, only if the entry is still valid only the data has changed.Map
getAttributes(boolean byteValues)
Map
getAttributes(Set attrNames, boolean byteValues)
abstract Debug
getDebug()
abstract long
getDefaultEntryExpirationTime()
String
getEntryDN()
int
getObjectType()
String
getOrganizationDN()
abstract long
getUserEntryExpirationTime()
boolean
hasCache()
boolean
hasCompleteSet()
boolean
hasExpiredAndUpdated()
If cache expiry has been enabled then this will return true if the cache has expired.abstract boolean
isEntryExpirationEnabled()
boolean
isExists()
Method which specifies if the entry exists in the directory or is an invalid entry.void
putAttributes(Map attributes, Set inAccessibleAttrNames, boolean isCompleteSet, boolean byteValues)
void
removeAttributes()
void
removeAttributes(Set attrNames)
void
replaceAttributes(String principalDN, Map sAttributes, Map bAttributes)
void
setExists(boolean exists)
void
setObjectType(int type)
void
setOrganizationDN(String orgDN)
String
toString()
-
-
-
Method Detail
-
isEntryExpirationEnabled
public abstract boolean isEntryExpirationEnabled()
-
getUserEntryExpirationTime
public abstract long getUserEntryExpirationTime()
-
getDefaultEntryExpirationTime
public abstract long getDefaultEntryExpirationTime()
-
getDebug
public abstract Debug getDebug()
-
setExists
public void setExists(boolean exists)
-
setObjectType
public void setObjectType(int type)
-
setOrganizationDN
public void setOrganizationDN(String orgDN)
-
getOrganizationDN
public String getOrganizationDN()
-
getObjectType
public int getObjectType()
-
getEntryDN
public String getEntryDN()
-
isExists
public boolean isExists()
Method which specifies if the entry exists in the directory or is an invalid entry.
NOTE: Call to this method should preceeded with expiredAndUpdated() check. For example, isExists() return value holds good only it the entry has not expired. So, check anywhere it is called the check should be if (!cb.expiredAndUpdated() && cb.isExists()) or similar.- Returns:
- true if it represents a valid entry, false otherwise
-
hasExpiredAndUpdated
public boolean hasExpiredAndUpdated()
If cache expiry has been enabled then this will return true if the cache has expired.
Note: This call must be made outside of a readLock because if the cache has expired then a writeLock is required as part of callingclear()
which would result in a deadlock, a readLock cannot be upgraded to a writeLock.- Returns:
- true if cache expiry is enabled and the cache has expired
-
hasCache
public boolean hasCache()
-
hasCompleteSet
public boolean hasCompleteSet()
-
getAttributes
public Map getAttributes(boolean byteValues)
-
putAttributes
public void putAttributes(Map attributes, Set inAccessibleAttrNames, boolean isCompleteSet, boolean byteValues)
-
removeAttributes
public void removeAttributes()
-
removeAttributes
public void removeAttributes(Set attrNames)
-
replaceAttributes
public void replaceAttributes(String principalDN, Map sAttributes, Map bAttributes)
-
clear
public void clear()
Should be cleared, only if the entry is still valid only the data has changed. If entry has been deleted then should be removed.
-
-