T - the base type of XML objects being managedpublic abstract class AbstractConditionalLoadXMLObjectLoadSaveManager<T extends XMLObject> extends Object implements ConditionalLoadXMLObjectLoadSaveManager<T>
XMLObjectLoadSaveManager implementations which
track the modify times of requested data such that XMLObjectLoadSaveManager.load(String) returns
data only if the data associated with the key has been modified since the last
request.| Modifier and Type | Field and Description |
|---|---|
private boolean |
loadConditionally
Configuration flag for whether
XMLObjectLoadSaveManager.load(String) will check and return data only if modified
since the last request for that data. |
private Map<String,Long> |
loadLastModified
Storage for last modified time of requested data.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConditionalLoadXMLObjectLoadSaveManager(boolean conditionalLoad)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearAllLoadLastModified()
Clear the cached modified times for the last load for all keys.
|
Long |
clearLoadLastModified(String key)
Clear the cached modified time for the last load of the specified key.
|
Long |
getLoadLastModified(String key)
Retrieve the cached modified time for the last load of the specified key.
|
boolean |
isLoadConditionally()
Get whether
XMLObjectLoadSaveManager.load(String) will check and return data only if modified
since the last request for that data. |
protected abstract boolean |
isUnmodifiedSinceLastLoad(String key)
Check whether the data corresponding to the specified key has been modified since the last time
XMLObjectLoadSaveManager.load(String) was called for that key. |
protected Long |
updateLoadLastModified(String key)
Update the cached modified time for the specified key with the current time.
|
protected Long |
updateLoadLastModified(String key,
Long modified)
Update the cached modified time for the specified key with the specified time.
|
private boolean loadConditionally
XMLObjectLoadSaveManager.load(String) will check and return data only if modified
since the last request for that data.protected AbstractConditionalLoadXMLObjectLoadSaveManager(@ParameterName(name="conditionalLoad") boolean conditionalLoad)
conditionalLoad - whether XMLObjectLoadSaveManager.load(String) should behave
as defined in ConditionalLoadXMLObjectLoadSaveManagerpublic boolean isLoadConditionally()
XMLObjectLoadSaveManager.load(String) will check and return data only if modified
since the last request for that data.isLoadConditionally in interface ConditionalLoadXMLObjectLoadSaveManager<T extends XMLObject>@Nullable public Long getLoadLastModified(@Nonnull String key)
Note that this will be null if XMLObjectLoadSaveManager.load(String) has not been called
for the specified key since construction or since the last call to
ConditionalLoadXMLObjectLoadSaveManager.clearLoadLastModified(String) or ConditionalLoadXMLObjectLoadSaveManager.clearAllLoadLastModified().
getLoadLastModified in interface ConditionalLoadXMLObjectLoadSaveManager<T extends XMLObject>key - the target key@Nullable public Long clearLoadLastModified(@Nonnull String key)
clearLoadLastModified in interface ConditionalLoadXMLObjectLoadSaveManager<T extends XMLObject>key - the target keypublic void clearAllLoadLastModified()
clearAllLoadLastModified in interface ConditionalLoadXMLObjectLoadSaveManager<T extends XMLObject>protected Long updateLoadLastModified(@Nonnull String key)
key - the target keyprotected Long updateLoadLastModified(@Nonnull String key, @Nullable Long modified)
key - the target keymodified - the new cached modified timeprotected abstract boolean isUnmodifiedSinceLastLoad(@Nonnull String key) throws IOException
XMLObjectLoadSaveManager.load(String) was called for that key.key - the data keyIOException - if there is a fatal error evaluating the last modified statusCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.