org.compass.gps.device
Class AbstractGpsDeviceWrapper

java.lang.Object
  extended by org.compass.gps.device.AbstractGpsDeviceWrapper
All Implemented Interfaces:
CompassGpsDevice
Direct Known Subclasses:
AbstractMirrorGpsDeviceWrapper, SpringSyncTransactionGpsDeviceWrapper

public class AbstractGpsDeviceWrapper
extends Object
implements CompassGpsDevice

A helper base class that can wrap a CompassGpsDevice and delegate the calls defined at the CompassGpsDevice interface.

Author:
kimchy

Field Summary
protected  CompassGpsDevice gpsDevice
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
AbstractGpsDeviceWrapper()
           
 
Method Summary
protected  void checkDeviceSet()
           
 CompassGps getGps()
          Returns the CompassGps that manages the device.
 String getName()
          Returns the name associated with the device.
 void index(IndexPlan indexPlan)
          Index the device using the given index plan
 void injectGps(CompassGps compassGps)
          Sets the CompassGps that manages the device.
 boolean isPerformingIndexOperation()
          Retuns true if the devide performs the index operaiton.
 boolean isRunning()
          Returns if the device is running.
 void refresh()
          Refresh the given device.
 void setGpsDevice(CompassGpsDevice gpsDevice)
           
 void setName(String name)
          Sets the name associated with the device.
 boolean shouldMirrorDataChanges()
          Returns true if the device is required to perform mirror operation.
 void start()
          Starts the device.
 void stop()
          Stops the device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

gpsDevice

protected CompassGpsDevice gpsDevice
Constructor Detail

AbstractGpsDeviceWrapper

public AbstractGpsDeviceWrapper()
Method Detail

setGpsDevice

public void setGpsDevice(CompassGpsDevice gpsDevice)

getGps

public CompassGps getGps()
Description copied from interface: CompassGpsDevice
Returns the CompassGps that manages the device.

Specified by:
getGps in interface CompassGpsDevice
Returns:
compassGps

injectGps

public void injectGps(CompassGps compassGps)
Description copied from interface: CompassGpsDevice
Sets the CompassGps that manages the device. Optional, since if the device is added to a CompassGps instance, it will be done automatically.

Specified by:
injectGps in interface CompassGpsDevice

getName

public String getName()
Description copied from interface: CompassGpsDevice
Returns the name associated with the device.

Specified by:
getName in interface CompassGpsDevice
Returns:
The name of the device.

setName

public void setName(String name)
Description copied from interface: CompassGpsDevice
Sets the name associated with the device.

Specified by:
setName in interface CompassGpsDevice

start

public void start()
           throws CompassGpsException
Description copied from interface: CompassGpsDevice
Starts the device. Optional, since it is preferable to manage the all the devices through the CompassGps API.

Specified by:
start in interface CompassGpsDevice
Throws:
CompassGpsException

stop

public void stop()
          throws CompassGpsException
Description copied from interface: CompassGpsDevice
Stops the device. Optional, since it is preferable to manage the all the devices through the CompassGps API.

Specified by:
stop in interface CompassGpsDevice
Throws:
CompassGpsException

refresh

public void refresh()
             throws CompassGpsException
Description copied from interface: CompassGpsDevice
Refresh the given device. Mainly used to denote changes in the undeplying Compass instance and that they should be taken into account (such as new mappings).

Specified by:
refresh in interface CompassGpsDevice
Throws:
CompassGpsException

index

public void index(IndexPlan indexPlan)
           throws CompassGpsException,
                  IllegalStateException
Description copied from interface: CompassGpsDevice
Index the device using the given index plan

Specified by:
index in interface CompassGpsDevice
Throws:
CompassGpsException
IllegalStateException

isRunning

public boolean isRunning()
Description copied from interface: CompassGpsDevice
Returns if the device is running.

Specified by:
isRunning in interface CompassGpsDevice
Returns:
true if theh device is running

isPerformingIndexOperation

public boolean isPerformingIndexOperation()
Description copied from interface: CompassGpsDevice
Retuns true if the devide performs the index operaiton.

Specified by:
isPerformingIndexOperation in interface CompassGpsDevice

shouldMirrorDataChanges

public boolean shouldMirrorDataChanges()
Description copied from interface: CompassGpsDevice
Returns true if the device is required to perform mirror operation.

Specified by:
shouldMirrorDataChanges in interface CompassGpsDevice

checkDeviceSet

protected void checkDeviceSet()


Copyright (c) 2004-2008 The Compass Project.