Package org.apache.sqoop.model

Examples of org.apache.sqoop.model.MConnection


   * @param xid Connection id
   * @param type Job type
   * @return
   */
  public MJob newJob(long xid, MJob.Type type) {
    MConnection connection = getConnection(xid);

    return new MJob(
      connection.getConnectorId(),
      connection.getPersistenceId(),
      type,
      getConnector(connection.getConnectorId()).getJobForms(type),
      getFramework().getJobForms(type)
    );
  }
View Full Code Here


   */
  public static void displayFormWarning(MAccountableEntity entity) {
    List<MForm> formList = new ArrayList<MForm>();
    boolean showMessage = true;
    if (entity instanceof MConnection) {
      MConnection connection = (MConnection) entity;
      formList.addAll(connection.getConnectorPart().getForms());
      formList.addAll(connection.getFrameworkPart().getForms());
    } else if(entity instanceof MJob) {
      MJob job = (MJob) entity;
      formList.addAll(job.getConnectorPart().getForms());
      formList.addAll(job.getFrameworkPart().getForms());
    }
View Full Code Here

  private void updateConnection(Long connectionId) throws IOException {
    printlnResource(Constants.RES_UPDATE_UPDATING_CONN, connectionId);

    ConsoleReader reader = new ConsoleReader();

    MConnection connection = client.getConnection(connectionId);

    ResourceBundle connectorBundle = client.getResourceBundle(connection.getConnectorId());
    ResourceBundle frameworkBundle = client.getFrameworkResourceBundle();

    Status status = Status.FINE;

    printlnResource(Constants.RES_PROMPT_UPDATE_CONN_METADATA);
View Full Code Here

  private void createConnection(long connectorId) throws IOException {
    printlnResource(Constants.RES_CREATE_CREATING_CONN, connectorId);

    ConsoleReader reader = new ConsoleReader();

    MConnection connection = client.newConnection(connectorId);

    ResourceBundle connectorBundle = client.getResourceBundle(connectorId);
    ResourceBundle frameworkBundle = client.getFrameworkResourceBundle();

    Status status = Status.FINE;
    printlnResource(Constants.RES_PROMPT_FILL_CONN_METADATA);
    do {
      // Print error introduction if needed
      if( !status.canProceed() ) {
        errorIntroduction();
      }

      // Fill in data from user
      if(!fillConnection(reader, connection, connectorBundle, frameworkBundle)) {
        return;
      }

      // Try to create
      status = client.createConnection(connection);
    } while(!status.canProceed());
    FormDisplayer.displayFormWarning(connection);
    printlnResource(Constants.RES_CREATE_CONN_SUCCESSFUL, status.name(), connection.getPersistenceId());
  }
View Full Code Here

      displayConnection(connection);
    }
  }

  private void showConnection(Long xid) {
    MConnection connection = client.getConnection(xid);

    printlnResource(Constants.RES_SHOW_PROMPT_CONNS_TO_SHOW, 1);

    displayConnection(connection);
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.model.MConnection

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.