Package brooklyn.util.net

Examples of brooklyn.util.net.Cidr


    @Override
    public InetAddress attachNetwork(String containerId) {
        Tasks.setBlockingDetails("Attach Weave to " + containerId);
        try {
            Cidr cidr = getEntity().getConfig(WeaveInfrastructure.WEAVE_CIDR);
            InetAddress address = getEntity().getConfig(WeaveContainer.WEAVE_INFRASTRUCTURE).get();
            ((WeaveContainer) getEntity()).getDockerHost().execCommand(BashCommands.sudo(String.format("%s attach %s/%d %s",
                    getWeaveCommand(), address.getHostAddress(), cidr.getLength(), containerId)));
            return address;
        } finally {
            Tasks.resetBlockingDetails();
        }
    }
View Full Code Here


        setAttribute(ALLOCATED_IPS, 0);
    }

    @Override
    public synchronized InetAddress get() {
        Cidr cidr = getConfig(WEAVE_CIDR);
        Integer allocated = getAttribute(ALLOCATED_IPS);
        InetAddress next = cidr.addressAtOffset(allocated + 1);
        setAttribute(ALLOCATED_IPS, allocated + 1);
        return next;
    }
View Full Code Here

TOP

Related Classes of brooklyn.util.net.Cidr

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.