com.xerox.amazonws.simpledb
Class SimpleItemCache

java.lang.Object
  extended by com.xerox.amazonws.simpledb.SimpleItemCache
All Implemented Interfaces:
ItemCache

public class SimpleItemCache
extends Object
implements ItemCache

This interface describes calls that the Domain will make into a caching system. For now, only items are cached by id.


Constructor Summary
SimpleItemCache()
           
 
Method Summary
 void clear()
          Clears the cache.
 Item getItem(String id)
          This retrieves an item from the cache.
 List<Item> itemSet()
          Retrieves a complete list of items in the cache
 void putItem(Item i)
          Stores an item in the cache.
 void removeItem(String id)
          Removes an item from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleItemCache

public SimpleItemCache()
Method Detail

getItem

public Item getItem(String id)
This retrieves an item from the cache. A null is returned if the item is not cachced.

Specified by:
getItem in interface ItemCache
Parameters:
id - the identifier for the item being retrieved
Returns:
the item found (or null)

putItem

public void putItem(Item i)
Stores an item in the cache.

Specified by:
putItem in interface ItemCache
Parameters:
i - the item to be stored

removeItem

public void removeItem(String id)
Removes an item from the cache.

Specified by:
removeItem in interface ItemCache
Parameters:
id - the identifier for the item being removed

itemSet

public List<Item> itemSet()
Retrieves a complete list of items in the cache

Specified by:
itemSet in interface ItemCache

clear

public void clear()
Clears the cache. This would be used to ensure only new data is being fetched.

Specified by:
clear in interface ItemCache