de.uni_leipzig.wifa.iwi.mr3.dao.neo4j.impl
Class ModelRepositoryDaoNeo4jImpl

Package class diagram package ModelRepositoryDaoNeo4jImpl
java.lang.Object
  extended by de.uni_leipzig.wifa.iwi.mr3.dao.neo4j.impl.ModelRepositoryDaoNeo4jImpl
All Implemented Interfaces:
ModelRepositoryDao

public class ModelRepositoryDaoNeo4jImpl
extends Object
implements ModelRepositoryDao

Implementation of DAO for access to neo4j network database.


Constructor Summary
ModelRepositoryDaoNeo4jImpl()
           
 
Method Summary
 void delete(String nsUri, boolean cascading)
          Deletes the model with the given namespace uri.
 Match[] find(String expression, String[] classifiers, boolean isRegEx, boolean isCaseSensitive)
          Finds all instances of given classifiers that contain given expression.
 String getDatabasePath()
          Getter.
 NeoHelper getHelper()
          Getter.
 String[] getInstanceModels(String metaNsUri)
          Find all instance models of the model with specified nsURI.
 LoadProcessor getLoadProcessor()
          Getter.
 org.neo4j.api.core.NeoService getNeo()
          Getter.
 SaveProcessor getSaveProcessorPhaseOne()
          Getter.
 SaveProcessor getSaveProcessorPhaseTwo()
          Getter.
 SearchProcessor getSearchProcessor()
          Getter.
 org.eclipse.emf.ecore.EObject load(String nsUri, Map<Object,org.eclipse.emf.ecore.EObject> registry)
          Loads the model object with the given namespace uri into the given resource.
 boolean modelExists(String nsUri)
          Checks the existance of a model with the given namespace uri.
 void save(org.eclipse.emf.ecore.resource.Resource resource)
          Save Resource.
 void setDatabasePath(String databasePath)
          Setter.
 void setHelper(NeoHelper helper)
          <<<<<<< .mine Setter.
 void setLoadProcessor(LoadProcessor loadProcessor)
          Setter.
 void setNeo(org.neo4j.api.core.NeoService neo)
          Setter.
 void setSaveProcessorPhaseOne(SaveProcessor saveProcessorPhaseOne)
          Setter.
 void setSaveProcessorPhaseTwo(SaveProcessor saveProcessorPhaseTwo)
          Setter.
 void setSearchProcessor(SearchProcessor searchProcessor)
          Setter.
 void shutDown()
          Lifecycle method.
 void startUp()
          Init the neo node space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelRepositoryDaoNeo4jImpl

public ModelRepositoryDaoNeo4jImpl()
Method Detail

setDatabasePath

public void setDatabasePath(String databasePath)
Setter.

Parameters:
databasePath - the databasePath to set

getDatabasePath

public String getDatabasePath()
Getter.

Returns:
the databasePath

startUp

public void startUp()
Init the neo node space.

Specified by:
startUp in interface ModelRepositoryDao

shutDown

public void shutDown()
Description copied from interface: ModelRepositoryDao
Lifecycle method.

Close all resources.

Specified by:
shutDown in interface ModelRepositoryDao
See Also:
ModelRepositoryDao.shutDown()

setNeo

public void setNeo(org.neo4j.api.core.NeoService neo)
Setter.

Parameters:
neo - the neo to set

getNeo

public org.neo4j.api.core.NeoService getNeo()
Getter.

Returns:
the neo

setHelper

public void setHelper(NeoHelper helper)
<<<<<<< .mine Setter.

Parameters:
helper - the helper to set

getHelper

public NeoHelper getHelper()
Getter.

Returns:
the helper

setSaveProcessorPhaseOne

public void setSaveProcessorPhaseOne(SaveProcessor saveProcessorPhaseOne)
Setter.

Parameters:
saveProcessorPhaseOne - the saveProcessorPhaseOne to set

getSaveProcessorPhaseOne

public SaveProcessor getSaveProcessorPhaseOne()
Getter.

Returns:
the saveProcessorPhaseOne

setSaveProcessorPhaseTwo

public void setSaveProcessorPhaseTwo(SaveProcessor saveProcessorPhaseTwo)
Setter.

Parameters:
saveProcessorPhaseTwo - the saveProcessorPhaseTwo to set

getSaveProcessorPhaseTwo

public SaveProcessor getSaveProcessorPhaseTwo()
Getter.

Returns:
the saveProcessorPhaseTwo

setLoadProcessor

public void setLoadProcessor(LoadProcessor loadProcessor)
Setter.

Parameters:
loadProcessor - the loadProcessor to set

getLoadProcessor

public LoadProcessor getLoadProcessor()
Getter.

Returns:
the loadProcessor

setSearchProcessor

public void setSearchProcessor(SearchProcessor searchProcessor)
Setter.

Parameters:
searchProcessor - the searchProcessor to set

getSearchProcessor

public SearchProcessor getSearchProcessor()
Getter.

Returns:
the searchProcessor

getInstanceModels

public String[] getInstanceModels(String metaNsUri)
Find all instance models of the model with specified nsURI.

Specified by:
getInstanceModels in interface ModelRepositoryDao
Parameters:
metaNsUri - Meta model nsURI
Returns:
Array of all models namespace URIs having xmlns equals given nsURI.
See Also:
ModelRepositoryDao.getInstanceModels(java.lang.String)

modelExists

public boolean modelExists(String nsUri)
Checks the existance of a model with the given namespace uri.

Specified by:
modelExists in interface ModelRepositoryDao
Parameters:
nsUri - a namespace uri
Returns:
true, if the given namespace uri exists
See Also:
ModelRepositoryDao.modelExists(java.lang.String)

save

public void save(org.eclipse.emf.ecore.resource.Resource resource)
          throws MRException
Save Resource.

The resource will be saved under it's nsURI. Any existing model can not be overwritten. In case of existence it must be deleted before saved.

Specified by:
save in interface ModelRepositoryDao
Parameters:
resource - EMF Resource to save
Throws:
MRException - Application logic exception
See Also:
ModelRepositoryDao.save(Resource)

load

public org.eclipse.emf.ecore.EObject load(String nsUri,
                                          Map<Object,org.eclipse.emf.ecore.EObject> registry)
Loads the model object with the given namespace uri into the given resource.

Specified by:
load in interface ModelRepositoryDao
Parameters:
nsUri - a namespace uri
registry - the registry for loaded objects
Returns:
the model to load
See Also:
de.uni_leipzig.wifa.iwi.mr3.dao.ModelRepositoryDao#load(java.lang.String)

delete

public void delete(String nsUri,
                   boolean cascading)
            throws MRException
Deletes the model with the given namespace uri.

Specified by:
delete in interface ModelRepositoryDao
Parameters:
nsUri - a namespace uri
cascading - whether cascading delete model instances of current model.
Throws:
MRException - Application logic exception
See Also:
ModelRepositoryDao.delete(String, boolean)

find

public Match[] find(String expression,
                    String[] classifiers,
                    boolean isRegEx,
                    boolean isCaseSensitive)
Finds all instances of given classifiers that contain given expression.

Specified by:
find in interface ModelRepositoryDao
Parameters:
expression - the expression to search for
classifiers - the classifiers to search in
isRegEx - RegExp search
isCaseSensitive - Case sensitive search
Returns:
the array of found models matching the given expression
See Also:
de.uni_leipzig.wifa.iwi.mr3.dao.ModelRepositoryDao#find(java.lang.String, java.lang.String[])


Copyright © 2010 Uni-Leipzig. All Rights Reserved.