org.sandev.basics.util
Interface IDLookup

All Known Subinterfaces:
Persister, UIFormAdaptorCallback, UIFormOwner
All Known Implementing Classes:
DataManagerNode

public interface IDLookup

Provides general object resolution capabilities. An IDLookup is needed to transform an object reference into an actual instance. An implementing class would generally make use of an IDCache for fast retrieval. Due to the query and cache management requirements, IDLookup is typically implemented by a node (or an object in close cooperation with a node).


Method Summary
 SandPersistMessage getInstance(java.lang.String classname, long id, AuthUser user)
          Return the message associated with this ID.
 

Method Detail

getInstance

public SandPersistMessage getInstance(java.lang.String classname,
                                      long id,
                                      AuthUser user)
                               throws SandException
Return the message associated with this ID. The classname is provided to allow for easy switching to an appropriate generated node query method. The classname may be the short name or the fully qualified name.

An implementation of this method would typically first lookup the ID in a cache, then retrieve the instance via query if nothing was found. After retrieving the instance via query, the implementation would typically cache the returned instance to avoid subsequent round trips to the DataManager.

To avoid stale cache data, the implementor can track updates by subscribing to a CacheActions from a CacheManager node instance. See the IDCache for details.

Throws:
SandException