arlut.csd.ganymede.client
Class objectCache

java.lang.Object
  |
  +--arlut.csd.ganymede.client.objectCache

public class objectCache
extends java.lang.Object

Implements an information cache for the client. Client code can store information about objects on the server here and can use it wherever.

objectCache maintains a mapping between hash keys (typically Short values corresponding to object type ids on the server) and objectList objects which track status of objects for that hash key.


Field Summary
(package private) static boolean debug
           
(package private)  java.util.Hashtable idMap
           
 
Constructor Summary
objectCache()
           
 
Method Summary
 void augmentList(java.lang.Object key, QueryResult qr)
          This method is intended to augment an existing list with non-editable object handles.
 void clearCaches()
           
 boolean containsList(java.lang.Object key)
           
 boolean containsNonEditable(java.lang.Object key)
          This method returns true if the specified list contains any non-editable handles.
 ObjectHandle getInvidHandle(java.lang.Object key, Invid invid)
          This method retrieves an object handle matching the given invid from the specified object list.
 java.util.Vector getLabels(java.lang.Object key, boolean includeInactives)
          This method returns a sorted Vector of object labels.
 java.util.Vector getLabels(java.lang.Object key, boolean includeInactives, boolean includeNonEditables)
          This method returns a sorted Vector of object labels.
 objectList getList(java.lang.Object key)
           
 java.util.Vector getListHandles(java.lang.Object key, boolean includeInactives)
          This method returns a sorted Vector of listHandles for the cache for <key>.
 java.util.Vector getListHandles(java.lang.Object key, boolean includeInactives, boolean includeNonEditables)
          This method returns a sorted Vector of listHandles for the cache for <key>.
 void putList(java.lang.Object key, objectList list)
           
 void putList(java.lang.Object key, QueryResult qr)
           
 void removeList(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

debug

static final boolean debug

idMap

java.util.Hashtable idMap
Constructor Detail

objectCache

public objectCache()
Method Detail

containsList

public boolean containsList(java.lang.Object key)

getList

public objectList getList(java.lang.Object key)

containsNonEditable

public boolean containsNonEditable(java.lang.Object key)
This method returns true if the specified list contains any non-editable handles.

getListHandles

public java.util.Vector getListHandles(java.lang.Object key,
                                       boolean includeInactives)
This method returns a sorted Vector of listHandles for the cache for <key>. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects

getListHandles

public java.util.Vector getListHandles(java.lang.Object key,
                                       boolean includeInactives,
                                       boolean includeNonEditables)
This method returns a sorted Vector of listHandles for the cache for <key>. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects
includeNonEditables - if false, the list returned will not include entries for any non-editable objects

getLabels

public java.util.Vector getLabels(java.lang.Object key,
                                  boolean includeInactives)
This method returns a sorted Vector of object labels. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects

getLabels

public java.util.Vector getLabels(java.lang.Object key,
                                  boolean includeInactives,
                                  boolean includeNonEditables)
This method returns a sorted Vector of object labels. The vector is essentially a read-out of the current state of the objectList, and will not track any future changes to this objectList.
Parameters:
includeInactives - if false, the list returned will not include entries for any inactive objects
includeNonEditables - if false, the list returned will not include entries for any non-editable objects

getInvidHandle

public ObjectHandle getInvidHandle(java.lang.Object key,
                                   Invid invid)

This method retrieves an object handle matching the given invid from the specified object list.

This isn't the fastest operation, but hopefully won't be too bad.

Returns:
The matching handle, or null if it wasn't found.

putList

public void putList(java.lang.Object key,
                    QueryResult qr)

augmentList

public void augmentList(java.lang.Object key,
                        QueryResult qr)
This method is intended to augment an existing list with non-editable object handles.

putList

public void putList(java.lang.Object key,
                    objectList list)

removeList

public void removeList(java.lang.Object key)

clearCaches

public void clearCaches()