public class DSpaceValidity extends Object implements org.apache.excalibur.source.SourceValidity
| Modifier and Type | Field and Description |
|---|---|
protected long |
assumedValidityDelay
The length of time that a cache is assumed to be valid
|
protected long |
assumedValidityTime
The time when the validity is no longer assumed to be valid
|
protected boolean |
completed
Simple flag to note if the object has been completed.
|
protected long |
hash
A hash of the validityKey taken after completetion
|
protected StringBuffer |
validityKey
The validityKey while it is being build, once it is completed.
|
| Constructor and Description |
|---|
DSpaceValidity() |
DSpaceValidity(String initialValidityKey)
Create a new DSpace validity object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DSpaceObject dso)
Add a DSpace object to the validity.
|
void |
add(String nonDSpaceObject)
Add a non-DSpaceObject to the validity, the object should be
serialized into a string form.
|
DSpaceValidity |
complete()
Complete this validity object.
|
int |
isValid()
Determine if the cache is still valid
|
int |
isValid(org.apache.excalibur.source.SourceValidity otherObject)
Determine if the cache is still valid based
upon the other validity object.
|
void |
setAssumedValidityDelay(long milliseconds)
Set the time delay for how long this cache will be assumed
to be valid.
|
void |
setAssumedValidityDelay(String delay)
Set the time delay for how long this cache will be assumed to be valid.
|
protected StringBuffer validityKey
protected boolean completed
protected long hash
protected long assumedValidityTime
protected long assumedValidityDelay
public DSpaceValidity(String initialValidityKey)
initialValidityKey - The initial stringpublic DSpaceValidity()
public DSpaceValidity complete()
public void setAssumedValidityDelay(long milliseconds)
milliseconds - The delay time in millieseconds.public void setAssumedValidityDelay(String delay)
delay - The delay time in a variable scale.public void add(DSpaceObject dso) throws SQLException
dso - The object to add to the validity.SQLExceptionpublic void add(String nonDSpaceObject) throws SQLException
nonDSpaceObject - The non-DSpace object to add to the validity.SQLExceptionpublic int isValid()
isValid in interface org.apache.excalibur.source.SourceValiditypublic int isValid(org.apache.excalibur.source.SourceValidity otherObject)
isValid in interface org.apache.excalibur.source.SourceValidityotherObject - The other validity object.Copyright © 2016 DuraSpace. All Rights Reserved.