de.uni_leipzig.wifa.iwi.mr3.dao
Interface ModelRepositoryDao

Package class diagram package ModelRepositoryDao
All Known Implementing Classes:
ModelRepositoryDaoNeo4jImpl

public interface ModelRepositoryDao

Model repository DAO.


Method Summary
 void delete(String nsUri, boolean cascading)
          Remove the model from repository 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[] getInstanceModels(String metaNsUri)
          Find all model instances of the model with the given nsURI.
 org.eclipse.emf.ecore.EObject load(String nsUri, Map<Object,org.eclipse.emf.ecore.EObject> registry)
          Load model by given namespace URI.
 boolean modelExists(String nsUri)
          Check whether a model exists for the given namespace URI.
 void save(org.eclipse.emf.ecore.resource.Resource resource)
          Save Resource.
 void shutDown()
          Lifecycle method.
 void startUp()
          Initialize the persitence media.
 

Method Detail

startUp

void startUp()
Initialize the persitence media.

Make all stept to create an empty database. This action destroys any existing datastore.


shutDown

void shutDown()
Lifecycle method.

Close all resources.


load

org.eclipse.emf.ecore.EObject load(String nsUri,
                                   Map<Object,org.eclipse.emf.ecore.EObject> registry)
Load model by given namespace URI.

If no model will be found, the return value is null.

Parameters:
nsUri - Namespace URI
registry - the registry for loaded elements
Returns:
Model

save

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.

Try modelExists(String) to test whether the model still exists.

Parameters:
resource - EMF Resource to save
Throws:
MRException - Application logic exception

modelExists

boolean modelExists(String nsUri)
Check whether a model exists for the given namespace URI.

Parameters:
nsUri - Namespace URI to test
Returns:
true if a model exists inside the repository for the given namespace URI, otherwise false

delete

void delete(String nsUri,
            boolean cascading)
            throws MRException
Remove the model from repository with the given namespace URI.

If no model with given namespace URI exists, no action will be taken.

Parameters:
nsUri - Namespace URI of model to delete
cascading - Whether all the instance models shoud also deleted
Throws:
MRException - Application logic exception

getInstanceModels

String[] getInstanceModels(String metaNsUri)
Find all model instances of the model with the given nsURI.

Parameters:
metaNsUri - nsURI of meta model
Returns:
Array of instance model's nsURI.

find

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

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


Copyright © 2010 Uni-Leipzig. All Rights Reserved.