Package org.apache.isis.objectstore.nosql

Examples of org.apache.isis.objectstore.nosql.NoSqlStoreException


    private void openNewFile() {
        nextLogIdToWrite++;
        final File file = Util.logFile(nextLogIdToWrite);
        if (file.exists()) {
            throw new NoSqlStoreException("Log file already exists");
        }
        openFile(file);
    }
View Full Code Here


    private void openFile(final File file) {
        try {
            writer = new DataOutputStream(new FileOutputStream(file));
            startNewFile = false;
        } catch (final IOException e) {
            throw new NoSqlStoreException("Failed to open log file", e);
        }
    }
View Full Code Here

    private void close() {
        try {
            writer.close();
        } catch (final IOException e) {
            throw new NoSqlStoreException("Falied to close log file", e);
        }
    }
View Full Code Here

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

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

    /**
     * returns {@link RootOid#getIdentifier()} (oid must be {@link RootOid}, and must be persistent).
     */
    public String getIdentifierForPersistentRoot(final Oid oid) {
        if (!(oid instanceof RootOid)) {
            throw new NoSqlStoreException("Oid is not a RootOid: " + oid);
        }
        RootOid rootOid = (RootOid) oid;
        if (rootOid.isTransient()) {
            throw new NoSqlStoreException("Oid is not for a persistent object: " + oid);
        }
        return rootOid.getIdentifier();
    }
View Full Code Here

        }
        try {
            //return adapter.getSpecification().getFullIdentifier() + "@" + key(adapter.getOid());
            return adapter.getOid().enString(getOidMarshaller());
        } catch (final NoSqlStoreException e) {
            throw new NoSqlStoreException("Failed to create refence for " + adapter, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.objectstore.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.