com.sybase.uep.bobclient.data
Class MobileApplicationDataHandler

java.lang.Object
  extended by com.sybase.uep.bobclient.data.MobileApplicationDataHandler
All Implemented Interfaces:
IMobileApplicationDataHandler
Direct Known Subclasses:
MobileApplicationDataPagingHandler

public class MobileApplicationDataHandler
extends java.lang.Object
implements IMobileApplicationDataHandler

MobileApplicationDataHandler is the base class which provides iteration facility to the mobile application data.

The handler encapsulates the data fetching methods, and delegates the actual data access logic to the MBOModel. Each handler object is responsible of caching the recent retrieved data and can provide the value objects to the consumer(client)

Author:
tqiu

Field Summary
protected  MBOModel _application
           
protected  AppLoggerWrapper _appLogger
           
protected  java.lang.String _dynamicNamedQuery
           
protected  boolean _isSearch
           
protected  java.lang.String _namedQuery
           
protected  java.util.Hashtable _namedQueryParameters
           
protected  java.util.Vector _namedQuerySubmitElements
           
protected  MBOModel _parentApplication
           
protected  java.lang.String _parentAssociationName
           
protected  java.lang.Object _parentSelectedRow
           
protected  Query _query
           
protected  java.util.Vector _rows
           
protected  int _size
           
protected static java.lang.String FIND_ALL
           
 
Constructor Summary
MobileApplicationDataHandler()
           
 
Method Summary
 void clearCachedRows()
          Clears the cached rows in the handler
 MBOModel getApplicationData()
           
 java.lang.String getDynamicNamedQuery()
          Get the dynamic named query name
 java.util.Hashtable getDynamicNamedQueryParameters()
          Get the dynamic named query parameters hash table
 java.lang.String getNamedQuery()
          Get the named query name
 java.util.Hashtable getNamedQueryParameters()
          Get the named query parameters hash table
 java.util.Vector getNamedQuerySubmitElements()
          Get the named query submit elements
 Query getQuery()
          Returns the query object
 java.lang.Object getRow(int rowIndex)
           
 java.util.Vector getRows()
           
 int getSize()
           
protected  boolean isFetchingThroughRelationship()
          Utility method to determine whether the data should be fetched through a relationship query
 void setDynamicNamedQuery(java.lang.String namedQuery)
          Set the dynamic named query name
 void setDynamicNamedQueryParameters(java.util.Hashtable parameters)
          Set the dynamic named query parameters hash table
 void setMobileApplication(MBOModel application)
          Sets the motile application to the data handler, calling this method would clear the cached rows if necessary
 void setNamedQuery(java.lang.String namedQuery)
          Set the named query name
 void setNamedQueryParameters(java.util.Hashtable parameters)
          Set the named query parameters hash table
 void setNamedQuerySubmitElements(java.util.Vector parameters)
          Set the named query submit elements
 void setQuery(Query query)
          Sets the query object to the data handler
 void setRelationshipData(MBOModel parentApplication, java.lang.Object parentSelectedRow, java.lang.String associationName)
          Sets the relationship data to the handler, including parent MBO,parent selected row and association name
 void setSearch(boolean isSearch)
          Sets if the query is for a search
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rows

protected java.util.Vector _rows

_application

protected MBOModel _application

_parentApplication

protected MBOModel _parentApplication

_parentSelectedRow

protected java.lang.Object _parentSelectedRow

_parentAssociationName

protected java.lang.String _parentAssociationName

_query

protected Query _query

_size

protected int _size

_appLogger

protected AppLoggerWrapper _appLogger

_isSearch

protected boolean _isSearch

_namedQuery

protected java.lang.String _namedQuery

_namedQuerySubmitElements

protected java.util.Vector _namedQuerySubmitElements

_namedQueryParameters

protected java.util.Hashtable _namedQueryParameters

_dynamicNamedQuery

protected java.lang.String _dynamicNamedQuery

FIND_ALL

protected static final java.lang.String FIND_ALL
See Also:
Constant Field Values
Constructor Detail

MobileApplicationDataHandler

public MobileApplicationDataHandler()
Method Detail

getSize

public int getSize()
Specified by:
getSize in interface IMobileApplicationDataHandler
Returns:
the total size of the returned results

getRows

public java.util.Vector getRows()
Specified by:
getRows in interface IMobileApplicationDataHandler
Returns:
the cached rows in the handler instance

getRow

public java.lang.Object getRow(int rowIndex)
Specified by:
getRow in interface IMobileApplicationDataHandler
Returns:
the value object fetched at the given index

clearCachedRows

public void clearCachedRows()
Description copied from interface: IMobileApplicationDataHandler
Clears the cached rows in the handler

