org.compass.gps
Interface CompassGpsDevice

All Known Subinterfaces:
ActiveMirrorGpsDevice, JdbcActiveMirrorGpsDevice, JdbcGpsDevice, MirrorDataChangesGpsDevice, PassiveMirrorGpsDevice
All Known Implementing Classes:
AbstractGpsDevice, AbstractGpsDeviceWrapper, AbstractHibernateGpsDevice, AbstractJdbcActiveMirrorGpsDevice, AbstractJdbcGpsDevice, AbstractMirrorGpsDevice, AbstractMirrorGpsDeviceWrapper, AbstractParallelGpsDevice, Hibernate3GpsDevice, HibernateGpsDevice, JpaGpsDevice, ResultSetJdbcGpsDevice, ScheduledMirrorGpsDevice, SpringHibernate3GpsDevice, SqlMapClientGpsDevice

public interface CompassGpsDevice

A Compass Gps Device is responsible for interacting with a data source and reflecting it in a compass index. A data source can be a file system, or a database through the use of ORM tool (like hibernate).

A device should be able to provide the ability to index the data source, which usually means iterating through the device data and indexing it. It might also provide "real time" monitoring of changes in the device, and applying them to the index as well.

A CompassGpsDevice can not operate as a standalone, and must be a part of a CompassGps instance (even if we have only one device), since the device requires the Compass and the Batch Compass instances in order to apply the changes to the index.

The device has a name associated with it, and the name must be unique among all the devices within a single CompassGps instance.

Author:
kimchy

Method Summary
 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 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.
 

Method Detail

getName

String getName()
Returns the name associated with the device.

Returns:
The name of the device.

setName

void setName(String name)
Sets the name associated with the device.


injectGps

void injectGps(CompassGps compassGps)
Sets the CompassGps that manages the device. Optional, since if the device is added to a CompassGps instance, it will be done automatically.


getGps

CompassGps getGps()
Returns the CompassGps that manages the device.

Returns:
compassGps

start

void start()
           throws CompassGpsException
Starts the device. Optional, since it is preferable to manage the all the devices through the CompassGps API.

Throws:
CompassGpsException

stop

void stop()
          throws CompassGpsException
Stops the device. Optional, since it is preferable to manage the all the devices through the CompassGps API.

Throws:
CompassGpsException

refresh

void refresh()
             throws CompassGpsException
Refresh the given device. Mainly used to denote changes in the underlying Compass instance and that they should be taken into account (such as new mappings).

Throws:
CompassGpsException

isRunning

boolean isRunning()
Returns if the device is running.

Returns:
true if theh device is running

index

void index(IndexPlan indexPlan)
           throws CompassGpsException,
                  IllegalStateException
Index the device using the given index plan

Throws:
CompassGpsException
IllegalStateException

isPerformingIndexOperation

boolean isPerformingIndexOperation()
Retuns true if the devide performs the index operaiton.


shouldMirrorDataChanges

boolean shouldMirrorDataChanges()
Returns true if the device is required to perform mirror operation.



Copyright (c) 2004-2009 The Compass Project.