Examples of Cidr


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

Examples of brooklyn.util.net.Cidr

        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
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.