|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StoreProvider<T>
A StoreProvider is something like a Map where the API
revolves around getting blocks of entries rather than individual entries and
it gives you the ability to subscribe to those blocks of data to ask for
change updates. These are the types of changes that you would expect from an
interface designed for remote access.
Implementing the StoreProvider interface is likely to be hard for
many applications. You are advised to begin by extending the
AbstractStoreProvider helper class.
In place of Map.Entry, StoreProvider uses
Items as it's way to connect objects with
their primary keys.
| Method Summary | |
|---|---|
void |
put(java.lang.String itemId,
RawData rawData)
Similar to Map.put(K, V) in adding items to a Store. |
void |
put(java.lang.String itemId,
T value)
Similar to Map.put(K, V) in adding items to a Store. |
void |
unsubscribe(StoreChangeListener<T> listener)
Remove the declaration of interest previously expressed. |
void |
update(java.util.List<ItemUpdate> changes)
Make a series of updates to items in the store. |
Item |
viewItem(java.lang.String itemId)
Similar to Map.get(java.lang.Object) in fetching items from a Store. |
Item |
viewItem(java.lang.String itemId,
StoreChangeListener<T> listener)
Similar to Map.get(java.lang.Object) in fetching items from a Store, and
request to stay updated to changes in the region. |
MatchedItems |
viewRegion(StoreRegion region)
Extract the data referred to by the given region. |
MatchedItems |
viewRegion(StoreRegion region,
StoreChangeListener<T> listener)
Extract the data referred to by the given region, and request to stay updated to changes in the region. |
| Method Detail |
|---|
Item viewItem(java.lang.String itemId)
Map.get(java.lang.Object) in fetching items from a Store.
itemId - The ID of the item to fetch
Item viewItem(java.lang.String itemId,
StoreChangeListener<T> listener)
Map.get(java.lang.Object) in fetching items from a Store, and
request to stay updated to changes in the region.
itemId - The ID of the item to fetchlistener - The listener to be notified of changes
MatchedItems viewRegion(StoreRegion region)
region - A set of filter and sort criteria to restrict the fetched data
MatchedItems viewRegion(StoreRegion region,
StoreChangeListener<T> listener)
region - A set of filter and sort criteria to restrict the fetched datalistener - The listener to be notified of changes
void unsubscribe(StoreChangeListener<T> listener)
listener - The listener that should no longer be notified
void put(java.lang.String itemId,
RawData rawData)
Map.put(K, V) in adding items to a Store.
A value of null is equivalent to removing the item from the store.
Part of the function of put is to convert the data stored in
RawData into alterations to data in the store. This boiler plate
code is implemented in AbstractStoreProvider.
See notes on Item.getItemId()
itemId - The key (or some mapping) to it.rawData - Data from the web to be converted and added to the store
void put(java.lang.String itemId,
T value)
Map.put(K, V) in adding items to a Store.
A value of null is equivalent to removing the item from the store.
itemId - The key (or some mapping) to it.value - The new object to be added to the storevoid update(java.util.List<ItemUpdate> changes)
changes - A list of item IDs along with the attributes to change
and the values to change to
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||