Package io.fabric8.gateway

Examples of io.fabric8.gateway.ServiceDTO


  }

  @Override
  public INodeStatistics getNodeStats(String nodeId) {
    if (nodeId != null) {
      CamelProcessorMBean processorMBean = camelContextNode.getProcessorMBean(nodeId);
      if (processorMBean != null) {
        return new ProcessorNodeStatistics(processorMBean);
      }
    }
    return null;
View Full Code Here


                remove = true;
                break;
            default:
                return;
        }
        ServiceDTO dto = null;
        try {
            dto = mapper.readValue(data, ServiceDTO.class);
            expandPropertyResolvers(dto);
            List<String> services = dto.getServices();

            Map<String,String> params = new HashMap<String, String>();
            params.put("id", paramValue(dto.getId()));
            params.put("container", paramValue(dto.getContainer()));
            params.put("version", paramValue(dto.getVersion()));
            params.put("bundleName", paramValue(dto.getBundleName()));
            params.put("bundleVersion", paramValue(dto.getBundleVersion()));
            mappingRuleConfiguration.updateMappingRules(remove, path, services, params, dto);
        } catch (IOException e) {
            LOG.warn("Failed to parse the JSON: " + new String(data) + ". Reason: " + e, e);
        } catch (URISyntaxException e) {
            LOG.warn("Failed to update URI for dto: " + dto + ", .Reason: " + e, e);
View Full Code Here

            ServiceListSchema serviceListSchema = client.getServices();
            for (ServiceSchema schema : serviceListSchema.getItems()) {
                if (selectorMatch(schema.getSelector())) {
                    String contextPath = schema.getId();
                   
                    ServiceDTO dto = new ServiceDTO();
                    dto.setId(schema.getId());
                    dto.setContainer(schema.getSelector().get("container"));
                    dto.setVersion(schema.getSelector().get("version"));
                   
                    Map<String, String> params = new HashMap<String, String>();
                    params.put("id", paramValue(dto.getId()));
                    params.put("container", paramValue(dto.getContainer()));
                    params.put("version", paramValue(dto.getVersion()));
                    //is there a better way to obtain the complete url?
                    String service = "http://localhost:" + schema.getPort() + "/" + schema.getId();
                    List<String> services = Arrays.asList(service);
                    if (!contextPathsCache.contains(contextPath)) {
                        LOG.info("Adding " + service);
View Full Code Here

    protected void addService(String path, String service, String version) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("version", version);
        String container = path.contains("HelloWorld") ? "soapy" : "resty";
        params.put("container", container);
        ServiceDTO serviceDetails = new ServiceDTO();
        serviceDetails.setContainer(container);
        serviceDetails.setVersion(version);
        config.updateMappingRules(false, path, Arrays.asList(service), params, serviceDetails);
    }
View Full Code Here

                remove = true;
                break;
            default:
                return;
        }
        ServiceDTO dto = null;
        try {
            dto = mapper.readValue(data, ServiceDTO.class);
            expandPropertyResolvers(dto);
            if (remove) {
                serviceMap.serviceRemoved(path, dto);
View Full Code Here

            Broker broker = createBroker(name);
            ServiceControl.start(broker);
            brokers.add(broker);

            // Add a service map entry for the broker.
            ServiceDTO details = new ServiceDTO();
            details.setId(name);
            details.setVersion("1.0");
            details.setContainer("testing");
            details.setBundleName("none");
            details.setBundleVersion("1.0");
            List<String> services = Arrays.asList(
                "stomp://localhost:" + portOfBroker(i),
                "mqtt://localhost:" + portOfBroker(i),
                "amqp://localhost:" + portOfBroker(i),
                "tcp://localhost:" + portOfBroker(i)
            );
            details.setServices(services);
            serviceMap.serviceUpdated(name, details);

            println(String.format("Broker %s is exposing: %s", name, services));
        }
    }
View Full Code Here

                remove = true;
                break;
            default:
                return;
        }
        ServiceDTO dto = null;
        try {
            dto = mapper.readValue(data, ServiceDTO.class);
            expandPropertyResolvers(dto);
            if (remove) {
                LOG.info("Removed gateway service: "+path+": "+new String(data, "UTF-8"));
View Full Code Here

    protected void addService(String path, String service, String version) {
        Map<String, String> params = new HashMap<String, String>();
        params.put("version", version);
        String container = path.contains("HelloWorld") ? "soapy" : "resty";
        params.put("container", container);
        ServiceDTO serviceDetails = new ServiceDTO();
        serviceDetails.setContainer(container);
        serviceDetails.setVersion(version);
        config.updateMappingRules(false, path, Arrays.asList(service), params, serviceDetails);
    }
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getImage(java.lang.Object)
   */
  @Override
  public Image getImage(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return getLevelImage(le);
    }
    return super.getImage(element);
  }
View Full Code Here

   * @see
   * org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
   */
  @Override
  public String getText(Object element) {
    LogEvent le = LogViewTabSection.toLogEvent(element);
    if (le != null) {
      return le.getLevel();
    }
    return super.getText(element);
  }
View Full Code Here

TOP

Related Classes of io.fabric8.gateway.ServiceDTO

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.