Package org.apache.sqoop.json

Examples of org.apache.sqoop.json.ValidationBean


    JSONObject connectionJson = connectionBean.extract();

    String response = super.post(serverUrl + RESOURCE,
                                 connectionJson.toJSONString());

    ValidationBean validationBean = new ValidationBean();
    validationBean.restore((JSONObject) JSONValue.parse(response));

    return validationBean;
  }
View Full Code Here


    String response = super.put(serverUrl + RESOURCE
                                  + connection.getPersistenceId(),
                                connectionJson.toJSONString());

    ValidationBean validationBean = new ValidationBean();
    validationBean.restore((JSONObject) JSONValue.parse(response));

    return validationBean;
  }
View Full Code Here

    return getConnectionRequest()
      .create(Environment.getServerUrl(), connection);
  }

  public static Status createConnectionApplyValidations(MConnection connection) {
    ValidationBean bean = createConnection(connection);

    Validation connector = bean.getConnectorValidation();
    Validation framework = bean.getFrameworkValidation();

    FormUtils.applyValidation(connection.getConnectorPart().getForms(),
      connector);
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(),
      connector);

    Long id = bean.getId();
    if(id != null) {
      connection.setPersistenceId(id);
    }

    return Status.getWorstStatus(connector.getStatus(), framework.getStatus());
View Full Code Here

    return getConnectionRequest()
      .update(Environment.getServerUrl(), connection);
  }

  public static Status updateConnectionApplyValidations(MConnection connection){
    ValidationBean bean = updateConnection(connection);

    Validation connector = bean.getConnectorValidation();
    Validation framework = bean.getFrameworkValidation();

    FormUtils.applyValidation(connection.getConnectorPart().getForms(),
      connector);
    FormUtils.applyValidation(connection.getFrameworkPart().getForms(),
      connector);

    Long id = bean.getId();
    if(id != null) {
      connection.setPersistenceId(id);
    }

    return Status.getWorstStatus(connector.getStatus(), framework.getStatus());
View Full Code Here

  public static ValidationBean createJob(MJob job) {
    return getJobRequest().create(Environment.getServerUrl(), job);
  }

  public static Status createJobApplyValidations(MJob job) {
    ValidationBean bean = createJob(job);

    Validation connector = bean.getConnectorValidation();
    Validation framework = bean.getFrameworkValidation();

    FormUtils.applyValidation(job.getConnectorPart().getForms(),
      connector);
    FormUtils.applyValidation(job.getFrameworkPart().getForms(),
      connector);

    Long id = bean.getId();
    if(id != null) {
      job.setPersistenceId(id);
    }

    return Status.getWorstStatus(connector.getStatus(), framework.getStatus());
View Full Code Here

  public static ValidationBean updateJob(MJob job) {
    return getJobRequest().update(Environment.getServerUrl(), job);
  }

  public static Status updateJobApplyValidations(MJob job) {
    ValidationBean bean = updateJob(job);

    Validation connector = bean.getConnectorValidation();
    Validation framework = bean.getFrameworkValidation();

    FormUtils.applyValidation(job.getConnectorPart().getForms(),
      connector);
    FormUtils.applyValidation(job.getFrameworkPart().getForms(),
      connector);

    Long id = bean.getId();
    if(id != null) {
      job.setPersistenceId(id);
    }

    return Status.getWorstStatus(connector.getStatus(), framework.getStatus());
View Full Code Here

    Status finalStatus = Status.getWorstStatus(connectorValidation.getStatus(),
      frameworkValidation.getStatus());

    // Return back validations in all cases
    ValidationBean outputBean =
      new ValidationBean(connectorValidation, frameworkValidation);

    // If we're good enough let's perform the action
    if(finalStatus.canProceed()) {
      if(update) {
        RepositoryManager.getInstance().getRepository().updateConnection(connection);
      } else {
        RepositoryManager.getInstance().getRepository().createConnection(connection);
        outputBean.setId(connection.getPersistenceId());
      }
    }

    return outputBean;
  }
View Full Code Here

    Status finalStatus = Status.getWorstStatus(connectorValidation.getStatus(),
      frameworkValidation.getStatus());

    // Return back validations in all cases
    ValidationBean outputBean =
      new ValidationBean(connectorValidation, frameworkValidation);

    // If we're good enough let's perform the action
    if(finalStatus.canProceed()) {
      if(update) {
        RepositoryManager.getInstance().getRepository().updateJob(job);
      } else {
        RepositoryManager.getInstance().getRepository().createJob(job);
        outputBean.setId(job.getPersistenceId());
      }

    }

    return outputBean;
View Full Code Here

    JSONObject jobJson = jobBean.extract(false);

    String response = super.post(serverUrl + RESOURCE,
      jobJson.toJSONString());

    ValidationBean validationBean = new ValidationBean();
    validationBean.restore((JSONObject) JSONValue.parse(response));

    return validationBean;
  }
View Full Code Here

    JSONObject jobJson = jobBean.extract(false);

    String response = super.put(serverUrl + RESOURCE + job.getPersistenceId(),
                                jobJson.toJSONString());

    ValidationBean validationBean = new ValidationBean();
    validationBean.restore((JSONObject) JSONValue.parse(response));

    return validationBean;
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.json.ValidationBean

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.