diff --git a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/core/DefaultPersistentEObject.java b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/core/DefaultPersistentEObject.java index 206ab2b3b0..99096faadb 100644 --- a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/core/DefaultPersistentEObject.java +++ b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/core/DefaultPersistentEObject.java @@ -47,7 +47,7 @@ * This class extends {@link MinimalEStoreEObjectImpl} that delegates {@link EStructuralFeature} accesses * to an underlying {@link EStore} that interacts with the database used to store the model. *

- * {@link DefaultPersistentEObject}s is backend-agnostic, and is as an EMF-level element wrapper in all + * {@link DefaultPersistentEObject}s is backend-agnostic, and is as an EMF-level element wrapper in all * existing database implementations. */ public class DefaultPersistentEObject extends MinimalEStoreEObjectImpl implements PersistentEObject { diff --git a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/data/store/FeatureCachingStoreDecorator.java b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/data/store/FeatureCachingStoreDecorator.java index 46c6b2c972..67e5eefc04 100644 --- a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/data/store/FeatureCachingStoreDecorator.java +++ b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/data/store/FeatureCachingStoreDecorator.java @@ -115,9 +115,11 @@ public void clear(InternalEObject internalObject, EStructuralFeature feature) { /** * Remove cached elements, from an initial {@code index} to the size of an element. * - * @param internalObject ??? - * @param feature ??? - * @param index ??? + * @param internalObject the concerned object + * @param feature the feature of the {@code internalObject} + * @param index the index from which to start the removing + * + * @see FeatureKey#from(InternalEObject, EStructuralFeature) */ private void invalidateValues(InternalEObject internalObject, EStructuralFeature feature, int index) { FeatureKey featureKey = FeatureKey.from(internalObject, feature); diff --git a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/DefaultPersistentResource.java b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/DefaultPersistentResource.java index a36c4c02aa..8465c26727 100644 --- a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/DefaultPersistentResource.java +++ b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/DefaultPersistentResource.java @@ -58,8 +58,8 @@ /** * The default implementation of a {@link PersistentResource} that contains {@link PersistentEObject}. *

- * {@link DefaultPersistentResource}s is backend-agnostic and only delegates model element operations - * to its internal {@link PersistentStore} which is reponsible of database access. + * {@link DefaultPersistentResource}s is backend-agnostic and only delegates model element operations + * to its internal {@link PersistentStore} which is responsible of database access. */ public class DefaultPersistentResource extends ResourceImpl implements PersistentResource { @@ -312,19 +312,19 @@ public DummyRootEObject(Resource.Internal resource) { private static class PersistenceBackendShutdownHook extends Thread { /** - * The backend to stop when the application will exit + * The back-end to stop when the application will exit. */ private final PersistenceBackend backend; /** - * The {@link URI} of the resource used by the {@code backend} + * The {@link URI} of the resource used by the {@code backend}. */ private final URI uri; /** * Creates a new {@code PersistenceBackendShutdownHook} with the given {@code backend}. * - * @param backend the backend to stop when the application will exit + * @param backend the back-end to stop when the application will exit * @param uri the {@link URI} of the resource used by the {@code backend} */ private PersistenceBackendShutdownHook(PersistenceBackend backend, URI uri) { @@ -335,7 +335,7 @@ private PersistenceBackendShutdownHook(PersistenceBackend backend, URI uri) { /** * Adds a shutdown hook on the given {@code backend}. It will be stopped when the application will exit. * - * @param backend the backend to stop when the application will exit + * @param backend the back-end to stop when the application will exit * @param uri the {@link URI} of the resource used by the {@code backend} */ public static void closeOnExit(PersistenceBackend backend, URI uri) { diff --git a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/PersistentResource.java b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/PersistentResource.java index 6830948907..be342d6de0 100644 --- a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/PersistentResource.java +++ b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/resource/PersistentResource.java @@ -14,7 +14,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.InternalEObject.EStore; import org.eclipse.emf.ecore.resource.Resource; @@ -22,8 +21,8 @@ /** * Extends the {@link Resource} interface by providing efficient model-level operations that - * are not accessible using the standard EMF API. For example, {@code getAllInstances} is a - * utility method that computes efficiently all the instances of a given type by delegating the + * are not accessible using the standard EMF API. For example, {@code getAllInstances} is a + * utility method that computes efficiently all the instances of a given type by delegating the * operation to the underlying database, that can benefits of its internal optimizations and indices. */ public interface PersistentResource extends Resource, Resource.Internal, Closeable { @@ -32,10 +31,11 @@ public interface PersistentResource extends Resource, Resource.Internal, Closeab void close(); /** + * Returns the {@link EStore} used to store the model. * - * @return the {@link EStore} used to store the model + * @return the {@link EStore} */ - InternalEObject.EStore eStore(); + EStore eStore(); /** * Computes the set of instances of the given {@link EClass} (including its sub-types). diff --git a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/util/NeoEContentsEList.java b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/util/NeoEContentsEList.java index 5309cc5eea..33713d57b2 100644 --- a/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/util/NeoEContentsEList.java +++ b/neoemf-core/src/main/java/fr/inria/atlanmod/neoemf/util/NeoEContentsEList.java @@ -125,7 +125,7 @@ public E get(int index) { } /** - * ??? + * An empty {@code NeoEContentsEList}. * * @param the type of elements in this list */ diff --git a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/annotations/package-info.java b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/annotations/package-info.java index f358339897..2d9dca1657 100644 --- a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/annotations/package-info.java +++ b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/annotations/package-info.java @@ -13,4 +13,4 @@ * Provides common annotation types. */ -package fr.inria.atlanmod.neoemf.core; \ No newline at end of file +package fr.inria.atlanmod.neoemf.annotations; \ No newline at end of file diff --git a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/core/package-info.java b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/core/package-info.java index 9a3feaabeb..43b8da269c 100644 --- a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/core/package-info.java +++ b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/core/package-info.java @@ -10,7 +10,7 @@ */ /** - * TODO: Provides... + * Provides the base classes that extends EMF API to enable lazy-loading of model elements. */ package fr.inria.atlanmod.neoemf.core; \ No newline at end of file diff --git a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/package-info.java b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/package-info.java index 9a3feaabeb..1793cae136 100644 --- a/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/package-info.java +++ b/neoemf-core/src/main/javadoc/fr/inria/atlanmod/neoemf/package-info.java @@ -10,7 +10,7 @@ */ /** - * TODO: Provides... + * Provides all NeoEMF features. */ -package fr.inria.atlanmod.neoemf.core; \ No newline at end of file +package fr.inria.atlanmod.neoemf; \ No newline at end of file diff --git a/neoemf-core/src/test/java/fr/inria/atlanmod/neoemf/data/AbstractPersistenceBackendFactoryTest.java b/neoemf-core/src/test/java/fr/inria/atlanmod/neoemf/data/AbstractPersistenceBackendFactoryTest.java index e8b15679a1..b31817836d 100644 --- a/neoemf-core/src/test/java/fr/inria/atlanmod/neoemf/data/AbstractPersistenceBackendFactoryTest.java +++ b/neoemf-core/src/test/java/fr/inria/atlanmod/neoemf/data/AbstractPersistenceBackendFactoryTest.java @@ -26,6 +26,21 @@ public abstract class AbstractPersistenceBackendFactoryTest extends AbstractUnit private static final String INNER_BACKEND_FIELDNAME = "backend"; + private static F getField(Object object, String fieldName, Class in, Class out) { + if (!in.isInstance(object)) { + throw new IllegalArgumentException(); + } + + try { + Field storeField = in.getDeclaredField(fieldName); + storeField.setAccessible(true); + return out.cast(storeField.get(object)); + } + catch (NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } + protected PersistentStore getInnerStore(InternalEObject.EStore store) { return getField(store, INNER_STORE_FIELDNAME, AbstractPersistentStoreDecorator.class, PersistentStore.class); } @@ -42,19 +57,4 @@ protected PersistenceBackend getInnerBackend(InternalEObject.EStore store) { return innerBackend; } - - private static F getField(Object object, String fieldName, Class in, Class out) { - if (!in.isInstance(object)) { - throw new IllegalArgumentException(); - } - - try { - Field storeField = in.getDeclaredField(fieldName); - storeField.setAccessible(true); - return out.cast(storeField.get(object)); - } - catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } } diff --git a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackend.java b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackend.java index 37436bc199..a9248242db 100644 --- a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackend.java +++ b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackend.java @@ -323,11 +323,11 @@ private void setMappedVertex(Vertex vertex, PersistentEObject object) { } /** - * ??? + * Compute the {@link EClass} associated to the model element with the provided {@link Vertex}. * - * @param vertex ??? + * @param vertex the {@link Vertex} of the model element to compute the {@link EClass} from * - * @return ??? + * @return an {@link EClass} representing the metaclass of the element */ private EClass resolveInstanceOf(Vertex vertex) { EClass eClass = null; diff --git a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackendFactory.java b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackendFactory.java index 1e279f03c2..6f55b935cc 100644 --- a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackendFactory.java +++ b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/BlueprintsPersistenceBackendFactory.java @@ -206,14 +206,15 @@ public void copyBackend(PersistenceBackend from, PersistenceBackend to) { } /** - * ??? + * Creates and saves the Blueprints configuration. * - * @param directory ??? - * @param options ??? + * @param directory the directory where the configuration must be stored + * @param options options to define the behavior of Blueprints * - * @return ??? + * @return the created configuration * - * @throws InvalidDataStoreException if ??? + * @throws InvalidDataStoreException if the configuration cannot be created in the {@code directory}, or if some + * {@code options} are missing or invalid. */ private PropertiesConfiguration getOrCreateBlueprintsConfiguration(File directory, Map options) throws InvalidDataStoreException { PropertiesConfiguration configuration; diff --git a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/AbstractBlueprintsOptionsBuilder.java b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/AbstractBlueprintsOptionsBuilder.java index 55faaf284f..a760fa2560 100644 --- a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/AbstractBlueprintsOptionsBuilder.java +++ b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/AbstractBlueprintsOptionsBuilder.java @@ -13,6 +13,7 @@ import fr.inria.atlanmod.neoemf.data.blueprints.store.DirectWriteBlueprintsCacheManyStore; import fr.inria.atlanmod.neoemf.data.blueprints.store.DirectWriteBlueprintsStore; +import fr.inria.atlanmod.neoemf.data.store.AutocommitStoreDecorator; import fr.inria.atlanmod.neoemf.option.AbstractPersistenceOptionsBuilder; import fr.inria.atlanmod.neoemf.option.PersistenceOptions; import fr.inria.atlanmod.neoemf.option.PersistenceOptionsBuilder; @@ -58,6 +59,7 @@ protected B graph(String graphType) { * @return this builder (for chaining) * * @see BlueprintsStoreOptions#AUTOCOMMIT + * @see AutocommitStoreDecorator */ public B autocommit() { return storeOption(BlueprintsStoreOptions.AUTOCOMMIT); @@ -71,6 +73,7 @@ public B autocommit() { * @return this builder (for chaining) * * @see BlueprintsStoreOptions#AUTOCOMMIT + * @see AutocommitStoreDecorator */ public B autocommit(int chunk) { storeOption(BlueprintsStoreOptions.AUTOCOMMIT); diff --git a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/BlueprintsStoreOptions.java b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/BlueprintsStoreOptions.java index ed7833d3c0..b8f08f39c1 100644 --- a/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/BlueprintsStoreOptions.java +++ b/neoemf-data/blueprints/core/src/main/java/fr/inria/atlanmod/neoemf/data/blueprints/option/BlueprintsStoreOptions.java @@ -14,8 +14,11 @@ import fr.inria.atlanmod.neoemf.data.blueprints.store.DirectWriteBlueprintsCacheManyStore; import fr.inria.atlanmod.neoemf.data.blueprints.store.DirectWriteBlueprintsStore; import fr.inria.atlanmod.neoemf.data.store.AutocommitStoreDecorator; +import fr.inria.atlanmod.neoemf.data.store.DirectWriteStore; import fr.inria.atlanmod.neoemf.option.PersistentStoreOptions; +import org.eclipse.emf.ecore.EReference; + /** * {@link PersistentStoreOptions} that hold Blueprints related database access features, such as autocommit or direct * write behavior. @@ -27,17 +30,24 @@ public enum BlueprintsStoreOptions implements PersistentStoreOptions { /** - * ??? + * Automatically saves modifications as calls are made. + * + * @see AutocommitStoreDecorator */ AUTOCOMMIT, /** - * ??? + * Translates model-level operations to Blueprints calls (default {@link DirectWriteStore}). + * + * @see DirectWriteBlueprintsStore */ DIRECT_WRITE, /** - * ??? + * Translates model-level operations to Blueprints calls, and uses an internal cache to store elements that are + * part of multi-valued {@link EReference}s to speed-up their access. + * + * @see DirectWriteBlueprintsCacheManyStore */ CACHE_MANY } diff --git a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/configuration/package-info.java b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/configuration/package-info.java index 6796a062b0..5c99c172bb 100644 --- a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/configuration/package-info.java +++ b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/configuration/package-info.java @@ -11,9 +11,9 @@ /** * Provides utility configuration classes that are dynamically called to setup Blueprints databases. - * - * @note The classes in this package have to be overriden for each backend implementation that has to - * perform some startup configuration. + * + * @note The classes in this package have to be overriden for each back-end implementation that has to perform some + * startup configuration. */ package fr.inria.atlanmod.neoemf.data.blueprints.configuration; \ No newline at end of file diff --git a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/io/package-info.java b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/io/package-info.java index 104febab5c..c48e3d1de0 100644 --- a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/io/package-info.java +++ b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/io/package-info.java @@ -10,11 +10,13 @@ */ /** - * Provides Blueprints' specific readers and writers used in the {@code io} module to save and persist models from external sources. + * Provides Blueprints' specific readers and writers used in the {@code io} module to save and persist models from + * external sources. *

- * Providing efficient model import and export is tightly coupled to the database and the data representation. In order to provide this - * feature, a backend module should contain an I/O specific package that overrides {@link fr.inria.atlanmod.neoemf.io.persistence.AbstractPersistenceHandler}. - * + * Providing efficient model import and export is tightly coupled to the database and the data representation. In order + * to provide this feature, a back-end module should contain an I/O specific package that overrides {@link + * fr.inria.atlanmod.neoemf.io.persistence.AbstractPersistenceHandler}. + * * @see fr.inria.atlanmod.neoemf.io.persistence.AbstractPersistenceHandler */ diff --git a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/option/package-info.java b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/option/package-info.java index 9785b384bc..7bf90ad4cc 100644 --- a/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/option/package-info.java +++ b/neoemf-data/blueprints/core/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/option/package-info.java @@ -11,10 +11,9 @@ /** * Provides utility classes to define specific behaviors of Blueprints data persistence. - * - * @note Options defined using the classes inside this package are usable for each Blueprints - * implementation. For backend-specific configuration refers to the corresponding package in the - * backend plugin. + * + * @note Options defined using the classes inside this package are usable for each Blueprints implementation. For + * backend-specific configuration refers to the corresponding package in the backend plugin. */ package fr.inria.atlanmod.neoemf.data.blueprints.option; \ No newline at end of file diff --git a/neoemf-data/blueprints/neo4j/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/neo4j/option/package-info.java b/neoemf-data/blueprints/neo4j/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/neo4j/option/package-info.java index 4d3b5269b3..768f45697a 100644 --- a/neoemf-data/blueprints/neo4j/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/neo4j/option/package-info.java +++ b/neoemf-data/blueprints/neo4j/src/main/javadoc/fr/inria/atlanmod/neoemf/data/blueprints/neo4j/option/package-info.java @@ -11,11 +11,9 @@ /** * Provides utility classes to define specific behaviors of Neo4j data persistence. - * - * @note Options defined using the classes inside this package are only usable with Neo4j as the concrete - * implementation of the Blueprints API. Neo4j specific options can be combined with Blueprints generic - * options. - * + * + * @note Options defined using the classes inside this package are only usable with Neo4j as the concrete implementation + * of the Blueprints API. Neo4j specific options can be combined with Blueprints generic options. * @see fr.inria.atlanmod.neoemf.data.blueprints.option.BlueprintsOptionsBuilder */ diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackend.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackend.java index 5aba9c71dd..ec6e23d62a 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackend.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackend.java @@ -20,12 +20,12 @@ * Mock {@link PersistenceBackend} implementation for HBase to fit core architecture. *

* This class does not access HBase database, but is here to fit the requirement of the - * core architecture. For historical reasons the real access to the HBase Table + * core architecture. For historical reasons the real access to the HBase Table * is done in {@link DirectWriteHBaseStore} and {@link ReadOnlyHBaseStore}. *

- * Moving HBase access to this class to fit NeoEMF backend architecture is planned in + * Moving HBase access to this class to fit NeoEMF back-end architecture is planned in * a future release. - * + * * @see DirectWriteHBaseStore * @see ReadOnlyHBaseStore */ diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackendFactory.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackendFactory.java index 7d260313eb..34afdfd1fa 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackendFactory.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/HBasePersistenceBackendFactory.java @@ -36,15 +36,15 @@ /** * A factory that creates instances of {@link HBasePersistenceBackend}. *

- * This class only creates persistent databases that can be configured using + * This class only creates persistent databases that can be configured using * {@link PersistentResource#save(Map)} and {@link PersistentResource#load(Map)} * options maps. *

- * Note that transient backends can be instantiated using this factory, but they will + * Note that transient back-ends can be instantiated using this factory, but they will * be handed as persistent ones. This is a limitation that will be solved in next releases. * To avoid any consistency issue we recommend every HBase resource right after their creation, - * ensuring the resource is using a persistent backend. - * + * ensuring the resource is using a persistent back-end. + * * @see PersistentResource * @see HBasePersistenceBackend * @see HBaseOptionsBuilder diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/option/HBaseResourceOptions.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/option/HBaseResourceOptions.java index cdad0a9400..521a74d942 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/option/HBaseResourceOptions.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/option/HBaseResourceOptions.java @@ -11,6 +11,7 @@ package fr.inria.atlanmod.neoemf.data.hbase.option; +import fr.inria.atlanmod.neoemf.data.hbase.store.ReadOnlyHBaseStore; import fr.inria.atlanmod.neoemf.option.PersistentResourceOptions; /** @@ -19,7 +20,9 @@ public interface HBaseResourceOptions extends PersistentResourceOptions { /** - * The key value to set the {@code read-only} nature of the resource. + * Only allows read operations on the underlying database. + * + * @see ReadOnlyHBaseStore */ String READ_ONLY = "hbase.readOnly"; } \ No newline at end of file diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/DirectWriteHBaseStore.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/DirectWriteHBaseStore.java index 5fb6d696db..6674476374 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/DirectWriteHBaseStore.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/DirectWriteHBaseStore.java @@ -66,15 +66,14 @@ * An {@link AbstractDirectWriteStore} that translates model-level operations to HBase operations. *

* This class implements the {@link PersistentStore} interface that defines a set of operations to implement in order to - * allow EMF persistence delegation. If this store is used, every method call and property access on {@link PersistentEObject} - * is forwarded to this class, that takes care of the serialization/deserialization from/to HBase. - *

- * @note For historical purposes this class does not use a {@link HBasePersistenceBackend}, instead, - * it accesses HBase directly using the low-level database API. + * allow EMF persistence delegation. If this store is used, every method call and property access on {@link + * PersistentEObject} is forwarded to this class, that takes care of the serialization/deserialization from/to HBase. + * + * @note For historical purposes this class does not use a {@link HBasePersistenceBackend}, instead, it accesses HBase + * directly using the low-level database API. *

- * This store can be used as a base store that can be complemented by plugging decorator stores on top of it - * (see {@link AbstractPersistentStoreDecorator} subclasses) to provide additional features such as caching or logging. - * + * This store can be used as a base store that can be complemented by plugging decorator stores on top of it (see {@link + * AbstractPersistentStoreDecorator} subclasses) to provide additional features such as caching or logging. * @see PersistentEObject * @see HBasePersistenceBackend * @see AbstractDirectWriteStore @@ -172,7 +171,7 @@ public DirectWriteHBaseStore(Resource.Internal resource) throws IOException { * * @param connection the connection to the HBase server * @param tableName the name of the table to access on the server - * @param admin the administrator client of the HBase server + * @param admin the administrator client of the HBase server * * @return the created HBase table containing the columns and column families to store the model * @@ -194,12 +193,13 @@ protected Table initTable(Connection connection, TableName tableName, Admin admi /** * A specific implementation of {@link EStore#add(InternalEObject, EStructuralFeature, int, Object)} that takes - * benefit of the HBase facilities to append an element in a multi-valued {@link EReference} without deserializing + * benefit of the HBase facilities to append an element in a multi-valued {@link EReference} without de-serializing * the entire collection. * * @param object the source element - * @param reference the multi-valued {@link EReference} - * @param atEnd {@code true} to append {@code referencedObject} at the end of the collection, {@code false} to put it at the beginning (if the persisted collection is empty) + * @param reference the multi-valued {@link EReference} + * @param atEnd {@code true} to append {@code referencedObject} at the end of the collection, {@code + * false} to put it at the beginning (if the persisted collection is empty) * @param referencedObject the {@link PersistentEObject} to append * * @throws IOException if the HBase database cannot be found @@ -319,7 +319,7 @@ protected void updateContainment(PersistentEObject object, EReference reference, } /** - * Computes {@code object}'s metaclass informations and persists them in the database. + * Computes {@code object}'s metaclass information and persists them in the database. * * @param object the {@link PersistentEObject} to persist the metaclass of */ diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/ReadOnlyHBaseStore.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/ReadOnlyHBaseStore.java index 36b71e25bc..2b239560b0 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/ReadOnlyHBaseStore.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/store/ReadOnlyHBaseStore.java @@ -42,17 +42,17 @@ * A {@link DirectWriteHBaseStore} that only allows read operations on the underlying database. *

* Read-only configuration allows to access model element faster, without checking value consistency - * between database calls. This store reimplements all the mutators and throws an + * between database calls. This store re-implements all the mutators and throws an * {@link UnsupportedOperationException} when they are called, preventing resource corruption. *

- * * This store can be used as a base store that can be complemented by plugging decorator stores on top of it + * * This store can be used as a base store that can be complemented by plugging decorator stores on top of it * (see {@link AbstractPersistentStoreDecorator} subclasses) to provide additional features such as caching or logging. - * */ public class ReadOnlyHBaseStore extends DirectWriteHBaseStore { /** - * In-memory cache that holds persisted model elements identifiers mapped to the {@link FeatureKey} used to access them. + * In-memory cache that holds persisted model elements identifiers mapped to the {@link FeatureKey} used to access + * them. */ private final Cache objectsCache; @@ -70,16 +70,17 @@ public ReadOnlyHBaseStore(Resource.Internal resource) throws IOException { /** * Checks that the provided {@code tableName} corresponds to an existing HBase table and opens it. - *

+ * * @note Read-only mode is only available for existing databases. * * @param connection the connection to the HBase server * @param tableName the name of the table to access on the server - * @param admin the administrator client of the HBase server + * @param admin the administrator client of the HBase server * * @return the opened HBase table * - * @throws IOException if the HBase server cannot be found or if {@code tableName} does not reference an existing table + * @throws IOException if the HBase server cannot be found or if {@code tableName} does not reference an existing + * table */ @Override protected Table initTable(Connection connection, TableName tableName, Admin admin) throws IOException { diff --git a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/util/HBaseResourceUtil.java b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/util/HBaseResourceUtil.java index 456ce7d759..037a2f9d56 100644 --- a/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/util/HBaseResourceUtil.java +++ b/neoemf-data/hbase/src/main/java/fr/inria/atlanmod/neoemf/data/hbase/util/HBaseResourceUtil.java @@ -60,11 +60,11 @@ public static HBaseResourceUtil getInstance() { /** * Deletes a table if exist. * - * @param modelURI ??? + * @param modelURI the {@link URI} to configure the concerned HBase instance * * @return {@code true} if deleted, {@code false} otherwise * - * @throws IOException if ??? + * @throws IOException if a remote or network exception occurs */ public boolean deleteResourceIfExists(URI modelURI) throws IOException { diff --git a/neoemf-data/hbase/src/main/javadoc/fr/inria/atlanmod/neoemf/data/hbase/util/package-info.java b/neoemf-data/hbase/src/main/javadoc/fr/inria/atlanmod/neoemf/data/hbase/util/package-info.java index 3b504e9cea..965bae4907 100644 --- a/neoemf-data/hbase/src/main/javadoc/fr/inria/atlanmod/neoemf/data/hbase/util/package-info.java +++ b/neoemf-data/hbase/src/main/javadoc/fr/inria/atlanmod/neoemf/data/hbase/util/package-info.java @@ -10,7 +10,7 @@ */ /** - * Provides utility classes to create HBase specific URIs, serialize and deserialize HBase records, and + * Provides utility classes to create HBase specific URIs, serialize and deserialize HBase records, and * manage HBase resource life-cycle. */ diff --git a/neoemf-data/map/berkeleydb/src/main/java/fr/inria/atlanmod/neoemf/data/berkeleydb/store/DirectWriteBerkeleyDbStore.java b/neoemf-data/map/berkeleydb/src/main/java/fr/inria/atlanmod/neoemf/data/berkeleydb/store/DirectWriteBerkeleyDbStore.java index e1e496fe41..77146a4312 100644 --- a/neoemf-data/map/berkeleydb/src/main/java/fr/inria/atlanmod/neoemf/data/berkeleydb/store/DirectWriteBerkeleyDbStore.java +++ b/neoemf-data/map/berkeleydb/src/main/java/fr/inria/atlanmod/neoemf/data/berkeleydb/store/DirectWriteBerkeleyDbStore.java @@ -310,11 +310,11 @@ public EObject eObject(Id id) { } /** - * ??? + * Compute the {@link EClass} associated to the model element with the provided {@link Id}. * - * @param id ??? + * @param id the {@link Id} of the model element to compute the {@link EClass} from * - * @return ??? + * @return an {@link EClass} representing the metaclass of the element */ private EClass resolveInstanceOf(Id id) { EClass eClass = null; diff --git a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/MapDbPersistenceBackend.java b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/MapDbPersistenceBackend.java index 7a5e3a073a..511e433c6e 100644 --- a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/MapDbPersistenceBackend.java +++ b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/MapDbPersistenceBackend.java @@ -186,6 +186,7 @@ public Map getAll() { * * @return ??? */ + @VisibleForTesting public E get(String name) { return db.get(name); } @@ -216,7 +217,7 @@ public void storeContainer(Id id, ContainerInfo container) { * * @param id the {@link Id} of the element * - * @return a {@link ClassInfo} descriptor containing element's metaclass informations ({@link EClass}, metamodel + * @return a {@link ClassInfo} descriptor containing element's metaclass information ({@link EClass}, meta-model * name, and {@code nsURI}) */ public ClassInfo metaclassFor(Id id) { @@ -227,8 +228,8 @@ public ClassInfo metaclassFor(Id id) { * Stores metaclass ({@link EClass}) information for the element with the given {@link Id}. * * @param id the {@link Id} of the element - * @param metaclass the {@link ClassInfo} descriptor containing element's metaclass informations ({@link EClass}, - * metamodel name, and {@code nsURI}) + * @param metaclass the {@link ClassInfo} descriptor containing element's metaclass information ({@link EClass}, + * meta-model name, and {@code nsURI}) */ public void storeMetaclass(Id id, ClassInfo metaclass) { instanceOfMap.put(id, metaclass); diff --git a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbOptionsBuilder.java b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbOptionsBuilder.java index 2761cc93aa..5dd50fc5f3 100644 --- a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbOptionsBuilder.java +++ b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbOptionsBuilder.java @@ -11,6 +11,11 @@ package fr.inria.atlanmod.neoemf.data.mapdb.option; +import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbCacheManyStore; +import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbIndicesStore; +import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbListsStore; +import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbStore; +import fr.inria.atlanmod.neoemf.data.store.AutocommitStoreDecorator; import fr.inria.atlanmod.neoemf.option.AbstractPersistenceOptionsBuilder; import fr.inria.atlanmod.neoemf.option.PersistenceOptionsBuilder; @@ -43,9 +48,12 @@ public static MapDbOptionsBuilder newBuilder() { } /** - * ??? + * Adds the {@code autocommit} feature in the created options. * * @return this builder (for chaining) + * + * @see MapDbStoreOptions#AUTOCOMMIT + * @see AutocommitStoreDecorator */ @Nonnull public MapDbOptionsBuilder autocommit() { @@ -53,9 +61,12 @@ public MapDbOptionsBuilder autocommit() { } /** - * ??? + * Adds the {@code direct-write} feature in the created options. * * @return this builder (for chaining) + * + * @see MapDbStoreOptions#DIRECT_WRITE + * @see DirectWriteMapDbStore */ @Nonnull public MapDbOptionsBuilder directWrite() { @@ -63,9 +74,12 @@ public MapDbOptionsBuilder directWrite() { } /** - * ??? + * Adds the {@code direct-write-with-lists} feature in the created options. * * @return this builder (for chaining) + * + * @see MapDbStoreOptions#DIRECT_WRITE_LISTS + * @see DirectWriteMapDbListsStore */ @Nonnull public MapDbOptionsBuilder directWriteLists() { @@ -73,9 +87,12 @@ public MapDbOptionsBuilder directWriteLists() { } /** - * ??? + * Adds the {@code direct-write-with-indices} feature in the created options. * * @return this builder (for chaining) + * + * @see MapDbStoreOptions#DIRECT_WRITE_INDICES + * @see DirectWriteMapDbIndicesStore */ @Nonnull public MapDbOptionsBuilder directWriteIndices() { @@ -83,9 +100,12 @@ public MapDbOptionsBuilder directWriteIndices() { } /** - * ??? + * Adds the {@code direct-write-cache-many} feature in the created options. * * @return this builder (for chaining) + * + * @see MapDbStoreOptions#CACHE_MANY + * @see DirectWriteMapDbCacheManyStore */ @Nonnull public MapDbOptionsBuilder directWriteCacheMany() { diff --git a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbStoreOptions.java b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbStoreOptions.java index e253e7e520..eaa9c1ce50 100644 --- a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbStoreOptions.java +++ b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/option/MapDbStoreOptions.java @@ -16,8 +16,13 @@ import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbListsStore; import fr.inria.atlanmod.neoemf.data.mapdb.store.DirectWriteMapDbStore; import fr.inria.atlanmod.neoemf.data.store.AutocommitStoreDecorator; +import fr.inria.atlanmod.neoemf.data.store.DirectWriteStore; import fr.inria.atlanmod.neoemf.option.PersistentStoreOptions; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EReference; + +import java.util.Collection; import java.util.List; /** @@ -33,27 +38,40 @@ public enum MapDbStoreOptions implements PersistentStoreOptions { /** - * ??? + * Automatically saves modifications as calls are made. + * + * @see AutocommitStoreDecorator */ AUTOCOMMIT, /** - * ??? + * Translates model-level operations to MapDB calls (default {@link DirectWriteStore}). + * + * @see DirectWriteMapDbStore */ DIRECT_WRITE, /** - * ??? + * Translates model-level operations to MapDB calls, and uses {@link List}s instead of arrays to persist + * multi-valued {@link EAttribute}s and {@link EReference}s. + * + * @see DirectWriteMapDbListsStore */ DIRECT_WRITE_LISTS, /** - * ??? + * Translates model-level operations to MapDB calls, and persists {@link Collection} indices instead of serialized + * arrays. + * + * @see DirectWriteMapDbIndicesStore */ DIRECT_WRITE_INDICES, /** - * ??? + * Translates model-level operations to Blueprints calls, and uses an internal cache to store elements that are + * part of multi-valued {@link EReference}s to speed-up their access. + * + * @see DirectWriteMapDbCacheManyStore */ CACHE_MANY } diff --git a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/store/DirectWriteMapDbStore.java b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/store/DirectWriteMapDbStore.java index 8436468a20..cf24fc665a 100644 --- a/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/store/DirectWriteMapDbStore.java +++ b/neoemf-data/map/mapdb/src/main/java/fr/inria/atlanmod/neoemf/data/mapdb/store/DirectWriteMapDbStore.java @@ -323,11 +323,11 @@ public EObject eObject(Id id) { } /** - * ??? + * Compute the {@link EClass} associated to the model element with the provided {@link Id}. * - * @param id ??? + * @param id the {@link Id} of the model element to compute the {@link EClass} from * - * @return ??? + * @return an {@link EClass} representing the metaclass of the element */ private EClass resolveInstanceOf(Id id) { EClass eClass = null; diff --git a/overview.html b/overview.html deleted file mode 100644 index 17f5e53f11..0000000000 --- a/overview.html +++ /dev/null @@ -1,42 +0,0 @@ - -

NeoEMF : A Multi-database Model Persistence Framework.

- -

The figure below describes the integration of NeoEMF in the Eclipse-based EMF ecosystem, -the most popular modeling framework nowadays. Modelers typically access a model using -Model-based Tools, which provide high-level modeling features such as a graphical -interface, interactive console, or query editor. These features internally rely on EMF's -Model Access API to navigate models, perform CRUD operations, check constraints, etc. -At its core, EMF delegates the operations to a persistence manager using its -Persistence API, which is in charge of the (de)serialization of the model. -The NeoEMF core component is defined at this level, and can be registered as a -persistence manager for EMF, replacing, for instance, the default XMI persistence manager. -This design makes NeoEMF both transparent to the client-application and EMF itself, -that simply delegates the calls without taking care of the actual storage.

- -

Once the NeoEMF core component has received the request of the modeling operation -to perform, it forwards the operation to the appropriate database driver (MapDB, Blueprints, -or HBase), which is in charge of handling the low-level representation of the model. -These connectors translate modeling operations into Backend API calls, store the results, -and reify database records into EMF EObjects when needed. NeoEMF also embeds a set of -default caching strategies that are used to improve performance of client applications, and can -be configured transparently at the EMF API level.

- -NeoEMF Architecture Overview - -
-

Each backend is provided in a dedicated Eclipse plugin. you can navigate through the documentation - to have a complete overview of backend-specific classes and how they interact with the core component. - NeoEMF provides 4 database adapters for now:

- -
- -

Sources are available on GitHub. Further informations -can be found on NeoEMF website.

- - - \ No newline at end of file diff --git a/plugins/eclipse/ui/src/main/java/fr/inria/atlanmod/neoemf/eclipse/ui/editor/LazyAdapterFactoryContentProvider.java b/plugins/eclipse/ui/src/main/java/fr/inria/atlanmod/neoemf/eclipse/ui/editor/LazyAdapterFactoryContentProvider.java index 60432e610a..314af02eb5 100644 --- a/plugins/eclipse/ui/src/main/java/fr/inria/atlanmod/neoemf/eclipse/ui/editor/LazyAdapterFactoryContentProvider.java +++ b/plugins/eclipse/ui/src/main/java/fr/inria/atlanmod/neoemf/eclipse/ui/editor/LazyAdapterFactoryContentProvider.java @@ -27,7 +27,8 @@ public class LazyAdapterFactoryContentProvider extends AdapterFactoryContentProvider implements ILazyTreeContentProvider, INotifyChangedListener, ITreeContentProvider, - IPropertySourceProvider { + IPropertySourceProvider +{ public LazyAdapterFactoryContentProvider(AdapterFactory adapterFactory) { super(adapterFactory); diff --git a/pom.xml b/pom.xml index fdc2e9f244..8d199e0d23 100644 --- a/pom.xml +++ b/pom.xml @@ -418,7 +418,6 @@ true true false - ${project.basedir}/overview.html fr.inria.atlanmod.neoemf.data.berkeleydb*; fr.inria.atlanmod.neoemf.tests*; diff --git a/src/main/javadoc/doc-files/overview.png b/src/main/javadoc/doc-files/overview.png new file mode 100644 index 0000000000..a73a9a7b20 Binary files /dev/null and b/src/main/javadoc/doc-files/overview.png differ diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html new file mode 100644 index 0000000000..082901313b --- /dev/null +++ b/src/main/javadoc/overview.html @@ -0,0 +1,41 @@ + +

NeoEMF : A Multi-database Model Persistence Framework.

+ +

The figure below describes the integration of NeoEMF in the Eclipse-based EMF ecosystem, + the most popular modeling framework nowadays. Modelers typically access a model using + Model-based Tools, which provide high-level modeling features such as a graphical + interface, interactive console, or query editor. These features internally rely on EMF's + Model Access API to navigate models, perform CRUD operations, check constraints, etc. + At its core, EMF delegates the operations to a persistence manager using its + Persistence API, which is in charge of the (de)serialization of the model. + The NeoEMF core component is defined at this level, and can be registered as a + persistence manager for EMF, replacing, for instance, the default XMI persistence manager. + This design makes NeoEMF both transparent to the client-application and EMF itself, + that simply delegates the calls without taking care of the actual storage.

+ +

Once the NeoEMF core component has received the request of the modeling operation + to perform, it forwards the operation to the appropriate database driver (MapDB, Blueprints, + or HBase), which is in charge of handling the low-level representation of the model. + These connectors translate modeling operations into Backend API calls, store the results, + and reify database records into EMF EObjects when needed. NeoEMF also embeds a set of + default caching strategies that are used to improve performance of client applications, and can + be configured transparently at the EMF API level.

+ +
NeoEMF Architecture Overview
+ +
+

Each backend is provided in a dedicated Eclipse plugin. you can navigate through the documentation + to have a complete overview of backend-specific classes and how they interact with the core component. + NeoEMF provides 4 database adapters for now:

+ +
+ +

Sources are available on GitHub. Further informations + can be found on NeoEMF website.

+ + \ No newline at end of file