ncsa.tools.trebuchet.core.cache
Class IndexedListCache

java.lang.Object
  extended byncsa.tools.trebuchet.core.cache.OperationCache
      extended byncsa.tools.trebuchet.core.cache.ListCache
          extended byncsa.tools.trebuchet.core.cache.IndexedListCache

public final class IndexedListCache
extends ListCache

This class is intended for operations in which it is necessary to update the cache on the basis of path name.
Uses an in-memory map for indexing; this assumes that this class will only be used with operations where the total number of entries will be relatively contained.

Author:
arossi

Constructor Summary
IndexedListCache(CacheHeader connection, java.lang.String id)
           
IndexedListCache(java.io.File cacheFile, boolean readOnly)
           
 
Method Summary
 long addEntry(ReverseLookupEntry entry)
           
 java.lang.Long getIndex(ListEntry entry)
           
 OperationCache getReadOnlyInstance()
           
 void setStrictUpdating(boolean strictUpdating)
           
 
Methods inherited from class ncsa.tools.trebuchet.core.cache.ListCache
getRecaptureExcludes, markScanCompleted
 
Methods inherited from class ncsa.tools.trebuchet.core.cache.OperationCache
addListener, close, currentEntry, delete, getCacheFile, getCacheId, getEntry, getHeader, getNextEntry, getPreviousEntry, markOperationDone, open, print, removeListener, reset, reset, resetToEnd, resetToLastEntry, resetToNthEntry, scanningDirectory, setBufferSize, storeConfiguration, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedListCache

public IndexedListCache(CacheHeader connection,
                        java.lang.String id)
                 throws java.io.IOException

IndexedListCache

public IndexedListCache(java.io.File cacheFile,
                        boolean readOnly)
                 throws java.io.IOException
Method Detail

getReadOnlyInstance

public OperationCache getReadOnlyInstance()
                                   throws java.io.IOException
Overrides:
getReadOnlyInstance in class ListCache
Throws:
java.io.IOException

addEntry

public long addEntry(ReverseLookupEntry entry)
              throws java.io.IOException
Overrides:
addEntry in class OperationCache
Throws:
java.io.IOException

getIndex

public java.lang.Long getIndex(ListEntry entry)

setStrictUpdating

public void setStrictUpdating(boolean strictUpdating)