Package org.apache.sqoop.validation

Examples of org.apache.sqoop.validation.Validation.addMessage()


    if(configuration.table.tableName == null && configuration.table.sql == null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Either table name or SQL must be specified");
    }
    if(configuration.table.tableName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both table name and SQL cannot be specified");
    }
    if(configuration.table.schemaName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both schema name and SQL cannot be specified");
    }
View Full Code Here


    }
    if(configuration.table.tableName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both table name and SQL cannot be specified");
    }
    if(configuration.table.schemaName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both schema name and SQL cannot be specified");
    }

    if(configuration.table.sql != null && !configuration.table.sql.contains(GenericJdbcConnectorConstants.SQL_CONDITIONS_TOKEN)) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "sql", "SQL statement must contain placeholder for auto generated "
        + "conditions - " + GenericJdbcConnectorConstants.SQL_CONDITIONS_TOKEN);
View Full Code Here

    if(configuration.table.schemaName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both schema name and SQL cannot be specified");
    }

    if(configuration.table.sql != null && !configuration.table.sql.contains(GenericJdbcConnectorConstants.SQL_CONDITIONS_TOKEN)) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "sql", "SQL statement must contain placeholder for auto generated "
        + "conditions - " + GenericJdbcConnectorConstants.SQL_CONDITIONS_TOKEN);
    }

    return validation;
  }
View Full Code Here

    Validation validation = new Validation(ConnectionConfiguration.class);
    ConnectionConfiguration config = (ConnectionConfiguration)configuration;

    if(config.connection.connectionString == null
      || !config.connection.connectionString.startsWith("jdbc:")) {
      validation.addMessage(Status.UNACCEPTABLE,
        "connection", "connectionString",
        "This do not seem as a valid JDBC URL");
    }

    return validation;
View Full Code Here

  public Validation validateConnection(Object configuration) {
    Validation validation = new Validation(ConnectionConfiguration.class);
    ConnectionConfiguration config = (ConnectionConfiguration)configuration;

    if(config.connection.jdbcDriver == null) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "jdbcDriver", "Driver can't be empty");
    } else {
      try {
        Class.forName(config.connection.jdbcDriver);
      } catch (ClassNotFoundException e) {
        validation.addMessage(Status.UNACCEPTABLE, "connection", "jdbcDriver", "Can't load specified driver");
View Full Code Here

      validation.addMessage(Status.UNACCEPTABLE, "connection", "jdbcDriver", "Driver can't be empty");
    } else {
      try {
        Class.forName(config.connection.jdbcDriver);
      } catch (ClassNotFoundException e) {
        validation.addMessage(Status.UNACCEPTABLE, "connection", "jdbcDriver", "Can't load specified driver");
      }
    }

    if(config.connection.connectionString == null) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "connectionString", "JDBC URL can't be empty");
View Full Code Here

        validation.addMessage(Status.UNACCEPTABLE, "connection", "jdbcDriver", "Can't load specified driver");
      }
    }

    if(config.connection.connectionString == null) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "connectionString", "JDBC URL can't be empty");
    } else if(!config.connection.connectionString.startsWith("jdbc:")) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "connectionString", "This do not seem as a valid JDBC URL");
    }

    // See if we can connect to the database
View Full Code Here

    }

    if(config.connection.connectionString == null) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "connectionString", "JDBC URL can't be empty");
    } else if(!config.connection.connectionString.startsWith("jdbc:")) {
      validation.addMessage(Status.UNACCEPTABLE, "connection", "connectionString", "This do not seem as a valid JDBC URL");
    }

    // See if we can connect to the database
    try {
      DriverManager.getConnection(config.connection.connectionString,
View Full Code Here

    // See if we can connect to the database
    try {
      DriverManager.getConnection(config.connection.connectionString,
        config.connection.username, config.connection.password);
    } catch (SQLException e) {
      validation.addMessage(Status.ACCEPTABLE, "connection", "Can't connect to the database with given credentials: " + e.getMessage());
    }

    // Return final validation object
    return validation;
  }
View Full Code Here

  private Validation validateExportJob(Object jobConfiguration) {
    Validation validation = new Validation(ExportJobConfiguration.class);
    ExportJobConfiguration configuration = (ExportJobConfiguration)jobConfiguration;

    if(configuration.table.tableName == null && configuration.table.sql == null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Either table name or SQL must be specified");
    }
    if(configuration.table.tableName != null && configuration.table.sql != null) {
      validation.addMessage(Status.UNACCEPTABLE, "table", "Both table name and SQL cannot be specified");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.