com.bowstreet.builders.webapp.methods
Class CustomDataRetriever

java.lang.Object
  extended by com.bowstreet.util.IXmlProxy
      extended by com.bowstreet.builders.webapp.methods.CustomDataRetriever
All Implemented Interfaces:
DataRetriever, SortableData, com.bowstreet.builders.webapp.methods.TransformPagedResultsProducer, com.bowstreet.builders.webapp.methods.VisualPageSizeConsumer, WebAppAccessConsumer, IXml, com.bowstreet.webapp.RequestCompleteListener

public abstract class CustomDataRetriever
extends com.bowstreet.util.IXmlProxy
implements DataRetriever, com.bowstreet.builders.webapp.methods.VisualPageSizeConsumer, WebAppAccessConsumer, com.bowstreet.builders.webapp.methods.TransformPagedResultsProducer, SortableData, com.bowstreet.webapp.RequestCompleteListener


Field Summary
 
Fields inherited from interface com.bowstreet.builders.webapp.methods.SortableData
CASE_INSENSITIVE, DATES, DEFAULT_TYPE, NUMBERS
 
Constructor Summary
CustomDataRetriever()
           
 
Method Summary
 IXml getData(int startRow)
          Invoke the "getData(int)" method on the DataRetriever in the service producer model.
abstract  int getFetchSize()
          Indicate preferred chunk size for data retrieval.
 IXml getIXml()
          Get paged data as a complete IXml object.
abstract  IXml getResultData(int startRow)
          Use the following method to implement the data retrieval logic
abstract  int getRowCount()
          Return total number of rows in this data set.
 void notifyRequestComplete()
           
 void setProviderModelReference(boolean providerIsStatefull, java.lang.String providerModelName, java.lang.String providerModelProfile)
           
 void setTransformResultMethodName(java.lang.String transformResultMethodName)
          Set the transformation method name
 void setVisualPageSize(int visualPageSize)
           
 void setWebAppAccess(WebAppAccess webAppAccess)
          Associate or disassociate a specific WebAppAccess instance with the object implementing this interface.
 boolean sort(java.lang.String sortBy, java.lang.String sortType, boolean ascending)
          Default implementation for sorting
 
Methods inherited from class com.bowstreet.util.IXmlProxy
addCDATASection, addChildElement, addChildElement, addChildElement, addChildWithText, addText, cloneElement, copyContent, createPath, declareNamespace, declareNamespaces, findElement, getAttribute, getAttribute, getAttributes, getChildren, getChildren, getChildren, getFirstChildElement, getLocalName, getName, getNamespacePrefix, getNamespaceURI, getNextSiblingElement, getParentElement, getPreviousSiblingElement, getText, getText, getUserObject, getValueOf, insertBefore, moveContent, removeAttribute, removeChildElement, removeChildElement, removeChildren, replaceChild, setAttribute, setAttribute, setName, setText, setText, setUserObject, writeHtml, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bowstreet.util.IXml
toString
 

Constructor Detail

CustomDataRetriever

public CustomDataRetriever()
Method Detail

getData

public IXml getData(int startRow)
Invoke the "getData(int)" method on the DataRetriever in the service producer model. Number of rows should be equal to what getFetchSize would return.

Specified by:
getData in interface DataRetriever
Parameters:
startingRow -
Returns:
The next page of data.
See Also:
DataRetriever.getData(int)

getFetchSize

public abstract int getFetchSize()
Indicate preferred chunk size for data retrieval. This method should return the total amount of rows that should be returned when invoking getData

Specified by:
getFetchSize in interface DataRetriever
Parameters:
-
Returns:
Totals rows to be returned

getIXml

public IXml getIXml()
Get paged data as a complete IXml object.

Specified by:
getIXml in class com.bowstreet.util.IXmlProxy
Returns:
an XML object that represents all of the content that could be provided by the wrapped data retriver.

getResultData

public abstract IXml getResultData(int startRow)
Use the following method to implement the data retrieval logic

Parameters:
startingRow -
Returns:
The next page of data.
See Also:
DataRetriever.getData(int)

getRowCount

public abstract int getRowCount()
Return total number of rows in this data set. Implement logic to determine and return the total number of rows available for this data source.

Specified by:
getRowCount in interface DataRetriever
Parameters:
-
Returns:
Total rows available

notifyRequestComplete

public void notifyRequestComplete()
Specified by:
notifyRequestComplete in interface com.bowstreet.webapp.RequestCompleteListener

setProviderModelReference

public void setProviderModelReference(boolean providerIsStatefull,
                                      java.lang.String providerModelName,
                                      java.lang.String providerModelProfile)
Specified by:
setProviderModelReference in interface com.bowstreet.builders.webapp.methods.TransformPagedResultsProducer

setTransformResultMethodName

public void setTransformResultMethodName(java.lang.String transformResultMethodName)
Set the transformation method name

Specified by:
setTransformResultMethodName in interface com.bowstreet.builders.webapp.methods.TransformPagedResultsProducer
Parameters:
transformResultMethodName - This method sets the method name of the data transformation method. This is used by the DataRetriever to run transformation against the retrieved data.

setVisualPageSize

public void setVisualPageSize(int visualPageSize)
Specified by:
setVisualPageSize in interface com.bowstreet.builders.webapp.methods.VisualPageSizeConsumer

setWebAppAccess

public void setWebAppAccess(WebAppAccess webAppAccess)
Description copied from interface: WebAppAccessConsumer
Associate or disassociate a specific WebAppAccess instance with the object implementing this interface. This WebAppAccess instance is only valid until the client calls this method again with a null WebAppAccess value.

Specified by:
setWebAppAccess in interface WebAppAccessConsumer
Parameters:
webAppAccess - The WebAppAccess instance to be used by other methods in the class implementing this interface.

sort

public boolean sort(java.lang.String sortBy,
                    java.lang.String sortType,
                    boolean ascending)
Default implementation for sorting

Specified by:
sort in interface SortableData
Parameters:
sortBy, - sortType, ascending Override this method to provide sorting functionality
Returns:
TRUE if the DataRetriever instance is able to sort the data as directed by the method parameters. FALSE otherwise.


Copyright © 2009 IBM. All Rights Reserved.