Package org.apache.isis.objectstore.nosql.encryption

Examples of org.apache.isis.objectstore.nosql.encryption.DataEncryption


            final OidGenerator oidGenerator = new OidGenerator(createIdentifierGenerator(db));

            final Map<String, DataEncryption> availableDataEncryption = new HashMap<String, DataEncryption>();
            try {
                final String[] encryptionClasses = getConfiguration().getList(NAKEDOBJECTS_ENCRYPTION_CLASSES);
                DataEncryption writeWithEncryption = null;
                boolean encryptionSpecified = false;
                for (final String fullyQualifiedClass : encryptionClasses) {
                    LOG.info("  adding encryption " + fullyQualifiedClass);
                    final DataEncryption encryption = (DataEncryption) InstanceUtil.createInstance(fullyQualifiedClass);
                    encryption.init(configuration);
                    availableDataEncryption.put(encryption.getType(), encryption);
                    if (!encryptionSpecified) {
                        writeWithEncryption = encryption;
                    }
                    encryptionSpecified = true;
                }
                if (!encryptionSpecified) {
                    LOG.warn("No encryption specified");
                    final DataEncryption encryption = new DataEncryptionNone();
                    availableDataEncryption.put(encryption.getType(), encryption);
                    writeWithEncryption = encryption;
                }
                objectStore = new NoSqlObjectStore(db, oidGenerator, versionCreator, writeWithEncryption, availableDataEncryption);
            } catch (final IllegalArgumentException e) {
                throw new IsisException(e);
View Full Code Here


                one(versionCreator).timeString(version);
                will(returnValue("1057"));
            }
        });

        dataEncrypter = new DataEncryption() {
            @Override
            public String getType() {
                return "etc1";
            }
View Full Code Here

    @Before
    public void setup() {
        objectReader = new ObjectReader();

        dataEncrypter = new HashMap<String, DataEncryption>();
        final DataEncryption etcEncryption = new DataEncryption() {
            @Override
            public String getType() {
                return "etc1";
            }

            @Override
            public void init(final IsisConfiguration configuration) {
            }

            @Override
            public String encrypt(final String plainText) {
                throw new UnexpectedCallException();
            }

            @Override
            public String decrypt(final String encryptedText) {
                return encryptedText.substring(3);
            }
        };
        dataEncrypter.put(etcEncryption.getType(), etcEncryption);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.objectstore.nosql.encryption.DataEncryption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.