org.compass.gps.impl
Class SingleCompassGps

java.lang.Object
  extended by org.compass.gps.impl.AbstractCompassGps
      extended by org.compass.gps.impl.SingleCompassGps
All Implemented Interfaces:
CompassGps, CompassGpsInterfaceDevice
Direct Known Subclasses:
DefaultJpaCompassGps

public class SingleCompassGps
extends AbstractCompassGps

A CompassGps implementation that holds a single Compass instance. The Compass instance is used for both the index operation and the mirror operation.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.gps.impl.AbstractCompassGps
devices, log
 
Constructor Summary
SingleCompassGps()
           
SingleCompassGps(Compass compass)
           
 
Method Summary
protected  void doIndex(IndexPlan indexPlan)
           
protected  void doStart()
           
protected  void doStop()
           
 void executeForIndex(CompassCallback callback)
          Executes the given callback for index operations.
 void executeForMirror(CompassCallback callback)
          Executes the given callback for mirror operations.
 Compass getIndexCompass()
          Returns the Compass instance used for indexing.
 ResourceMapping getMappingForEntityForIndex(Class clazz)
          Returns the mapping for the given class name when performing the index operation.
 ResourceMapping getMappingForEntityForIndex(String name)
          Returns the mapping of the given name (alias or class name) when performing the index operation.
 Compass getMirrorCompass()
          Returns the Compass instance used for mirroring.
 boolean hasMappingForEntityForIndex(Class clazz)
          Returns true if there is mapping for the given class when performing the index operation.
 boolean hasMappingForEntityForIndex(String name)
          Returns true if there is mapping for the given name (alias or class name) when performing the index operation.
 boolean hasMappingForEntityForMirror(Class clazz, Cascade cascade)
          Returns true if there is mapping for the given class when performing the mirror operation.
 boolean hasMappingForEntityForMirror(String name, Cascade cascade)
          Returns true if there is mapping for the given name (alias or class name) when performing the mirror operation.
 void setCompass(Compass compass)
          Sets the compass instance that will be used with this Gps implementation.
 void setIndexProperties(Properties indexSettings)
          Sets the additional cloned compass index settings.
 void setIndexSettings(CompassSettings indexSettings)
          Sets the additional cloned compass index settings.
 void setIndexSettings(Map<String,Object> indexSettings)
          Sets the additional cloned compass index settings.
 void setIndexSettings(Properties indexSettings)
          Sets the additional cloned compass index settings.
 
Methods inherited from class org.compass.gps.impl.AbstractCompassGps
addGpsDevice, finalize, getGpsDevice, getMappingForEntity, getRootMappingForEntity, getRootMappingForEntity, hasMappingForEntity, hasMappingForEntity, hasRootMappingForEntity, hasRootMappingForEntity, index, index, index, index, isPerformingIndexOperation, isRunning, refresh, setGpsDevices, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleCompassGps

public SingleCompassGps()

SingleCompassGps

public SingleCompassGps(Compass compass)
Method Detail

doStart

protected void doStart()
                throws CompassGpsException
Specified by:
doStart in class AbstractCompassGps
Throws:
CompassGpsException

doStop

protected void doStop()
               throws CompassGpsException
Specified by:
doStop in class AbstractCompassGps
Throws:
CompassGpsException

doIndex

protected void doIndex(IndexPlan indexPlan)
                throws CompassGpsException
Specified by:
doIndex in class AbstractCompassGps
Throws:
CompassGpsException

executeForIndex

public void executeForIndex(CompassCallback callback)
                     throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Executes the given callback for index operations.

Throws:
CompassException

executeForMirror

public void executeForMirror(CompassCallback callback)
                      throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Executes the given callback for mirror operations.

Throws:
CompassException

hasMappingForEntityForIndex

public boolean hasMappingForEntityForIndex(Class clazz)
                                    throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns true if there is mapping for the given class when performing the index operation.

Throws:
CompassException

hasMappingForEntityForIndex

public boolean hasMappingForEntityForIndex(String name)
                                    throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns true if there is mapping for the given name (alias or class name) when performing the index operation.

Throws:
CompassException

hasMappingForEntityForMirror

public boolean hasMappingForEntityForMirror(Class clazz,
                                            Cascade cascade)
                                     throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns true if there is mapping for the given class when performing the mirror operation.

Throws:
CompassException

hasMappingForEntityForMirror

public boolean hasMappingForEntityForMirror(String name,
                                            Cascade cascade)
                                     throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns true if there is mapping for the given name (alias or class name) when performing the mirror operation.

Throws:
CompassException

getMappingForEntityForIndex

public ResourceMapping getMappingForEntityForIndex(String name)
                                            throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns the mapping of the given name (alias or class name) when performing the index operation.

Throws:
CompassException

getMappingForEntityForIndex

public ResourceMapping getMappingForEntityForIndex(Class clazz)
                                            throws CompassException
Description copied from interface: CompassGpsInterfaceDevice
Returns the mapping for the given class name when performing the index operation.

Throws:
CompassException

getIndexCompass

public Compass getIndexCompass()
Description copied from interface: CompassGpsInterfaceDevice
Returns the Compass instance used for indexing. Note that no operations that will affect the index should be made using it, use CompassGpsInterfaceDevice.executeForIndex(CompassCallback) operation instead.


getMirrorCompass

public Compass getMirrorCompass()
Description copied from interface: CompassGpsInterfaceDevice
Returns the Compass instance used for mirroring. Note that no operations that will affect the index should be made using it, use CompassGpsInterfaceDevice.executeForMirror(CompassCallback) operation instead.


setCompass

public void setCompass(Compass compass)
Sets the compass instance that will be used with this Gps implementation. It will be used directly for mirror operations, and will be cloned (optionally adding the setIndexSettings(java.util.Properties) for index operations.


setIndexSettings

public void setIndexSettings(Properties indexSettings)
Sets the additional cloned compass index settings. The settings can override existing settings used to create the Compass instance. Can be used to define different connection string for example.


setIndexSettings

public void setIndexSettings(Map<String,Object> indexSettings)
Sets the additional cloned compass index settings. The settings can override existing settings used to create the Compass instance. Can be used to define different connection string for example.


setIndexProperties

public void setIndexProperties(Properties indexSettings)
Sets the additional cloned compass index settings. The settings can override existing settings used to create the Compass instance. Can be used to define different connection string for example.


setIndexSettings

public void setIndexSettings(CompassSettings indexSettings)
Sets the additional cloned compass index settings. The settings can override existing settings used to create the Compass instance. Can be used to define different connection string for example.



Copyright (c) 2004-2009 The Compass Project.