SMILA (incubation) API documentation

org.eclipse.smila.connectivity.deltaindexing.jpa.impl
Class DeltaIndexingManagerImpl

java.lang.Object
  extended by org.eclipse.smila.connectivity.deltaindexing.jpa.impl.DeltaIndexingManagerImpl
All Implemented Interfaces:
DeltaIndexingManager

public class DeltaIndexingManagerImpl
extends java.lang.Object
implements DeltaIndexingManager

The Class DeltaIndexingManagerImpl.


Field Summary
static java.lang.String CONFIGURATION_FILE
          name of configuration file.
static java.lang.String PERSISTENCE_UNIT_NAME
          Constant for the eclipseLink persistence unit name.
 
Constructor Summary
DeltaIndexingManagerImpl()
           
 
Method Summary
protected  void activate(ComponentContext context)
          Activate.
 boolean checkForUpdate(Id id, java.lang.String hash)
          checks for the hash of the current id is new or has changed (true) or not (false). // to reduce method calls mark entry as visited on return value false
 void clear()
          Clear.
 void clear(java.lang.String dataSourceID)
          Clear.
protected  void deactivate(ComponentContext context)
          OSGi Declarative Services service deactivation method.
 void delete(Id id)
          Delete.
 boolean exists(java.lang.String dataSourceId)
          Exists.
 void finish(java.lang.String dataSourceID)
          removes the lock.
 void init(java.lang.String dataSourceID)
          initializes the internal state for an import of a dataSourceID and establishes a lock to avoid that the same.
 java.util.Iterator<Id> obsoleteIdIterator(Id id)
          Obsolete id iterator for id fragments.
 java.util.Iterator<Id> obsoleteIdIterator(java.lang.String dataSourceID)
          Obsolete id iterator.
 void rollback(java.lang.String dataSourceID)
          rollbacks changes was made inside init() and finish(), it should be called before finishing process.
 void unlockDatasources()
          Unlock all datasources.
 void visit(Id id, java.lang.String hash)
          updates the hash and marks this id as visited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSISTENCE_UNIT_NAME

public static final java.lang.String PERSISTENCE_UNIT_NAME
Constant for the eclipseLink persistence unit name.

See Also:
Constant Field Values

CONFIGURATION_FILE

public static final java.lang.String CONFIGURATION_FILE
name of configuration file. Hardcoded for now (or fallback), configuration properties should be received from configuration service later.

See Also:
Constant Field Values
Constructor Detail

DeltaIndexingManagerImpl

public DeltaIndexingManagerImpl()
Method Detail

activate

protected void activate(ComponentContext context)
                 throws java.lang.Exception
Activate.

Parameters:
context - the context
Throws:
java.lang.Exception - if any error occurs

deactivate

protected void deactivate(ComponentContext context)
                   throws java.lang.Exception
OSGi Declarative Services service deactivation method. Shuts down BPEL engine.

Parameters:
context - OSGi service component context
Throws:
java.lang.Exception - if any error occurs

init

public void init(java.lang.String dataSourceID)
          throws DeltaIndexingException
initializes the internal state for an import of a dataSourceID and establishes a lock to avoid that the same. dataSourceID ist initialized multiple times concurrently.

Specified by:
init in interface DeltaIndexingManager
Parameters:
dataSourceID - dataSourceID
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.init(java.lang.String)

checkForUpdate

public boolean checkForUpdate(Id id,
                              java.lang.String hash)
                       throws DeltaIndexingException
checks for the hash of the current id is new or has changed (true) or not (false). // to reduce method calls mark entry as visited on return value false

Specified by:
checkForUpdate in interface DeltaIndexingManager
Parameters:
id - the id
hash - the hash
Returns:
true, if check for update
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.checkForUpdate(org.eclipse.smila.datamodel.id.Id, java.lang.String)

visit

public void visit(Id id,
                  java.lang.String hash)
           throws DeltaIndexingException
updates the hash and marks this id as visited.

Specified by:
visit in interface DeltaIndexingManager
Parameters:
id - the id
hash - the hash
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.visit(org.eclipse.smila.datamodel.id.Id, java.lang.String)

obsoleteIdIterator

public java.util.Iterator<Id> obsoleteIdIterator(java.lang.String dataSourceID)
                                          throws DeltaIndexingException
Obsolete id iterator.

Specified by:
obsoleteIdIterator in interface DeltaIndexingManager
Parameters:
dataSourceID - the data source id
Returns:
the iterator< id>
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.obsoleteIdIterator(java.lang.String)

obsoleteIdIterator

public java.util.Iterator<Id> obsoleteIdIterator(Id id)
                                          throws DeltaIndexingException
Obsolete id iterator for id fragments.

Specified by:
obsoleteIdIterator in interface DeltaIndexingManager
Parameters:
id - the id
Returns:
the iterator< id>
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.obsoleteIdIterator(org.eclipse.smila.datamodel.id.Id)

clear

public void clear()
           throws DeltaIndexingException
Clear.

Specified by:
clear in interface DeltaIndexingManager
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.clear()

clear

public void clear(java.lang.String dataSourceID)
           throws DeltaIndexingException
Clear.

Specified by:
clear in interface DeltaIndexingManager
Parameters:
dataSourceID - the data source id
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.clear(java.lang.String)

rollback

public void rollback(java.lang.String dataSourceID)
              throws DeltaIndexingException
rollbacks changes was made inside init() and finish(), it should be called before finishing process.

Specified by:
rollback in interface DeltaIndexingManager
Parameters:
dataSourceID - the data source id
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.rollback(java.lang.String)

delete

public void delete(Id id)
            throws DeltaIndexingException
Delete.

Specified by:
delete in interface DeltaIndexingManager
Parameters:
id - the id
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.delete(org.eclipse.smila.datamodel.id.Id)

finish

public void finish(java.lang.String dataSourceID)
            throws DeltaIndexingException
removes the lock.

Specified by:
finish in interface DeltaIndexingManager
Parameters:
dataSourceID - the data source id
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.finish(java.lang.String)

unlockDatasources

public void unlockDatasources()
                       throws DeltaIndexingException
Unlock all datasources.

Specified by:
unlockDatasources in interface DeltaIndexingManager
Throws:
DeltaIndexingException - the delta indexing exception
See Also:
DeltaIndexingManager.unlockDatasources()

exists

public boolean exists(java.lang.String dataSourceId)
Exists.

Specified by:
exists in interface DeltaIndexingManager
Parameters:
dataSourceId - the data source id
Returns:
true, if successful
See Also:
DeltaIndexingManager.exists(java.lang.String)

SMILA (incubation) API documentation