Class TaskIndexedSearchContentProvider.TaskSearchPagingService
java.lang.Object
com.webmethods.caf.faces.data.task.impl.TaskIndexedSearchContentProvider.TaskSearchPagingService
- All Implemented Interfaces:
IContentProvider
,IRefreshable
,IRefreshableContentProvider
- Enclosing class:
- TaskIndexedSearchContentProvider
public class TaskIndexedSearchContentProvider.TaskSearchPagingService
extends Object
implements IRefreshableContentProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn single page rowsboolean
Returnstrue
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.refresh()
method.int
Object[]
Returns list of properties supported by this content provider.int
getSize()
int
getStart()
int
Class<?>
Returns java type of the given propertyReturns value of the given propertyboolean
hasProperty
(Object propertyKey) Checks if the given property is supported by this content providerint
boolean
Returnstrue
if the provider is currenlty in auto-refresh modeprotected List<ITaskSearchRecord>
performSearch
(TaskSearchQueryV2 searchQuery) protected int
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 viaIContentProvider.getValue(Object)
.void
setNumberOfCalls
(int numberOfCalls) void
setSize
(int size) void
setStart
(int start) void
setTotalRecords
(int totalRecords) boolean
Returns true if this content provider supports auto refresh feature.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
toString
-
Constructor Details
-
TaskSearchPagingService
public TaskSearchPagingService() -
TaskSearchPagingService
public TaskSearchPagingService(int totalRecords)
-
-
Method Details
-
getStart
public int getStart() -
setStart
public void setStart(int start) -
getSize
public int getSize() -
setSize
public void setSize(int size) -
getDataRecords
Return single page rows- Returns:
-
refresh
Description copied from interface:IRefreshable
(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.- Specified by:
refresh
in interfaceIRefreshable
- Throws:
ContentProviderException
- if error loading data from the data source
-
performSearch
- Throws:
Exception
-
getNumberOfCalls
public int getNumberOfCalls() -
setNumberOfCalls
public void setNumberOfCalls(int numberOfCalls) -
initTotalRecords
- Throws:
ContentProviderException
-
performSearchCount
- Throws:
Exception
-
getTotalRecords
public int getTotalRecords() -
setTotalRecords
public void setTotalRecords(int totalRecords) -
getPropertyKeys
Description copied from interface:IContentProvider
Returns list of properties supported by this content provider. Can returnObject[0]
, never null.- Specified by:
getPropertyKeys
in interfaceIContentProvider
- Returns:
- array of property keys which is typically of type
String
orInteger
-
hasProperty
Description copied from interface:IContentProvider
Checks if the given property is supported by this content provider- Specified by:
hasProperty
in interfaceIContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
- Returns:
true
if property is supported
-
getValue
Description copied from interface:IContentProvider
Returns value of the given property- Specified by:
getValue
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- value of the property, can be
null
- Throws:
PropertyNotFoundException
- if property is not supportedELException
-
getType
Description copied from interface:IContentProvider
Returns java type of the given property- Specified by:
getType
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- property java
Class
- Throws:
PropertyNotFoundException
- if property is not supported
-
getNeedRefresh
public boolean getNeedRefresh()Description copied from interface:IRefreshable
Returns
true
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.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.- Specified by:
getNeedRefresh
in interfaceIRefreshable
- 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.
-
isAutoRefresh
public boolean isAutoRefresh()Description copied from interface:IRefreshable
Returnstrue
if the provider is currenlty in auto-refresh mode- Specified by:
isAutoRefresh
in interfaceIRefreshable
- Returns:
- false if auto-refresh mode is off or not supported
-
setAutoRefresh
Description copied from interface:IRefreshable
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 returnstrue
, the provider callsIRefreshable.refresh()
method to updated the result properties.- Specified by:
setAutoRefresh
in interfaceIRefreshable
- Parameters:
autorefresh
- true to turn it on- Throws:
ContentProviderException
- if auto refresh mode is not supported- See Also:
-
setNeedRefresh
public void setNeedRefresh(boolean needRefresh) Description copied from interface:IRefreshable
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 viaIContentProvider.getValue(Object)
.- Specified by:
setNeedRefresh
in interfaceIRefreshable
- Parameters:
needRefresh
-true
if the input parameters have changed
-
supportsAutoRefresh
public boolean supportsAutoRefresh()Description copied from interface:IRefreshable
Returns true if this content provider supports auto refresh feature.- Specified by:
supportsAutoRefresh
in interfaceIRefreshable
- Returns:
- true when auto refresh is supported
- See Also:
-