org.compass.gps.device.ibatis
Class SqlMapClientGpsDevice

java.lang.Object
  extended by org.compass.gps.device.AbstractGpsDevice
      extended by org.compass.gps.device.ibatis.SqlMapClientGpsDevice
All Implemented Interfaces:
CompassGpsDevice

public class SqlMapClientGpsDevice
extends AbstractGpsDevice

A SqlMapClient device, provides support for iBatis 2 and the index operation. The device holds a list of iBatis select statements ids, executes them, and index the result.

The device must be initialized with a SqlMapClient instance. When indexing the data, a SqlMapSession will be opened, and a transaction will be started. The device will then execute the select statement id, and use the iBatis PaginatedList to index the data.

The page size for the PaginatedList can be controlled using the pageSize property.

The select statment can have a parameter object associated with it. If one of the select statements requires a parameter object, than the statementsParameterObjects property must be set. It must have the same size as the selectStatementsIds, and the matching index of the selectStatementsIds should be set at the statementsParameterObjects property.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.gps.device.AbstractGpsDevice
compassGps, log
 
Constructor Summary
SqlMapClientGpsDevice()
           
SqlMapClientGpsDevice(String deviceName, com.ibatis.sqlmap.client.SqlMapClient sqlMapClient, String[] selectStatementsIds)
           
SqlMapClientGpsDevice(String deviceName, com.ibatis.sqlmap.client.SqlMapClient sqlMapClient, String[] selectStatementsIds, Object[] statementsParameterObjects)
           
 
Method Summary
protected  void doIndex(CompassSession session)
          Derived devices must implement the method to perform the actual indexing operation.
protected  void doStart()
          Derived devices can implement it in case of start event notification.
 int getPageSize()
           
 String[] getSelectStatementsIds()
           
 com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
           
 Object[] getStatementsParameterObjects()
           
 void setPageSize(int pageSize)
           
 void setSelectStatementsIds(String[] statementsNames)
           
 void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
           
 void setStatementsParameterObjects(Object[] statementsParameterObjects)
           
 
Methods inherited from class org.compass.gps.device.AbstractGpsDevice
buildMessage, doStop, getGps, getName, index, isFilteredForIndex, isPerformingIndexOperation, isRunning, setFilteredEntitiesForIndex, setGps, setName, shouldMirrorDataChanges, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlMapClientGpsDevice

public SqlMapClientGpsDevice()

SqlMapClientGpsDevice

public SqlMapClientGpsDevice(String deviceName,
                             com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
                             String[] selectStatementsIds)

SqlMapClientGpsDevice

public SqlMapClientGpsDevice(String deviceName,
                             com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
                             String[] selectStatementsIds,
                             Object[] statementsParameterObjects)
Method Detail

doStart

protected void doStart()
                throws CompassGpsException
Description copied from class: AbstractGpsDevice
Derived devices can implement it in case of start event notification.

Overrides:
doStart in class AbstractGpsDevice
Throws:
CompassGpsException

getSqlMapClient

public com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()

setSqlMapClient

public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)

doIndex

protected void doIndex(CompassSession session)
                throws CompassGpsException
Description copied from class: AbstractGpsDevice
Derived devices must implement the method to perform the actual indexing operation.

Specified by:
doIndex in class AbstractGpsDevice
Throws:
CompassGpsException

getSelectStatementsIds

public String[] getSelectStatementsIds()

setSelectStatementsIds

public void setSelectStatementsIds(String[] statementsNames)

getPageSize

public int getPageSize()

setPageSize

public void setPageSize(int pageSize)

getStatementsParameterObjects

public Object[] getStatementsParameterObjects()

setStatementsParameterObjects

public void setStatementsParameterObjects(Object[] statementsParameterObjects)


Copyright (c) 2004-2006 The Compass Project.