com.webmethods.caf.faces.data
Interface IRefreshable

All Known Subinterfaces:
IRefreshableContentProvider, ITaskContentProvider, ITaskSearchContentProvider, ITaskSearchPagingContentProvider
All Known Implementing Classes:
AbstractTaskContentProvider, BaseIteratorTableContentProvider, BaseTaskSearchContentProvider, BaseWSClientContentProvider, BoundChildrenTreeContentProvider, ChildrenTableContentProvider, CSPAttachmentsProvider, CSPContentSearchProvider, CSPEFormTemplateProvider, CSPPreviewImageProvider, CSPRefreshableContentBaseProvider, DirectorySearchProvider, FilterableListTreeContentProvider, FilterableSelectableListTableContentProvider, FilteredPortalContainerModel, GlueWSClientContentProvider, LazyNodeTreeContentProvider, ListTreeContentProvider, NewsfeedContentProvider, NodeTreeContentProvider, ObjectMethodContentProvider, PageableTableContentProvider, PeopleSearchProvider, PortalContainerModel, ProcessSearchProvider, RowSetTableContentProvider, SearchTableContentProvider, SelectableListTableContentProvider, SimpleTaskContentProvider, TableTreeContentProvider, TaskContentProvider, TaskContentProviderExtended, TaskInboxIndexedSearchContentProvider, TaskInboxSearchContentProvider, TaskIndexedSearchContentProvider, TaskSavedSearchContentProvider, TaskSearchContentProvider, VersionHistoryTableContentProvider, XMLTableContentProvider, XMLTreeContentProvider

public interface IRefreshable

Provider that allows wrapped data to be refreshed, i.e. reloaded from the data source. Typically the implementations support some notion of input parameters and output results, where input parameters are used to execute a query or a service and the output results are populated from this query or service call.

.

The provider implementation can support auto-refresh of the results when input parameters have changed. The client must glag the fact that the input parameters have changed by setting IRefreshable.setNeedRefresh(boolean) = true. This is done automatically if clients use BaseFacesBean.resolveDataBinding(String[][], Object, String) method on the page bean for dynamic data binding of the provider input parameters.


Method Summary
 boolean getNeedRefresh()
          Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from the data source by executing IRefreshable.refresh() method.
 boolean isAutoRefresh()
          Returns true if the provider is currenlty in auto-refresh mode
 void refresh()
          (Re)loads data from the data source.
 void setAutoRefresh(boolean autorefresh)
          Sets auto refresh mode on.
 void setNeedRefresh(boolean needRefresh)
          Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object).
 boolean supportsAutoRefresh()
          Returns true if this content provider supports auto refresh feature.
 

Method Detail

refresh

void refresh()
             throws ContentProviderException
(Re)loads data from the data source. Implementation specific meaning can be executing a SQL query or a web service call. All current data will be lost and updated with the new results if successful.

Throws:
ContentProviderException - if error loading data from the data source

supportsAutoRefresh

boolean supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature.

Returns:
true when auto refresh is supported
See Also:
IRefreshable.setAutoRefresh(boolean)

setAutoRefresh

void setAutoRefresh(boolean autorefresh)
                    throws ContentProviderException

Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh() to determine whether the refresh needs to be done before returning any result properties. If it returns true, the provider calls IRefreshable.refresh() method to updated the result properties.

Parameters:
autorefresh - true to turn it on
Throws:
ContentProviderException - if auto refresh mode is not supported
See Also:
IRefreshable.supportsAutoRefresh(), IRefreshable.getNeedRefresh(), IRefreshable.setNeedRefresh(boolean)

isAutoRefresh

boolean isAutoRefresh()
Returns true if the provider is currenlty in auto-refresh mode

Returns:
false if auto-refresh mode is off or not supported

getNeedRefresh

boolean getNeedRefresh()

Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from the data source by executing IRefreshable.refresh() method.

Implementations may return an accurate value from this method if they can track the changes to the input parameter properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean) explicitely.

Returns:
true when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh() needs to be executed manually or automatically.

setNeedRefresh

void setNeedRefresh(boolean needRefresh)
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object).

Parameters:
needRefresh - true if the input parameters have changed