Examples of NoSqlStoreException


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

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

    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

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

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

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

            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

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

            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

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

    /**
     * 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

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

        }
        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

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

        // TODO deal with buffer overrun
        while ((c = input.read()) != ' ' && c != '\n' && c != -1) {
            buffer[i++] = (byte) c;
        }
        if (i == 0) {
            throw new NoSqlStoreException("No data read from " + input);
        }
        final String read = new String(buffer, 0, i);
        LOG.debug("read " + read);
        return read;
    }
View Full Code Here

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

                this.header = 0;
                return true;
            }
        } catch (final IOException e) {
            logFailure();
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

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

                logFailure();
                throw new RemotingException("command didn't end with an empty blank line, aborting request");
            }
        } catch (final IOException e) {
            logFailure();
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.