org.directwebremoting.export
Class Data

java.lang.Object
  extended by org.directwebremoting.export.Data

public class Data
extends java.lang.Object

External interface to the set of StoreProviders that have been registered.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
Data()
           
 
Method Summary
 void unsubscribe(java.lang.String storeId, StoreChangeListener<java.lang.Object> receiver)
          Remove a subscription from the list of people that we are remembering to keep updated
<T> void
update(java.lang.String storeId, java.util.List<ItemUpdate> changes)
          Update server side data.
 Item viewItem(java.lang.String storeId, java.lang.String itemId, StoreChangeListener<java.lang.Object> listener)
          Provide access to a single item of data given its ID.
 MatchedItems viewRegion(java.lang.String storeId, StoreRegion region, StoreChangeListener<java.lang.Object> listener)
          Notes that there is a region of a page that wishes to subscribe to server side data, and registers a callback function to receive the data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Data

public Data()
Method Detail

viewItem

public Item viewItem(java.lang.String storeId,
                     java.lang.String itemId,
                     StoreChangeListener<java.lang.Object> listener)
Provide access to a single item of data given its ID.

Parameters:
storeId - The ID of the store into which we look for the item
itemId - The ID of the item to retrieve from the store
listener - The client side interface to pass async updates to. Will be null if no async updates are required
Returns:
The found item, or null if one was not found.

viewRegion

public MatchedItems viewRegion(java.lang.String storeId,
                               StoreRegion region,
                               StoreChangeListener<java.lang.Object> listener)
Notes that there is a region of a page that wishes to subscribe to server side data, and registers a callback function to receive the data.

Parameters:
storeId - The ID of a store as registered on the server using Directory.register(java.lang.String, org.directwebremoting.datasync.StoreProvider). If no store has been registered on the server using this passed storeId, then this call will act as if there was a store registered, but that it was empty. This may make it harder to scan the server for exposed stores. Internally however the call will be ignored. This behavior may change in the future and should not be relied upon.
region - For field documentation see StoreRegion.
listener - The client side interface to pass async updates to. Will be null if no async updates are required

unsubscribe

public void unsubscribe(java.lang.String storeId,
                        StoreChangeListener<java.lang.Object> receiver)
Remove a subscription from the list of people that we are remembering to keep updated

Parameters:
receiver - The client side interface to pass async updates to. Will be null if no async updates are required

update

public <T> void update(java.lang.String storeId,
                       java.util.List<ItemUpdate> changes)
Update server side data.

Parameters:
storeId - The store into which data is to be altered/inserted. If a store by the given name has not been registered then this method is a no-op, however a message will be written to the log detailing the error
changes - A list of changes to make to the objects in the store

Copyright 2008