Package edu.uga.galileo.voci.exception

Examples of edu.uga.galileo.voci.exception.NoSuchBundleException


    try {
      Configuration.getConnectionPool().executeQuery(qp);
    } catch (SQLException e) {
      Logger.fatal("Couldn't execute query", e);
      throw new NoSuchBundleException(
          "A SQLException was the cause: " + e.getMessage());
    }

    if (qp.getResultCount() > 0) {
      return createObjectFromQueryParser(Bundle.class, qp);
    } else {
      throw new NoSuchBundleException("The requested bundle ID ("
          + bundleId + ") doesn't exist.");
    }
  }
View Full Code Here


    try {
      Configuration.getConnectionPool().executeInsertOrUpdate(qp);
    } catch (SQLException e) {
      Logger.error("Bundle record couldn't be added", e);
      throw new NoSuchBundleException(
          "SQLException prevented bundle record addition: "
              + e.getMessage());
    }
  }
View Full Code Here

      return qp.getResult(Integer.class, "nextVal");
    } catch (SQLException e) {
      Logger.error(
          "Bundle ID couldn't be retrieved b/c of SQLException",
          e);
      throw new NoSuchBundleException(
          "Couldn't get a bundle ID from the handle_id_seq b/c of a SQLException: "
              + e.getMessage());
    } catch (DataTypeMismatchException e) {
      Logger.error("Bundle ID couldn't be retrieved", e);
      throw new NoSuchBundleException(
          "Couldn't get a bundle ID from the handle_id_seq: "
              + e.getMessage());
    }
  }
View Full Code Here

    qp.addPreparedStmtElementDefinition(bundle.getBundleId());
    qp.addPreparedStmtElementDefinition(bundle.getProjectId());

    try {
      if (!Configuration.getConnectionPool().executeInsertOrUpdate(qp)) {
        throw new NoSuchBundleException("Bundle "
            + bundle.getId() + " in project "
            + bundle.getProjectId()
            + " couldn't be found to update.");
      }
    } catch (SQLException e) {
      Logger.error("Bundle record couldn't be updated.", e);
      throw new NoSuchBundleException(
          "SQLException prevented bundle record update: "
              + e.getMessage());
    }
  }
View Full Code Here

    qp.addPreparedStmtElementDefinition(bundle.getProjectId());
    qp.addPreparedStmtElementDefinition(bundle.getBundleId());

    try {
      if (!Configuration.getConnectionPool().executeInsertOrUpdate(qp)) {
        throw new NoSuchBundleException("Childless bundle "
            + bundle.getId() + " in project "
            + bundle.getProjectId()
            + " couldn't be found to delete.");
      }
    } catch (SQLException e) {
      Logger.error("Bundle record couldn't be deleted", e);
      throw new NoSuchBundleException(
          "SQLException prevented bundle record deletion: "
              + e.getMessage());
    }
  }
View Full Code Here

    int projectId;
    try {
      projectId = (new ProjectManager()).getProjectID(command
          .getProject());
    } catch (NoSuchProjectException e) {
      throw new NoSuchBundleException("The project associated with this "
          + "bundle couldn't be found.");
    }

    if (bundleId == -1) {
      bundle = new Bundle();
      bundle.setBundleId(-1);
      bundle.setProjectId(projectId);
    } else {
      bundle = bdao.getBundle(bundleId, projectId);
    }

    if ((mustBeActive) && (!bundle.isActive())) {
      throw new NoSuchBundleException("No matching, active bundle found.");
    }

    if (addMetadata) {
      metadataManager.populateVBOWithMetadata(bundle);
    }
View Full Code Here

      bdao.addBundle(bundle, multiStatementConnection);
      if (parentId != -1) {
        ContentType parentIdType = DAOFactory.getHelperDAO()
            .getContentTypeById(parentId);
        if (parentIdType == null) {
          throw new NoSuchBundleException(
              "No such parent ID exists in the database.");
        }
        bdao.addBundleMapping(bundle.getBundleId(), parentId,
            parentIdType, multiStatementConnection);
      }
      mman.updateMetadataVBOMapping(bundle, multiStatementConnection);
      multiStatementConnection.commit();

      AuditLogManager alm = new AuditLogManager();
      alm.addRecord(bundle.getProjectId(), ContentType.BUNDLE, bundle
          .getBundleId(), user.getUserName(), "{created}");
    } catch (SQLException e) {
      multiStatementConnection.rollback();
      throw e;
    } catch (NoSuchBundleException e) {
      multiStatementConnection.rollback();
      throw e;
    } catch (NoAvailableDAOException e) {
      multiStatementConnection.rollback();
      Logger.fatal("Couldn't get a bundle DAO", e);
      throw new NoSuchBundleException("Couldn't get the bundle DAO: "
          + e.getMessage());
    } finally {
      multiStatementConnection.setAutoCommit(true);
      Configuration.getConnectionPool().returnConnection(
          multiStatementConnection);
View Full Code Here

TOP

Related Classes of edu.uga.galileo.voci.exception.NoSuchBundleException

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.