Package org.apache.sqoop.common

Examples of org.apache.sqoop.common.SqoopException


      throw  ex;
    } catch (Exception ex) {
      if (tx != null && shouldCloseTxn) {
        tx.rollback();
      }
      throw new SqoopException(RepositoryError.JDBCREPO_0012, ex);
    } finally {
      if (tx != null && shouldCloseTxn) {
        tx.close();
      }
    }
View Full Code Here


            mConnector.getVersion().compareTo(result.getVersion()) > 0) {
            if (autoUpgrade) {
              upgradeConnector(result, mConnector);
              return mConnector;
            } else {
              throw new SqoopException(RepositoryError.JDBCREPO_0026,
                "Connector: " + mConnector.getUniqueName());
            }
          }
          if (!result.equals(mConnector)) {
            throw new SqoopException(RepositoryError.JDBCREPO_0013,
              "Connector: " + mConnector.getUniqueName()
                + " given: " + mConnector
                + " found: " + result);
          }
          return result;
View Full Code Here

          if(!mFramework.equals(result)) {
            if (autoUpgrade) {
              upgradeFramework(mFramework);
              return mFramework;
            } else {
              throw new SqoopException(RepositoryError.JDBCREPO_0026,
                "Framework: " + mFramework.getPersistenceId());
            }
          }
          return result;
        }
View Full Code Here

  public void createConnection(final MConnection connection) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        if(connection.hasPersistenceId()) {
          throw new SqoopException(RepositoryError.JDBCREPO_0015);
        }

        handler.createConnection(connection, conn);
        return null;
      }
View Full Code Here

    RepositoryTransaction tx) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
       if(!connection.hasPersistenceId()) {
          throw new SqoopException(RepositoryError.JDBCREPO_0016);
        }
        if(!handler.existsConnection(connection.getPersistenceId(), conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0017,
            "Invalid id: " + connection.getPersistenceId());
        }

        handler.updateConnection(connection, conn);
        return null;
View Full Code Here

  public void enableConnection(final long connectionId, final boolean enabled) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        if(!handler.existsConnection(connectionId, conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0017,
            "Invalid id: " + connectionId);
        }

        handler.enableConnection(connectionId, enabled, conn);
        return null;
View Full Code Here

  public void deleteConnection(final long connectionId) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        if(!handler.existsConnection(connectionId, conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0017,
            "Invalid id: " + connectionId);
        }
        if(handler.inUseConnection(connectionId, conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0021,
            "Id in use: " + connectionId);
        }

        handler.deleteConnection(connectionId, conn);
        return null;
View Full Code Here

  public void createJob(final MJob job) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        if(job.hasPersistenceId()) {
          throw new SqoopException(RepositoryError.JDBCREPO_0018);
        }

        handler.createJob(job, conn);
        return null;
      }
View Full Code Here

  public void updateJob(final MJob job, RepositoryTransaction tx) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
       if(!job.hasPersistenceId()) {
          throw new SqoopException(RepositoryError.JDBCREPO_0019);
        }
        if(!handler.existsJob(job.getPersistenceId(), conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0020,
            "Invalid id: " + job.getPersistenceId());
        }

        handler.updateJob(job, conn);
        return null;
View Full Code Here

  public void enableJob(final long id, final boolean enabled) {
    doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        if(!handler.existsJob(id, conn)) {
          throw new SqoopException(RepositoryError.JDBCREPO_0020,
            "Invalid id: " + id);
        }

        handler.enableJob(id, enabled, conn);
        return null;
View Full Code Here

TOP

Related Classes of org.apache.sqoop.common.SqoopException

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.