Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.ObjectNotInLowlevelStorageException


                    statement.executeQuery();
            for (; rs.next(); paths++) {
                path = rs.getString(1);
            }
            if (paths == 0) {
                throw new ObjectNotInLowlevelStorageException("no path in db registry for ["
                        + pid + "]");
            }
            if (paths > 1) {
                throw new LowlevelStorageInconsistencyException("[" + pid
                        + "] in db registry -multiple- times");
View Full Code Here


        throws ObjectNotInLowlevelStorageException,
        LowlevelStorageInconsistencyException, LowlevelStorageException {
      try{
        int updateCount = statement.getUpdateCount();
        if (updateCount == 0) {
          throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: -no- rows updated in db registry");
        }
        if (updateCount > 1) {
          throw new LowlevelStorageInconsistencyException("-multiple- rows updated in db registry");
        }
        } catch (SQLException e1) {
View Full Code Here

        try {
            conn = connectionPool.getReadWriteConnection();
            SQLUtility.replaceInto(conn, getRegistryName(), new String[] {
                    "token", "path"}, new String[] {pid, path}, "token");
        } catch (SQLException e1) {
            throw new ObjectNotInLowlevelStorageException("put into db registry failed for ["
                                                                  + pid + "]",
                                                          e1);
        } finally {
            if (conn != null) {
                connectionPool.free(conn);
View Full Code Here

            LowlevelStorageInconsistencyException, LowlevelStorageException {
        try {
            executeUpdate(deleteByIdQuery, pid);

        } catch (ObjectNotInLowlevelStorageException e1) {
            throw new ObjectNotInLowlevelStorageException("[" + pid
                    + "] not in db registry to delete", e1);
        } catch (LowlevelStorageInconsistencyException e2) {
            throw new LowlevelStorageInconsistencyException("[" + pid
                    + "] deleted from db registry -multiple- times", e2);
        }
View Full Code Here

        } catch (Exception e) {
            throw new LowlevelStorageException(true, "SimplePathRegistry.get("
                    + pid + ")", e);
        }
        if (null == result || 0 == result.length()) {
            throw new ObjectNotInLowlevelStorageException("SimplePathRegistry.get("
                    + pid + "): object not found");
        }
        return result;
    }
View Full Code Here

            connection = getConnection(store, null);
            Blob blob = getBlob(connection, blobId, null);
            if (exists(blob)) {
                delete(blob);
            } else {
                throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: " + key);
            }
        } finally {
            closeConnection(connection);
        }
    }
View Full Code Here

                    // leave it to the store impl to ensure atomicity
                    OutputStream out = openOutputStream(blob, -1, true);
                    copy(content, out);
                }
            } else {
                throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: " + key);
            }
            try {
                return blob.getSize();
            } catch (MissingBlobException e) { // should never happen
                throw new RuntimeException("Missing blob after replcaing the blob: " +e.getMessage(), e);
View Full Code Here

            Blob blob = getBlob(connection, blobId, null);
            content = openInputStream(blob);
            successful = true;
            return new ConnectionClosingInputStream(connection, content);
        } catch (MissingBlobException e) {
            throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: " + key);
        } finally {
            if (!successful) {
                IOUtils.closeQuietly(content);
                closeConnection(connection);
            }
View Full Code Here

            URI blobId = getBlobId(key);
            connection = getConnection(store, null);
            Blob blob = getBlob(connection, blobId, null);
            return blob.getSize();
        } catch (MissingBlobException e) {
            throw new ObjectNotInLowlevelStorageException("Object not found in low-level storage: " + key);
        } catch (IOException e) { // should never happen
            throw new RuntimeException("Error reading blob size: " +e.getMessage(), e);
        } finally {
            if (!successful) {
                closeConnection(connection);
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.ObjectNotInLowlevelStorageException

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.