org.opensaml.util.storage
Class AbstractExpiringObject

java.lang.Object
  extended by org.opensaml.util.storage.AbstractExpiringObject
All Implemented Interfaces:
java.io.Serializable, ExpiringObject
Direct Known Subclasses:
ReplayCacheEntry

public abstract class AbstractExpiringObject
extends java.lang.Object
implements ExpiringObject, java.io.Serializable

Base implementation for ExpiringObject.

See Also:
Serialized Form

Constructor Summary
AbstractExpiringObject(org.joda.time.DateTime expirationTime)
          Constructor.
 
Method Summary
 org.joda.time.DateTime getExpirationTime()
          Gets the time the object expires.
 boolean isExpired()
          Gets whether this object has expired.
 void onExpire()
          A callback method invoked when this object is expiring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExpiringObject

public AbstractExpiringObject(org.joda.time.DateTime expirationTime)
Constructor.

Parameters:
expirationTime - time this object should expire
Method Detail

getExpirationTime

public org.joda.time.DateTime getExpirationTime()
Gets the time the object expires.

Specified by:
getExpirationTime in interface ExpiringObject
Returns:
time the object expires

isExpired

public boolean isExpired()
Gets whether this object has expired.

Specified by:
isExpired in interface ExpiringObject
Returns:
true if the expiration time has passed, false if not

onExpire

public void onExpire()
A callback method invoked when this object is expiring. Note, this method may not be invoked at the exact instant of expiration but may, instead, be invoked the next time the object is read and noticed to have expired.

Specified by:
onExpire in interface ExpiringObject


Copyright © 2006-2009 Internet2. All Rights Reserved.