Package io.fabric8.process.manager.config

Examples of io.fabric8.process.manager.config.ProcessConfig


    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        Kubernetes kubernetes = getKubernetes();

        String idText = replicationControllerId.getValue();
        ReplicationControllerSchema replicationController = kubernetes.getReplicationController(idText);
        if (replicationController == null) {
            System.out.println("No replicationController for id: " + idText);
        } else {
            executeReplicationController(replicationController);
        }
View Full Code Here


        }
        String kuberneteMasterUrl = args[0];
        String podID = args[1];
        System.out.println("Looking up ReplicationController for pod ID: " + podID);
        KubernetesClient client = new KubernetesClient(kuberneteMasterUrl);
        ReplicationControllerSchema replicationController = client.getReplicationControllerForPod(podID);
        if (replicationController != null ){
            String id = replicationController.getId();
            System.out.println("Found replication controller: " + id);
        } else {
            System.out.println("Could not find replication controller!");
        }
    }
View Full Code Here

    }

    @Override
    public Result execute(UIExecutionContext uiExecutionContext) throws Exception {
        Kubernetes kubernetes = getKubernetes();
        ServiceListSchema services = kubernetes.getServices();
        printServices(services, System.out);
        return null;
    }
View Full Code Here

   
    public void refreshServices() {
        List<String> currentCache = new ArrayList<String>();
        currentCache.addAll(contextPathsCache);
        try {
            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());
View Full Code Here

* Parses the example JSON
*/
public class ParseServiceTest {
    @Test
    public void testParseFabric8MQService() throws Exception {
        ServiceSchema service = assertParseTestFile("fmq-service.json", ServiceSchema.class);
        Integer port = service.getPort();
        assertNotNull("port", port);
        IntOrString containerPort = service.getContainerPort();
        assertNotNull("containerPort", containerPort);

        String json = KubernetesHelper.toJson(service);
        System.out.println("Got JSON: " + json);
    }
View Full Code Here

        }
    }

    public static Map<String, String> getInstallationProxyPorts(Installation installation) {
        Map<String,String> initialEnvironmentVariables = new HashMap<String, String>();
        ProcessConfig currentConfig = getProcessConfig(installation);
        if (currentConfig != null) {
            // lets preserve the ports allocated
            Map<String, String> environment = currentConfig.getEnvironment();
            for (Map.Entry<String, String> entry : environment.entrySet()) {
                String key = entry.getKey();
                if (key.endsWith("_PROXY_PORT")) {
                    String value = entry.getValue();
                    initialEnvironmentVariables.put(key, value);
View Full Code Here

        }
        return initialEnvironmentVariables;
    }

    protected void updateInstallation(Container container, final Installation installation, InstallOptions parameters, InstallTask postInstall) throws Exception {
        ProcessConfig processConfig = processManager.loadProcessConfig(parameters);
        processConfig.setName(parameters.getName());
        ProcessConfig oldConfig = getProcessConfig(installation);

        String id = installation.getId();
        File installDir = installation.getInstallDir();
        InstallContext installContext = new InstallContext(parameters.getContainer(), installDir, true);

        if (processConfig != null && !oldConfig.equals(processConfig)) {
            installContext.addRestartReason("Environment Variables");
            if (LOG.isDebugEnabled()) {
                LOG.debug("Requires restart as config has changed: OLD: " + JsonHelper.toJson(oldConfig) + " and NEW: " + JsonHelper.toJson(processConfig));
            }
            // need to resolve the environment variables first
View Full Code Here

    public void setUp() throws Exception {
        System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");

        InstallOptions installOptions = new InstallOptions.InstallOptionsBuilder().build();
        String processId = new ProcessManagerService(installDir).installJar(installOptions, postInstall).getId();
        controller = new DefaultProcessController(processId, new ProcessConfig(), installDir, new File(installDir, processId));
    }
View Full Code Here

    }

    @Test
    public void shouldInstallJarDependencies() throws Exception {
        InstallContext installContext = new InstallContext(null, installDir, false);
        jarInstaller.install(installContext, new ProcessConfig(), "1", installDir);
        assertTrue(new File(installDir, "lib/xstream-1.4.4.jar").exists());
    }
View Full Code Here

    @Test
    public void shouldCopyMainJar() throws Exception {
        // When
        InstallContext installContext = new InstallContext(null, installDir, false);
        jarInstaller.install(installContext, new ProcessConfig(), "1", installDir);

        // Then
        Manifest manifest = new Jar(new File(installDir, "lib/main.jar")).getManifest();
        assertEquals("org.apache.camel.camel-xstream", manifest.getMainAttributes().getValue("Bundle-SymbolicName"));
    }
View Full Code Here

TOP

Related Classes of io.fabric8.process.manager.config.ProcessConfig

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.