Examples of PortMapping


Examples of com.spotify.helios.common.descriptors.PortMapping

   * Create container port exposure configuration for a job.
   */
  private Set<String> containerExposedPorts() {
    final Set<String> ports = Sets.newHashSet();
    for (final Map.Entry<String, PortMapping> entry : job.getPorts().entrySet()) {
      final PortMapping mapping = entry.getValue();
      ports.add(containerPort(mapping.getInternalPort(), mapping.getProtocol()));
    }
    return ports;
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.PortMapping

   * Create a port binding configuration for the job.
   */
  private Map<String, List<PortBinding>> portBindings() {
    final Map<String, List<PortBinding>> bindings = Maps.newHashMap();
    for (final Map.Entry<String, PortMapping> e : job.getPorts().entrySet()) {
      final PortMapping mapping = e.getValue();
      final PortBinding binding = new PortBinding();
      final Integer externalPort = mapping.getExternalPort();
      if (externalPort == null) {
        binding.hostPort(ports.get(e.getKey()).toString());
      } else {
        binding.hostPort(externalPort.toString());
      }
      final String entry = containerPort(mapping.getInternalPort(), mapping.getProtocol());
      bindings.put(entry, asList(binding));
    }
    return bindings;
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.PortMapping

        final JobStatus jobStatus = getOrNull(client.jobStatus(jobId));
        final TaskStatus taskStatus = jobStatus.getTaskStatuses().get(host);
        if (taskStatus.getThrottled() == FLAPPING) {
          return true;
        }
        final PortMapping port = taskStatus.getPorts().get("poke");
        assert port.getExternalPort() != null;
        poke(port.getExternalPort());
        return null;
      }
    });

    // Verify that the job recovers after we stop poking
View Full Code Here

Examples of com.spotify.helios.common.descriptors.PortMapping

    }

    // Verify port mappings
    for (final Map.Entry<String, PortMapping> entry : job.getPorts().entrySet()) {
      final String name = entry.getKey();
      final PortMapping mapping = entry.getValue();
      if (!PORT_MAPPING_PROTO_PATTERN.matcher(mapping.getProtocol()).matches()) {
        errors.add(format("Invalid port mapping protocol: %s", mapping.getProtocol()));
      }
      if (!legalPort(mapping.getInternalPort())) {
        errors.add(format("Invalid internal port: %d", mapping.getInternalPort()));
      }
      if (mapping.getExternalPort() != null && !legalPort(mapping.getExternalPort())) {
        errors.add(format("Invalid external port: %d", mapping.getExternalPort()));
      }
      if (!PORT_MAPPING_NAME_PATTERN.matcher(name).matches()) {
        errors.add(format("Invalid port mapping endpoint name: %s", name));
      }
    }
View Full Code Here

Examples of org.apache.stratos.adc.mgt.dao.PortMapping

      if (log.isDebugEnabled()) {
        log.debug("Executing query: " + sql);
      }
      resultSet = statement.executeQuery();
      while (resultSet.next()) {
        PortMapping portMapping = new PortMapping();
        portMapping.setPrimaryPort(resultSet.getString("PRIMARY_PORT"));
        portMapping.setProxyPort(resultSet.getString("PROXY_PORT"));
        portMapping.setType(resultSet.getString("TYPE"));
        portMappingList.add(portMapping);
      }
    } catch (Exception s) {
      String msg = "Error while sql connection :" + s.getMessage();
      log.error(msg, s);
View Full Code Here

Examples of org.apache.stratos.adc.mgt.dao.PortMapping

    private static List<PortMapping> createPortMappings(CartridgeInfo cartridgeInfo) {
        List<PortMapping> portMappings = new ArrayList<PortMapping>();

        if (cartridgeInfo.getPortMappings() != null) {
            for (org.apache.stratos.cloud.controller.util.xsd.PortMapping portMapping : cartridgeInfo.getPortMappings()) {
                PortMapping portMap = new PortMapping();
                portMap.setPrimaryPort(portMapping.getPort());
                portMap.setProxyPort(portMapping.getProxyPort());
                portMap.setType(portMapping.getProtocol());
                portMappings.add(portMap);
            }
        }
        return portMappings;
    }
View Full Code Here

Examples of org.apache.stratos.cloud.controller.util.PortMapping

                                                                CloudControllerConstants.PORT_ATTR));
              String proxyPort =
                                 httpElt.getAttributeValue(new QName(
                                                                     CloudControllerConstants.PROXY_PORT_ATTR));

              PortMapping mapping =
                                    new PortMapping(
                                                    CloudControllerConstants.HTTP_ELEMENT,
                                                    port, proxyPort);

              aCartridge.addPortMapping(mapping);
            }

            for (Iterator<?> iterator =
                                        portMappingElt.getChildrenWithName(new QName(
                                                                                     CloudControllerConstants.HTTPS_ELEMENT)); iterator.hasNext();) {
              OMElement httpsElt = (OMElement) iterator.next();

              String port =
                            httpsElt.getAttributeValue(new QName(
                                                                 CloudControllerConstants.PORT_ATTR));
              String proxyPort =
                                 httpsElt.getAttributeValue(new QName(
                                                                      CloudControllerConstants.PROXY_PORT_ATTR));

              PortMapping mapping =
                                    new PortMapping(
                                                    CloudControllerConstants.HTTPS_ELEMENT,
                                                    port, proxyPort);

              aCartridge.addPortMapping(mapping);
            }
View Full Code Here

Examples of org.apache.stratos.manager.dao.PortMapping

  private static List<PortMapping> createPortMappings(CartridgeInfo cartridgeInfo) {
        List<PortMapping> portMappings = new ArrayList<PortMapping>();

        if (cartridgeInfo.getPortMappings() != null) {
            for (org.apache.stratos.cloud.controller.stub.pojo.PortMapping portMapping : cartridgeInfo.getPortMappings()) {
                PortMapping portMap = new PortMapping();
                portMap.setPrimaryPort(portMapping.getPort());
                portMap.setProxyPort(portMapping.getProxyPort());
                portMap.setType(portMapping.getProtocol());
                portMappings.add(portMap);
            }
        }
        return portMappings;
    }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.PortMapping

      for (int j = 0; j < lenendpoints; j++)
      {
         WSDLEndpoint endpt = endpoints[j];
         String portname = endpt.getName().getLocalPart();
         //port mapping
         PortMapping pm = new PortMapping(sim);
         pm.setPortName(portname);
         pm.setJavaPortName(portname);
         sim.addPortMapping(pm);
      }
      return sim;
   }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.PortMapping

      ServiceInterfaceMapping serviceMapping = new ServiceInterfaceMapping(javaWsdlMapping);
      serviceMapping.setServiceInterface(serviceInterfaceName);
      serviceMapping.setWsdlServiceName(serviceQName);

      String endpointName = endpoint.getPortName().getLocalPart();
      PortMapping portMapping = new PortMapping(serviceMapping);
      portMapping.setJavaPortName(endpointName);
      portMapping.setPortName(endpointName);
      serviceMapping.addPortMapping(portMapping);

      javaWsdlMapping.addServiceInterfaceMappings(serviceMapping);

      String interfaceName = endpoint.getPortTypeName().getLocalPart();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.