Package org.apache.isis.runtimes.dflt.objectstores.nosql

Examples of org.apache.isis.runtimes.dflt.objectstores.nosql.NoSqlStoreException


    public String getData() {
        try {
            return dbObject.toString(4);
        } catch (final JSONException e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here


            collection.add(((JsonStateWriter) writer).dbObject);
        }
        try {
            dbObject.put(id, collection);
        } catch (final JSONException e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

    public JsonStateReader(final String data) {
        try {
            final JSONObject instance = new JSONObject(data);
            this.instance = instance;
        } catch (final JSONException e) {
            throw new NoSqlStoreException("failed initialise JSON object for text form: " + data, e);
        }
    }
View Full Code Here

            } else {
                encryptionType = "none";
            }
            return encryptionType;
        } catch (final JSONException e) {
            throw new NoSqlStoreException("failed to read field _encrypt", e);
        }
    }
View Full Code Here

    private String readRequiredField(final String name) {
        try {
            final Object value = instance.get(name);
            return (String) value;
        } catch (final JSONException e) {
            throw new NoSqlStoreException("failed to read field " + name, e);
        }
    }
View Full Code Here

            SecretKeySpec key = new SecretKeySpec(specKey, BLOWFISH);
            Cipher cipher = Cipher.getInstance(BLOWFISH);
            cipher.init(Cipher.ENCRYPT_MODE, key);
            return new String(cipher.doFinal(plainText.getBytes()));
        } catch (Exception e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

            Cipher cipher = Cipher.getInstance(BLOWFISH);
            cipher.init(Cipher.DECRYPT_MODE, key);
            byte[] decrypted = cipher.doFinal(encryptedText.getBytes());
            return new String(decrypted);
        } catch (Exception e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

            SecretKeySpec key = new SecretKeySpec(specKey, AES);
            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
            cipher.init(Cipher.ENCRYPT_MODE, key);
            return new String(cipher.doFinal(plainText.getBytes()));
        } catch (Exception e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
            cipher.init(Cipher.DECRYPT_MODE, key);
            byte[] decrypted = cipher.doFinal(encryptedText.getBytes());
            return new String(decrypted);
        } catch (Exception e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

    private static final String ENCRYPTION_KEY = ConfigurationConstants.ROOT  + "nosql.encryption.blowfish-key";

    public byte[] secretKey(IsisConfiguration configuration) {
        String key = configuration.getString(ENCRYPTION_KEY);
        if (key == null) {
            throw new NoSqlStoreException("No blowfish encryption key specified in the configuration file (key: " + ENCRYPTION_KEY + ")");
        }
        return key.getBytes();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.objectstores.nosql.NoSqlStoreException

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.