Package io.fabric8.api

Examples of io.fabric8.api.Container


    @Override
    public Container getContainer(String name) {
        assertValid();
        if (dataStore.get().hasContainer(name)) {
            Container parent = null;
            String parentId = dataStore.get().getContainerParent(name);
            if (parentId != null && !parentId.isEmpty()) {
                parent = getContainer(parentId);
            }
            return new ContainerImpl(parent, name, this);
View Full Code Here


        startContainer(containerId, false);
    }

    public void startContainer(String containerId, boolean force) {
        assertValid();
        Container container = getContainer(containerId);
        if (container != null) {
            startContainer(container, force);
        }
    }
View Full Code Here

        stopContainer(containerId, false);
    }

    public void stopContainer(String containerId, boolean force) {
        assertValid();
        Container container = getContainer(containerId);
        if (container != null) {
            stopContainer(container, force);
        }
    }
View Full Code Here

        destroyContainer(containerId, false);
    }

    public void destroyContainer(String containerId, boolean force) {
        assertValid();
        Container container = getContainer(containerId);
        if (container != null) {
            destroyContainer(container, force);
        }
    }
View Full Code Here

                                return;
                            }
                            dataStore.get().createContainerConfig(containerOptions);
                            CreateContainerMetadata metadata = provider.create(containerOptions, containerListener);
                            if (metadata.isSuccess()) {
                                Container parent = containerOptions.getParent() != null ? getContainer(containerOptions.getParent()) : null;
                                //An ensemble server can be created without an existing ensemble.
                                //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);
View Full Code Here

                        boolean dependencyFound = false;
                        Iterator<String> childIterator = children.iterator();

                        while (!dependencyFound && childIterator.hasNext()) {
                            String containerName = childIterator.next();
                            Container container = this.getContainer(containerName);
                            Profile[] profiles = container.getProfiles();
                            int profileCount = 0;

                            while (!dependencyFound && profileCount < profiles.length) {
                                Profile profile = profiles[profileCount];
                                if (config.getProfileWildcards() != null) {
View Full Code Here

    protected Object doExecute() throws Exception {
        FabricValidations.validateContainerName(container);
        //Do not validate profile names, because we want to be able to remove non-existent profiles.

        Container cont = FabricCommand.getContainer(fabricService, container);
        // allow to remove non-existing profiles
        List<String> profileIds = new ArrayList<>();
        for (Profile profile : FabricCommand.getProfiles(fabricService, cont.getVersion(), profiles)) {
          profileIds.add(profile.getId());
        }
        cont.removeProfiles(profileIds.toArray(new String[profileIds.size()]));
        return null;
    }
View Full Code Here

        }
    }

    private String publicPort(String containerName, final String port) {
        FabricService fabric = fabricService.get();
        Container container = fabric.getContainer(containerName);

        ContainerTemplate containerTemplate = new ContainerTemplate(container, fabric.getZooKeeperUser(), fabric.getZookeeperPassword(), false);
        return containerTemplate.execute(new JmxTemplateSupport.JmxConnectorCallback<String>() {
            @Override
            public String doWithJmxConnector(JMXConnector connector) throws Exception {
View Full Code Here

    /**
     * Creates an aggregation of all available {@link Profile}s.
     */
    private Profile getAllProfilesOverlay() {
        Container container = fabricService.get().getCurrentContainer();
        ProfileService profileService = fabricService.get().adapt(ProfileService.class);
        Version version = container.getVersion();
        Profile versionProfile = getVersionProfile(version);
        return Profiles.getEffectiveProfile(fabricService.get(), profileService.getOverlayProfile(versionProfile));
    }
View Full Code Here

    private ChildContainerController createKarafContainerController() {
        return new ChildContainerController() {
            @Override
            public CreateChildContainerMetadata create(final CreateChildContainerOptions options, final CreationStateListener listener) {
                final Container parent = fabricService.get().getContainer(options.getParent());
                ContainerTemplate containerTemplate = new ContainerTemplate(parent, options.getJmxUser(), options.getJmxPassword(), false);

                return containerTemplate.execute(new ContainerTemplate.AdminServiceCallback<CreateChildContainerMetadata>() {
                    public CreateChildContainerMetadata doWithAdminService(AdminServiceMBean adminService) throws Exception {
                        return doCreateKaraf(adminService, options, listener, parent);
View Full Code Here

TOP

Related Classes of io.fabric8.api.Container

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.