Package org.apache.hadoop.gateway.services.topology

Examples of org.apache.hadoop.gateway.services.topology.TopologyService


      KeystoreService ks = services.getService(GatewayServices.KEYSTORE_SERVICE);
      return ks;
    }

    protected TopologyService getTopologyService()  {
      TopologyService ts = services.getService(GatewayServices.TOPOLOGY_SERVICE);
      return ts;
    }
View Full Code Here


    public static final String DESC =
        "Redeploys one or all of the gateway's clusters (a.k.a topologies).";

    @Override
    public void execute() throws Exception {
      TopologyService ts = getTopologyService();
      ts.reloadTopologies();
      if (cluster != null) {
        if (validateClusterName(cluster, ts)) {
          ts.redeployTopologies(cluster);
        }
        else {
          out.println("Invalid clusterName provided. No topologies to redeploy.");
        }
      }
View Full Code Here

    input.close();
  }


  public static void redeployTopologies( String topologyName  ) {
    TopologyService ts = getGatewayServices().getService(GatewayServices.TOPOLOGY_SERVICE);
    ts.reloadTopologies();
    ts.redeployTopologies(topologyName);
  }
View Full Code Here

  @Path("topologies/{id}")
  public Topology getTopology(@PathParam("id") String id) {
    GatewayServices services = (GatewayServices) request.getServletContext()
        .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE);

    TopologyService ts = services.getService(GatewayServices.TOPOLOGY_SERVICE);

    for (Topology t : ts.getTopologies()) {
      if(t.getName().equals(id)) {
        try {
          t.setUri(new URI(request.getRequestURL().substring(0, request.getRequestURL().indexOf("gateway")) + "gateway/" + t.getName()));
        } catch (URISyntaxException se) {
          t.setUri(null);
View Full Code Here

  public SimpleTopologyWrapper getTopologies() {
    GatewayServices services = (GatewayServices) request.getServletContext()
        .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE);


    TopologyService ts = services.getService(GatewayServices.TOPOLOGY_SERVICE);

    ArrayList<SimpleTopology> st = new ArrayList<SimpleTopology>();

    for (Topology t : ts.getTopologies()) {
      st.add(getSimpleTopology(t, request.getRequestURL().toString()));
    }

    Collections.sort(st, new TopologyComparator());
    SimpleTopologyWrapper stw = new SimpleTopologyWrapper();
View Full Code Here

    GatewayServices gs = (GatewayServices) request.getServletContext()
        .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE);

    t.setName(id);
    TopologyService ts = gs.getService(GatewayServices.TOPOLOGY_SERVICE);

    ts.deployTopology(t);

    return getTopology(id);
  }
View Full Code Here

    boolean deleted = false;
    if(!id.equals("admin")) {
      GatewayServices services = (GatewayServices) request.getServletContext()
          .getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE);

      TopologyService ts = services.getService(GatewayServices.TOPOLOGY_SERVICE);

      for (Topology t : ts.getTopologies()) {
        if(t.getName().equals(id)) {
          ts.deleteTopology(t);
          deleted = true;
        }
      }
    }else{
      deleted = false;
View Full Code Here

    String url = gatewayUrl + "/" + testTopology.getName() + "/test-service-path/test-service-resource";

    GatewayServices srvs = GatewayServer.getGatewayServices();

    TopologyService ts = srvs.getService(GatewayServices.TOPOLOGY_SERVICE);

    assertThat(testTopology, not(nullValue()));
    assertThat(testTopology.getName(), is("test-topology"));

    given()
        //.log().all()
        .auth().preemptive().basic(user, password)
        .expect()
        //.log().all()
        .statusCode(HttpStatus.SC_NOT_FOUND)
        .when()
        .get(url);

    ts.deployTopology(testTopology);

    given()
        //.log().all()
        .auth().preemptive().basic(user, password)
        .expect()
        //.log().all()
        .statusCode(HttpStatus.SC_OK)
        .contentType("text/plain")
        .body(is("test-service-response"))
        .when()
        .get(url).getBody();

    ts.deleteTopology(testTopology);

    given()
        //.log().all()
        .auth().preemptive().basic(user, password)
        .expect()
View Full Code Here

    String password = "admin-password";
    String url =  clusterUrl + "/api/v1/topologies/" + test.getName();

    GatewayServices gs = GatewayServer.getGatewayServices();

    TopologyService ts = gs.getService(GatewayServices.TOPOLOGY_SERVICE);

    ts.deployTopology(test);

    given()
        .auth().preemptive().basic(username, password)
        .expect()
        //.log().all()
View Full Code Here

TOP

Related Classes of org.apache.hadoop.gateway.services.topology.TopologyService

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.