ncsa.tools.trebuchet.core.agents.cache
Class CacheAgent

java.lang.Object
  extended byncsa.tools.trebuchet.core.agents.cache.CacheAgent
All Implemented Interfaces:
ICacheAgent, IConfigurable
Direct Known Subclasses:
ScannedInputAgent, StaticInputAgent

public abstract class CacheAgent
extends java.lang.Object
implements ICacheAgent


Method Summary
 void addListener(IOperationListener listener)
           
 ReverseLookupEntry fetch(long id)
           
 OperationCache getCache()
           
 void initialize(TrebuchetConfiguration configuration)
           
 void markAsDone()
           
 ReverseLookupEntry next()
          This method will return null if we have reached the end of the cache in ascending order and we are still waiting for the cache to fill, but will throw an EndOfCacheException if the cache is complete, or we are moving backwards through the cache.
 void removeListener(IOperationListener listener)
           
 void reset()
           
 void setCache(OperationCache cache)
           
 void setCopyCacheFile(java.lang.String copyCacheFile)
           
 void setIgnoreSuccessStatus(boolean ignoreSuccessStatus)
           
 void setListCacheFile(java.lang.String listCacheFile)
           
 void setReverse(boolean reverse)
           
 void setTypes(ResourceType[] types)
           
 void update(ReverseLookupEntry entry)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ncsa.tools.trebuchet.core.ICacheAgent
cleanup, close, open
 

Method Detail

initialize

public void initialize(TrebuchetConfiguration configuration)
                throws InitializationException
Specified by:
initialize in interface IConfigurable
Throws:
InitializationException

fetch

public ReverseLookupEntry fetch(long id)
                         throws FatalErrorDuringOperationException,
                                java.nio.channels.ClosedChannelException
Specified by:
fetch in interface ICacheAgent
Throws:
FatalErrorDuringOperationException
java.nio.channels.ClosedChannelException

next

public ReverseLookupEntry next()
                        throws FatalErrorDuringOperationException,
                               EndOfCacheException,
                               java.nio.channels.ClosedChannelException
This method will return null if we have reached the end of the cache in ascending order and we are still waiting for the cache to fill, but will throw an EndOfCacheException if the cache is complete, or we are moving backwards through the cache.

Specified by:
next in interface ICacheAgent
Throws:
FatalErrorDuringOperationException
EndOfCacheException
java.nio.channels.ClosedChannelException

update

public void update(ReverseLookupEntry entry)
            throws FatalErrorDuringOperationException
Specified by:
update in interface ICacheAgent
Throws:
FatalErrorDuringOperationException

markAsDone

public void markAsDone()
                throws FatalErrorDuringOperationException
Specified by:
markAsDone in interface ICacheAgent
Throws:
FatalErrorDuringOperationException

reset

public void reset()
           throws java.io.IOException
Specified by:
reset in interface ICacheAgent
Throws:
java.io.IOException

addListener

public void addListener(IOperationListener listener)
Specified by:
addListener in interface ICacheAgent

removeListener

public void removeListener(IOperationListener listener)
Specified by:
removeListener in interface ICacheAgent

setReverse

public void setReverse(boolean reverse)

setTypes

public void setTypes(ResourceType[] types)

setIgnoreSuccessStatus

public void setIgnoreSuccessStatus(boolean ignoreSuccessStatus)

getCache

public OperationCache getCache()

setCache

public void setCache(OperationCache cache)

setCopyCacheFile

public void setCopyCacheFile(java.lang.String copyCacheFile)

setListCacheFile

public void setListCacheFile(java.lang.String listCacheFile)