Package org.apache.sqoop.json

Examples of org.apache.sqoop.json.ConnectorBean


    } else {
      response = super.get(serverUrl + RESOURCE + cid);
    }
    JSONObject jsonObject = (JSONObject)JSONValue.parse(response);

    ConnectorBean connectorBean = new ConnectorBean();
    connectorBean.restore(jsonObject);

    return connectorBean;
  }
View Full Code Here


      AuditLoggerManager.getInstance()
          .logAuditEvent(ctx.getUserName(), ctx.getRequest().getRemoteAddr(),
          "get", "connector", String.valueOf(id));
    }

    return new ConnectorBean(connectors, bundles);
  }
View Full Code Here

   * Getting connectors one by one should not be equivalent to getting all connectors
   * at once as Client do not know how many connectors server have.
   */
  @Test
  public void testGetConnectorOneByOne() {
    ConnectorBean bean = connectorBean(connector(1), connector(2));
    when(requests.readConnector(null)).thenReturn(bean);
    when(requests.readConnector(1L)).thenReturn(bean);
    when(requests.readConnector(2L)).thenReturn(bean);

    client.getResourceBundle(1);
View Full Code Here

    for(MConnector connector : connectors) {
      connectorList.add(connector);
      bundles.put(connector.getPersistenceId(), null);
    }
    return new ConnectorBean(connectorList, bundles);
  }
View Full Code Here

   * Retrieve connector structure from server and cache it.
   *
   * @param cid Connector id
   */
  private void retrieveConnector(long cid) {
    ConnectorBean request = requests.readConnector(cid);
    connectors.put(cid, request.getConnectors().get(0));
    bundles.put(cid, request.getResourceBundles().get(cid));
  }
View Full Code Here

  public Collection<MConnector> getConnectors() {
    if(allConnectors) {
      return connectors.values();
    }

    ConnectorBean bean = requests.readConnector(null);
    allConnectors = true;
    for(MConnector connector : bean.getConnectors()) {
      connectors.put(connector.getPersistenceId(), connector);
    }
    bundles = bean.getResourceBundles();

    return connectors.values();
  }
View Full Code Here

      connectors.add(ConnectorManager.getConnectorMetadata(id));
      bundles.put(id, ConnectorManager.getResourceBundle(id, locale));
    }

    return new ConnectorBean(connectors, bundles);
  }
View Full Code Here

    } else {
      response = super.get(serverUrl + RESOURCE + cid);
    }
    JSONObject jsonObject = (JSONObject)JSONValue.parse(response);

    ConnectorBean connectorBean = new ConnectorBean();
    connectorBean.restore(jsonObject);

    return connectorBean;
  }
View Full Code Here

        .RES_CREATE_CREATING_CONN), connectorId));

    ConsoleReader reader = new ConsoleReader();

    FrameworkBean frameworkBean = readFramework();
    ConnectorBean connectorBean = readConnector(connectorId);

    MFramework framework = frameworkBean.getFramework();
    ResourceBundle frameworkBundle = frameworkBean.getResourceBundle();

    MConnector connector = connectorBean.getConnectors().get(0);
    ResourceBundle connectorBundle = connectorBean.getResourceBundles().get(connector.getPersistenceId());

    MConnection connection = new MConnection(connector.getPersistenceId(),
                                             connector.getConnectionForms(),
                                             framework.getConnectionForms());
View Full Code Here

    return null;
  }

  private void showConnector(String cid) {
    ConnectorBean connectorBean = readConnector(cid);
    List<MConnector> connectors = connectorBean.getConnectors();
    Map<Long, ResourceBundle> bundles = connectorBean.getResourceBundles();
    String s = MessageFormat.format(getResource().getString(Constants
       .RES_SHOW_PROMPT_CONNECTORS_TO_SHOW), connectors.size());
    io.out.println(s);
    for (MConnector connector : connectors) {
      s =  MessageFormat.format(getResource().getString(Constants
View Full Code Here

TOP

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

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.