Package org.apache.isis.objectstore.nosql

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


            } 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

            final Socket socket;
            socket = new Socket(host, port);
            socket.setSoTimeout(timeout);
            return new ClientConnection(socket.getInputStream(), socket.getOutputStream());
        } catch (final UnknownHostException e) {
            throw new NoSqlStoreException("Unknow host " + host, e);
        } catch (final IOException e) {
            throw new NoSqlStoreException("Failed to connect to " + host + ":" + port, e);
        }

    }
View Full Code Here

        final String encodedChecksum = data.substring(0, 8);
        final long expectedChecksum = Long.valueOf(encodedChecksum, 16);

        if (actualChecksum != expectedChecksum) {
            throw new NoSqlStoreException("Data integrity error; checksums different");
        }

        return objectData;
    }
View Full Code Here

            final SecretKeySpec key = new SecretKeySpec(specKey, BLOWFISH);
            final Cipher cipher = Cipher.getInstance(BLOWFISH);
            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(BLOWFISH);
            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

    @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

            writer.write('\n');
            writer.write('\n');
            writer.write("#transaction ended\n\n".getBytes());
            writer.flush();
        } catch (final IOException e) {
            throw new NoSqlStoreException("Failed to write serial number data to log file", e);
        }

    }
View Full Code Here

            writer.write('\n');
            writer.write('\n');
            writer.write("#transaction ended\n\n".getBytes());
            writer.flush();
        } catch (final IOException e) {
            throw new NoSqlStoreException("Failed to write service entry data to log file", e);
        }
    }
View Full Code Here

                writer.write('\n');
            }
            writer.write("#transaction ended\n\n".getBytes());
            writer.flush();
        } catch (final IOException e) {
            throw new NoSqlStoreException("Failed to write data to log file", 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.