Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-10-08 16:14:47 +0000
committerEike Stepper2020-10-08 16:15:04 +0000
commitc7dd466c29b321a707d3f58dea2f0cf7fee833bb (patch)
treef6bf297392334188bd6e5943a08e5a985af9b09c
parent64b0bfff64b0b0c0f2cad2e042fdcacbd5d02b0b (diff)
downloadcdo-c7dd466c29b321a707d3f58dea2f0cf7fee833bb.tar.gz
cdo-c7dd466c29b321a707d3f58dea2f0cf7fee833bb.tar.xz
cdo-c7dd466c29b321a707d3f58dea2f0cf7fee833bb.zip
[567696] [DB] Make it easier to customize ITypeMappings
https://bugs.eclipse.org/bugs/show_bug.cgi?id=567696
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/EncryptedPasswordFactory.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/EncryptedPasswordFactory.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/EncryptedPasswordFactory.java
index 1a737360cf..ed8d200776 100644
--- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/EncryptedPasswordFactory.java
+++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/EncryptedPasswordFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.examples.server;
import org.eclipse.emf.cdo.security.SecurityPackage;
+import org.eclipse.emf.cdo.server.db.IDBStore;
import org.eclipse.emf.cdo.server.db.mapping.AbstractTypeMapping;
import org.eclipse.emf.cdo.server.db.mapping.DelegatingTypeMapping;
import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
@@ -18,6 +19,7 @@ import org.eclipse.emf.cdo.server.db.mapping.ITypeMapping;
import org.eclipse.emf.cdo.server.db.mapping.ITypeMapping.Provider;
import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.factory.IFactory;
import org.eclipse.net4j.util.factory.ProductCreationException;
import org.eclipse.net4j.util.security.SecurityUtil;
@@ -26,6 +28,24 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import javax.crypto.Cipher;
/**
+ * This is an example on how to use a custom {@link org.eclipse.emf.cdo.server.db.mapping.ITypeMapping.Provider type mapping provider} for the
+ * {@link IMappingStrategy mapping strategy} of a {@link IDBStore DB store}.
+ * <p>
+ * This {@link IFactory factory} is registered in the <code>plugin.xml</code> as follows:
+ * <pre>
+ * &lt;extension point="org.eclipse.net4j.util.factories">
+ * &lt;factory
+ * productGroup="org.eclipse.emf.cdo.server.db.typeMappingProviders"
+ * type="encryptedPassword"
+ * class="org.eclipse.emf.cdo.examples.server.EncryptedPasswordFactory"/>
+ * &lt;/extension></pre>
+ * <p>
+ * Then it can be used in the <code>cdo-server.xml</code> as follows:
+ * <pre>
+ * &lt;mappingStrategy type="horizontal">
+ * &lt;property name="typeMappingProvider" value="encryptedPassword"/>
+ * &lt;/mappingStrategy></pre>
+ *
* @author Eike Stepper
*/
public class EncryptedPasswordFactory extends ITypeMapping.Provider.Factory

Back to the top