cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1582770 - in /cayenne/main/trunk/cayenne-crypto/src: main/java/org/apache/cayenne/crypto/ main/java/org/apache/cayenne/crypto/batch/ main/java/org/apache/cayenne/crypto/cipher/ main/java/org/apache/cayenne/crypto/reader/ main/java/org/apac...
Date Fri, 28 Mar 2014 14:56:33 GMT
Author: aadamchik
Date: Fri Mar 28 14:56:32 2014
New Revision: 1582770

URL: http://svn.apache.org/r1582770
Log:
CAY-1916 cayenne-crypto module that enables data encryption for certain model attributes

renaming

Added:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/BindingsTransformer.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/BindingsTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultBindingsTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultMapTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultCryptoFactory.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/MapTransformer.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/MapTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/TransformerFactory.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/CryptoFactory.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
      - copied, changed from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformerFactory.java
Removed:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/
Modified:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/batch/CryptoBatchTranslatorFactoryDecorator.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
    cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
    cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactoryTest.java

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java?rev=1582770&r1=1582769&r2=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/CryptoModuleBuilder.java
Fri Mar 28 14:56:32 2014
@@ -21,11 +21,11 @@ package org.apache.cayenne.crypto;
 import org.apache.cayenne.access.jdbc.reader.RowReaderFactory;
 import org.apache.cayenne.access.translator.batch.BatchTranslatorFactory;
 import org.apache.cayenne.crypto.batch.CryptoBatchTranslatorFactoryDecorator;
-import org.apache.cayenne.crypto.cipher.CryptoFactory;
-import org.apache.cayenne.crypto.cipher.DefaultCryptoFactory;
-import org.apache.cayenne.crypto.cipher.ValueTransformerFactory;
 import org.apache.cayenne.crypto.map.ColumnMapper;
 import org.apache.cayenne.crypto.reader.CryptoRowReaderFactoryDecorator;