Specified by:
clearCachedRows in interface IMobileApplicationDataHandler

isFetchingThroughRelationship

protected boolean isFetchingThroughRelationship()
Utility method to determine whether the data should be fetched through a relationship query

Returns:
true if client is requesting a relationship search

setRelationshipData

public void setRelationshipData(MBOModel parentApplication,
                                java.lang.Object parentSelectedRow,
                                java.lang.String associationName)
Description copied from interface: IMobileApplicationDataHandler
Sets the relationship data to the handler, including parent MBO,parent selected row and association name

Specified by:
setRelationshipData in interface IMobileApplicationDataHandler

setMobileApplication

public void setMobileApplication(MBOModel application)
Description copied from interface: IMobileApplicationDataHandler
Sets the motile application to the data handler, calling this method would clear the cached rows if necessary

Specified by:
setMobileApplication in interface IMobileApplicationDataHandler

setQuery

public void setQuery(Query query)
Description copied from interface: IMobileApplicationDataHandler
Sets the query object to the data handler

Specified by:
setQuery in interface IMobileApplicationDataHandler

setNamedQuery

public void setNamedQuery(java.lang.String namedQuery)
Description copied from interface: IMobileApplicationDataHandler
Set the named query name

Specified by:
setNamedQuery in interface IMobileApplicationDataHandler
Parameters:
namedQuery - String value for the named query

getNamedQuery

public java.lang.String getNamedQuery()
Description copied from interface: IMobileApplicationDataHandler
Get the named query name

Specified by:
getNamedQuery in interface IMobileApplicationDataHandler
Returns:

setNamedQuerySubmitElements

public void setNamedQuerySubmitElements(java.util.Vector parameters)
Description copied from interface: IMobileApplicationDataHandler
Set the named query submit elements

Specified by:
setNamedQuerySubmitElements in interface IMobileApplicationDataHandler
Parameters:
parameters - Vector list of SubmitElement objects

getNamedQuerySubmitElements

public java.util.Vector getNamedQuerySubmitElements()
Description copied from interface: IMobileApplicationDataHandler
Get the named query submit elements

Specified by:
getNamedQuerySubmitElements in interface IMobileApplicationDataHandler
Returns:

setNamedQueryParameters

public void setNamedQueryParameters(java.util.Hashtable parameters)
Set the named query parameters hash table

Specified by:
setNamedQueryParameters in interface IMobileApplicationDataHandler
Parameters:
parameters - Vector list of name value pair

getNamedQueryParameters

public java.util.Hashtable getNamedQueryParameters()
Description copied from interface: IMobileApplicationDataHandler
Get the named query parameters hash table

Specified by:
getNamedQueryParameters in interface IMobileApplicationDataHandler
Returns:

setDynamicNamedQuery

public void setDynamicNamedQuery(java.lang.String namedQuery)
Description copied from interface: IMobileApplicationDataHandler
Set the dynamic named query name

Specified by:
setDynamicNamedQuery in interface IMobileApplicationDataHandler
Parameters:
namedQuery - String value for the dynamic named query

getDynamicNamedQuery

public java.lang.String getDynamicNamedQuery()
Description copied from interface: IMobileApplicationDataHandler
Get the dynamic named query name

Specified by:
getDynamicNamedQuery in interface IMobileApplicationDataHandler
Returns:
the dynamic named query name

setDynamicNamedQueryParameters

public void setDynamicNamedQueryParameters(java.util.Hashtable parameters)
Description copied from interface: IMobileApplicationDataHandler
Set the dynamic named query parameters hash table

Specified by:
setDynamicNamedQueryParameters in interface IMobileApplicationDataHandler
Parameters:
parameters - Vector list of name value pair

getDynamicNamedQueryParameters

public java.util.Hashtable getDynamicNamedQueryParameters()
Description copied from interface: IMobileApplicationDataHandler
Get the dynamic named query parameters hash table

Specified by:
getDynamicNamedQueryParameters in interface IMobileApplicationDataHandler
Returns:
the dynamic named query parameters hash table

getQuery

public Query getQuery()
Description copied from interface: IMobileApplicationDataHandler
Returns the query object

Specified by:
getQuery in interface IMobileApplicationDataHandler
Returns:
Query

getApplicationData

public MBOModel getApplicationData()
Specified by:
getApplicationData in interface IMobileApplicationDataHandler
Returns:
the application data maintained in the data handler

setSearch

public void setSearch(boolean isSearch)
Description copied from interface: IMobileApplicationDataHandler
Sets if the query is for a search

Specified by:
setSearch in interface IMobileApplicationDataHandler
Parameters:
isSearch - - true if the query is for a search