Package io.fabric8.internal

Examples of io.fabric8.internal.ContainerImpl$ContainerProfileOptions


    /**
     * Helper method to create mockish Container
     */
    private ContainerImpl newContainer(String id) {
        return new ContainerImpl(null, id, this.fabricService) {
            @Override
            public boolean isAlive() {
                return true;
            }
        };
View Full Code Here


        List<String> containerIds = dataStore.get().getContainers();
        for (String containerId : containerIds) {
            String parentId = dataStore.get().getContainerParent(containerId);
            if (parentId.isEmpty()) {
                if (!containers.containsKey(containerId)) {
                    Container container = new ContainerImpl(null, containerId, this);
                    containers.put(containerId, container);
                }
            } else {
                Container parent = containers.get(parentId);
                if (parent == null) {
                    parent = new ContainerImpl(null, parentId, this);
                    containers.put(parentId, parent);
                }
                Container container = new ContainerImpl(parent, containerId, this);
                containers.put(containerId, container);
            }
        }
        return containers.values().toArray(new Container[containers.size()]);
    }
View Full Code Here

            Container parent = null;
            String parentId = dataStore.get().getContainerParent(name);
            if (parentId != null && !parentId.isEmpty()) {
                parent = getContainer(parentId);
            }
            return new ContainerImpl(parent, name, this);
        }
        throw new FabricException("Container '" + name + "' does not exist");
    }
View Full Code Here

                                //In this case container config will be created by the newly created container.
                                //TODO: We need to make sure that this entries are somehow added even to ensemble servers.
                                if (!containerOptions.isEnsembleServer()) {
                                    dataStore.get().createContainerConfig(metadata);
                                }
                                ContainerImpl container = new ContainerImpl(parent, metadata.getContainerName(), FabricServiceImpl.this);
                                metadata.setContainer(container);
                                LOGGER.info("The container " + metadata.getContainerName() + " has been successfully created");
                            } else {
                                LOGGER.warn("The creation of the container " + metadata.getContainerName() + " has failed", metadata.getFailure());
                            }
View Full Code Here

    @Before
    public void setUp() {
        fabricService = createMock(FabricService.class);
        dataStore = createMock(DataStore.class);
        expect(fabricService.adapt(DataStore.class)).andReturn(dataStore).anyTimes();
        container = new ContainerImpl(null, CONTAINER_ID, fabricService);
    }
View Full Code Here

        expect(fabricService.adapt(DataStore.class)).andReturn(dataStore).anyTimes();

        expect(fabricService.getContainer(EasyMock.<String>anyObject())).andStubAnswer(new IAnswer<Container>() {
            @Override
            public Container answer() throws Throwable {
                return new ContainerImpl(null, (String) EasyMock.getCurrentArguments()[0], fabricService);
            }
        });

        expect(dataStore.getContainerAttribute(eq("root"), eq(DataStore.ContainerAttribute.Ip), eq(""), eq(false), eq(true))).andReturn(ip).anyTimes();
        expect(dataStore.getContainerAttribute(eq("root"), eq(DataStore.ContainerAttribute.LocalHostName), eq(""), eq(false), eq(true))).andReturn(localhostname).anyTimes();
View Full Code Here

    @Ignore("[FABRIC-1110] Mocked test makes invalid assumption on the implementation")
    public void testResolveCurrentName() throws Exception {
        final FabricService fabricService = createMock(FabricService.class);
        final DataStore dataStore = createMock(DataStore.class);
        expect(fabricService.getCurrentContainerName()).andReturn("root").anyTimes();
        expect(fabricService.getContainer(EasyMock.<String > anyObject())).andReturn(new ContainerImpl(null, "root", fabricService));

        replay(fabricService);
        replay(dataStore);

        PlaceholderResolver resolver = getContainerPlaceholderResolver();
View Full Code Here

        dataStore.setContainerAttribute(containerName, DataStore.ContainerAttribute.PortMin, String.valueOf(minimumPort));
        dataStore.setContainerAttribute(containerName, DataStore.ContainerAttribute.PortMax, String.valueOf(maximumPort));
        inheritAddresses(fabricService.get(), parent.getId(), containerName, options);

        //We are creating a container instance, just for the needs of port registration.
        Container child = new ContainerImpl(parent, containerName, fabricService.get()) {
            @Override
            public String getIp() {
                return parent.getIp();
            }
        };
View Full Code Here

    }

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        File applyFile = file.getValue();
        Controller controller = new Controller(getKubernetes());
        controller.applyJson(applyFile);
        return null;
    }
View Full Code Here

        builder.add(filterText);
    }

    @Override
    public Result execute(UIExecutionContext uiExecutionContext) throws Exception {
        Kubernetes kubernetes = getKubernetes();
        PodListSchema pods = kubernetes.getPods();
        KubernetesHelper.removeEmptyPods(pods);
        TablePrinter table = podsAsTable(pods);
        return tableResults(table);
    }
View Full Code Here

TOP

Related Classes of io.fabric8.internal.ContainerImpl$ContainerProfileOptions

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.