+import org.apache.cayenne.crypto.transformer.TransformerFactory;
+import org.apache.cayenne.crypto.transformer.DefaultTransformerFactory;
+import org.apache.cayenne.crypto.transformer.ValueTransformerFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 
@@ -79,7 +79,7 @@ public class CryptoModuleBuilder {
             @Override
             public void configure(Binder binder) {
 
-                binder.bind(CryptoFactory.class).to(DefaultCryptoFactory.class);
+                binder.bind(TransformerFactory.class).to(DefaultTransformerFactory.class);
                 binder.bind(ValueTransformerFactory.class).to(valueTransformerFactoryType);
 
                 if (columnMapperType != null) {

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/batch/CryptoBatchTranslatorFactoryDecorator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/batch/CryptoBatchTranslatorFactoryDecorator.java?rev=1582770&r1=1582769&r2=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/batch/CryptoBatchTranslatorFactoryDecorator.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/batch/CryptoBatchTranslatorFactoryDecorator.java
Fri Mar 28 14:56:32 2014
@@ -21,8 +21,8 @@ package org.apache.cayenne.crypto.batch;
 import org.apache.cayenne.access.translator.batch.BatchParameterBinding;
 import org.apache.cayenne.access.translator.batch.BatchTranslator;
 import org.apache.cayenne.access.translator.batch.BatchTranslatorFactory;
-import org.apache.cayenne.crypto.cipher.BindingsTransformer;
-import org.apache.cayenne.crypto.cipher.CryptoFactory;
+import org.apache.cayenne.crypto.transformer.BindingsTransformer;
+import org.apache.cayenne.crypto.transformer.TransformerFactory;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.query.BatchQuery;
@@ -33,11 +33,11 @@ import org.apache.cayenne.query.BatchQue
  */
 public class CryptoBatchTranslatorFactoryDecorator implements BatchTranslatorFactory {
 
-    private CryptoFactory cryptoFactory;
+    private TransformerFactory cryptoFactory;
     private BatchTranslatorFactory delegate;
 
     public CryptoBatchTranslatorFactoryDecorator(@Inject BatchTranslatorFactory delegate,
-            @Inject CryptoFactory cryptoFactory) {
+            @Inject TransformerFactory cryptoFactory) {
 
         this.cryptoFactory = cryptoFactory;
         this.delegate = delegate;
@@ -54,7 +54,7 @@ public class CryptoBatchTranslatorFactor
 
             private void ensureEncryptorCompiled() {
                 if (!encryptorCompiled) {
-                    encryptor = cryptoFactory.createEncryptor(getBindings());
+                    encryptor = cryptoFactory.encryptor(getBindings());
                     encryptorCompiled = true;
                 }
 

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java?rev=1582770&r1=1582769&r2=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/reader/CryptoRowReaderFactoryDecorator.java
Fri Mar 28 14:56:32 2014
@@ -25,8 +25,8 @@ import org.apache.cayenne.access.jdbc.Co
 import org.apache.cayenne.access.jdbc.RowDescriptor;
 import org.apache.cayenne.access.jdbc.reader.RowReader;
 import org.apache.cayenne.access.jdbc.reader.RowReaderFactory;
-import org.apache.cayenne.crypto.cipher.CryptoFactory;
-import org.apache.cayenne.crypto.cipher.MapTransformer;
+import org.apache.cayenne.crypto.transformer.TransformerFactory;
+import org.apache.cayenne.crypto.transformer.MapTransformer;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.ObjAttribute;
@@ -35,9 +35,9 @@ import org.apache.cayenne.query.QueryMet
 public class CryptoRowReaderFactoryDecorator implements RowReaderFactory {
 
     private RowReaderFactory delegate;
-    private CryptoFactory cryptoFactory;
+    private TransformerFactory cryptoFactory;
 
-    public CryptoRowReaderFactoryDecorator(@Inject RowReaderFactory delegate, @Inject CryptoFactory
cryptoFactory) {
+    public CryptoRowReaderFactoryDecorator(@Inject RowReaderFactory delegate, @Inject TransformerFactory
cryptoFactory) {
         this.delegate = delegate;
         this.cryptoFactory = cryptoFactory;
     }
@@ -55,7 +55,7 @@ public class CryptoRowReaderFactoryDecor
 
             private void ensureDecryptorCompiled(Object row) {
                 if (!decryptorCompiled) {
-                    decryptor = cryptoFactory.createDecryptor(descriptor.getColumns(), row);
+                    decryptor = cryptoFactory.decryptor(descriptor.getColumns(), row);
                     decryptorCompiled = true;
                 }
             }

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/BindingsTransformer.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/BindingsTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/BindingsTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/BindingsTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/BindingsTransformer.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/BindingsTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/BindingsTransformer.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import org.apache.cayenne.access.translator.batch.BatchParameterBinding;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultBindingsTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultBindingsTransformer.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultBindingsTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultBindingsTransformer.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import javax.crypto.Cipher;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultMapTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultMapTransformer.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultMapTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultMapTransformer.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import java.util.Map;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultCryptoFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultCryptoFactory.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/DefaultCryptoFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/DefaultTransformerFactory.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -28,18 +28,18 @@ import org.apache.cayenne.crypto.map.Col
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DbAttribute;
 
-public class DefaultCryptoFactory implements CryptoFactory {
+public class DefaultTransformerFactory implements TransformerFactory {
 
     private ColumnMapper columnMapper;
     private ValueTransformerFactory transformerFactory;
 
-    public DefaultCryptoFactory(@Inject ColumnMapper columnMapper, @Inject ValueTransformerFactory
transformerFactory) {
+    public DefaultTransformerFactory(@Inject ColumnMapper columnMapper, @Inject ValueTransformerFactory
transformerFactory) {
         this.columnMapper = columnMapper;
         this.transformerFactory = transformerFactory;
     }
 
     @Override
-    public MapTransformer createDecryptor(ColumnDescriptor[] columns, Object sampleRow) {
+    public MapTransformer decryptor(ColumnDescriptor[] columns, Object sampleRow) {
 
         if (!(sampleRow instanceof Map)) {
             return null;
@@ -70,7 +70,7 @@ public class DefaultCryptoFactory implem
 
                 ColumnDescriptor cd = columns[cryptoColumns.get(i)];
                 keys[i] = cd.getDataRowKey();
-                transformers[i] = transformerFactory.getDecryptor(cd.getAttribute().getType());
+                transformers[i] = transformerFactory.decryptor(cd.getAttribute().getType());
             }
 
             // TODO: use real cipher
@@ -81,7 +81,7 @@ public class DefaultCryptoFactory implem
     }
 
     @Override
-    public BindingsTransformer createEncryptor(BatchParameterBinding[] bindings) {
+    public BindingsTransformer encryptor(BatchParameterBinding[] bindings) {
         int len = bindings.length;
         List<Integer> cryptoColumns = null;
 
@@ -108,7 +108,7 @@ public class DefaultCryptoFactory implem
                 int pos = cryptoColumns.get(i);
                 BatchParameterBinding b = bindings[pos];
                 positions[i] = pos;
-                transformers[i] = transformerFactory.getEncryptor(b.getAttribute().getType());
+                transformers[i] = transformerFactory.encryptor(b.getAttribute().getType());
             }
 
             // TODO: use real cipher

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/MapTransformer.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/MapTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/MapTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/MapTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/MapTransformer.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/MapTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/MapTransformer.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import java.util.Map;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/TransformerFactory.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/CryptoFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/TransformerFactory.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/TransformerFactory.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/CryptoFactory.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/CryptoFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/TransformerFactory.java
Fri Mar 28 14:56:32 2014
@@ -16,20 +16,20 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import org.apache.cayenne.access.jdbc.ColumnDescriptor;
 import org.apache.cayenne.access.translator.batch.BatchParameterBinding;
 
 /**
- * A factory that creates encryption/decryption handlers that can be used to
- * process data.
+ * A factory that creates encryption transformers used for processing batch
+ * bindings and decryption transformers - for result rows.
  * 
  * @since 3.2
  */
-public interface CryptoFactory {
+public interface TransformerFactory {
 
-    BindingsTransformer createEncryptor(BatchParameterBinding[] bindings);
+    BindingsTransformer encryptor(BatchParameterBinding[] bindings);
 
-    MapTransformer createDecryptor(ColumnDescriptor[] columns, Object sampleRow);
+    MapTransformer decryptor(ColumnDescriptor[] columns, Object sampleRow);
 }

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformer.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformer.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformer.java
Fri Mar 28 14:56:32 2014
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 import javax.crypto.Cipher;
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
(from r1582769, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformerFactory.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformerFactory.java&r1=1582769&r2=1582770&rev=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/cipher/ValueTransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/ValueTransformerFactory.java
Fri Mar 28 14:56:32 2014
@@ -16,14 +16,17 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.crypto.cipher;
+package org.apache.cayenne.crypto.transformer;
 
 /**
+ * A factory that creates transformers for encryption/decryption of individual
+ * values.
+ * 
  * @since 3.2
  */
 public interface ValueTransformerFactory {
 
-    ValueTransformer getEncryptor(int jdbcType);
+    ValueTransformer encryptor(int jdbcType);
 
-    ValueTransformer getDecryptor(int jdbcType);
+    ValueTransformer decryptor(int jdbcType);
 }

Modified: cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java?rev=1582770&r1=1582769&r2=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactory.java
Fri Mar 28 14:56:32 2014
@@ -22,8 +22,8 @@ import java.io.UnsupportedEncodingExcept
 
 import javax.crypto.Cipher;
 
-import org.apache.cayenne.crypto.cipher.ValueTransformer;
-import org.apache.cayenne.crypto.cipher.ValueTransformerFactory;
+import org.apache.cayenne.crypto.transformer.ValueTransformer;
+import org.apache.cayenne.crypto.transformer.ValueTransformerFactory;
 
 public class Rot13TransformerFactory implements ValueTransformerFactory {
 
@@ -75,12 +75,12 @@ public class Rot13TransformerFactory imp
     }
 
     @Override
-    public ValueTransformer getDecryptor(int jdbcType) {
+    public ValueTransformer decryptor(int jdbcType) {
         return stringTransformer;
     }
 
     @Override
-    public ValueTransformer getEncryptor(int jdbcType) {
+    public ValueTransformer encryptor(int jdbcType) {
         return stringTransformer;
     }
 }

Modified: cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactoryTest.java?rev=1582770&r1=1582769&r2=1582770&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactoryTest.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/unit/Rot13TransformerFactoryTest.java
Fri Mar 28 14:56:32 2014
@@ -27,13 +27,13 @@ public class Rot13TransformerFactoryTest
     public void testEncrypt() {
 
         Rot13TransformerFactory factory = new Rot13TransformerFactory();
-        assertEquals("nop", factory.getEncryptor(Types.BINARY).transform(null, "abc"));
+        assertEquals("nop", factory.encryptor(Types.BINARY).transform(null, "abc"));
     }
 
     public void testDecrypt() {
 
         Rot13TransformerFactory factory = new Rot13TransformerFactory();
-        assertEquals("nop", factory.getDecryptor(Types.BINARY).transform(null, "abc"));
+        assertEquals("nop", factory.decryptor(Types.BINARY).transform(null, "abc"));
     }
 
 }



Mime
View raw message