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

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


    @Override
    public byte[] secretKey(final IsisConfiguration configuration) {
        final 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


                final int length = fileInput.read(buffer);
                final byte[] key = new byte[length];
                System.arraycopy(buffer, 0, key, 0, length);
                return key;
            } catch (final IOException e) {
                throw new NoSqlStoreException("Failed to read in encryption file: " + file.getAbsolutePath(), e);
            }
        } else {
            throw new NoSqlStoreException("Cannot find encryption file: " + file.getAbsolutePath());
        }
    }
View Full Code Here

                fileOutput.close();

                final long calculatedChecksum = crc32.getValue();
                final long sentChecksum = input.readLong();
                if (calculatedChecksum != sentChecksum) {
                    throw new NoSqlStoreException("Checksum didn't match during download of " + file.getName());
                }

                recover(file);
                final File renameTo = Util.logFile(logId);
                file.renameTo(renameTo);
View Full Code Here

                final String line = reader.readLine();
                if (line == null) {
                    break;
                }
                if (!line.startsWith("#transaction started")) {
                    throw new NoSqlStoreException("No transaction start found: " + line + " (" + reader.getLineNumber() + ")");
                }
                readTransaction(reader);
            }
        } catch (final IOException e) {
            throw new NoSqlStoreException(e);
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (final IOException e) {
                    throw new NoSqlStoreException(e);
                }
            }
        }
    }
View Full Code Here

                int length = fileInput.read(buffer);
                byte[] key = new byte[length];
                System.arraycopy(buffer, 0, key, 0, length);
                return key;
            } catch (IOException e) {
                throw new NoSqlStoreException("Failed to read in encryption file: " + file.getAbsolutePath(), e);
            }
        } else {
            throw new NoSqlStoreException("Cannot find encryption file: " + file.getAbsolutePath());
        }
    }
View Full Code Here

        try {
            final String response = reader.readLine();
            LOG.debug("response: " + response);
            headers = response.split(" ");
        } catch (final IOException e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

        try {
            m = new Mongo(host, port);
            db = m.getDB(dbName);
            LOG.info("opened database (" + dbName + "): " + db);
        } catch (final UnknownHostException e) {
            throw new NoSqlStoreException(e);
        } catch (final MongoException e) {
            throw new NoSqlStoreException(e);
        }
    }
View Full Code Here

                return new MongoStateReader(cursor.next());
            }

            @Override
            public void remove() {
                throw new NoSqlStoreException("Can't remove elements");
            }

        };
    }
View Full Code Here

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

                this.header = 0;
                return true;
            }
        } catch (final IOException e) {
            logFailure();
            throw new NoSqlStoreException(e);
        }
    }
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.