Examples of IpRange


Examples of com.alibaba.druid.support.http.util.IPRange

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    allowList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, allow : " + getInitParameter(PARAM_NAME_ALLOW);
            LOG.error(msg, e);
        }

        try {
            String param = getInitParameter(PARAM_NAME_DENY);
            if (param != null && param.trim().length() != 0) {
                param = param.trim();
                String[] items = param.split(",");

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    denyList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, deny : " + getInitParameter(PARAM_NAME_DENY);
View Full Code Here

Examples of com.alibaba.druid.support.http.util.IPRange

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    allowList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, allow : " + getInitParameter(PARAM_NAME_ALLOW);
            LOG.error(msg, e);
        }

        try {
            String param = getInitParameter(PARAM_NAME_DENY);
            if (param != null && param.trim().length() != 0) {
                param = param.trim();
                String[] items = param.split(",");

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    denyList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, deny : " + getInitParameter(PARAM_NAME_DENY);
View Full Code Here

Examples of com.alibaba.druid.support.http.util.IPRange

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    allowList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, allow : " + getInitParameter(PARAM_NAME_ALLOW);
            LOG.error(msg, e);
        }

        try {
            String param = getInitParameter(PARAM_NAME_DENY);
            if (param != null && param.trim().length() != 0) {
                param = param.trim();
                String[] items = param.split(",");

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    denyList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, deny : " + getInitParameter(PARAM_NAME_DENY);
View Full Code Here

Examples of com.alibaba.druid.support.http.util.IPRange

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    allowList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, allow : " + getInitParameter(PARAM_NAME_ALLOW);
            LOG.error(msg, e);
        }

        try {
            String param = getInitParameter(PARAM_NAME_DENY);
            if (param != null && param.trim().length() != 0) {
                param = param.trim();
                String[] items = param.split(",");

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    denyList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, deny : " + getInitParameter(PARAM_NAME_DENY);
View Full Code Here

Examples of com.alibaba.druid.support.http.util.IPRange

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    allowList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, allow : " + getInitParameter(PARAM_NAME_ALLOW);
            LOG.error(msg, e);
        }

        try {
            String param = getInitParameter(PARAM_NAME_DENY);
            if (param != null && param.trim().length() != 0) {
                param = param.trim();
                String[] items = param.split(",");

                for (String item : items) {
                    if (item == null || item.length() == 0) {
                        continue;
                    }

                    IPRange ipRange = new IPRange(item);
                    denyList.add(ipRange);
                }
            }
        } catch (Exception e) {
            String msg = "initParameter config error, deny : " + getInitParameter(PARAM_NAME_DENY);
View Full Code Here

Examples of io.fathom.cloud.compute.networks.IpRange

    public HostData getHostData() {
        return hostData;
    }

    public InetAddress getIpAddress() {
        IpRange range = IpRange.parse(hostData.getCidr());
        return range.getAddress();
    }
View Full Code Here

Examples of io.fathom.cloud.compute.networks.IpRange

        super("host-update");
    }

    @Override
    protected HostData run0() throws Exception {
        IpRange range = IpRange.parse(cidr);
        if (!range.isIpv6()) {
            throw new IllegalArgumentException("Only IPV6 is supported");
        }

        HostData host = networkMap.findHost(cidr);
        if (host == null) {
View Full Code Here

Examples of io.fathom.cloud.compute.networks.IpRange

            }

            if (!Strings.isNullOrEmpty(rule.srcGroupId)) {
                throw new UnsupportedOperationException();
            } else if (!Strings.isNullOrEmpty(rule.cidr)) {
                IpRange range = IpRange.parse(rule.cidr);

                CidrData.Builder cidr = r.getFromCidrBuilder();
                cidr.setAddress(ByteString.copyFrom(range.getAddress().getAddress()));
                cidr.setPrefixLength(range.getNetmaskLength());
            } else {
                throw new IllegalArgumentException("Must specify source cidr or group");
            }

            String protocol = rule.protocol;
View Full Code Here

Examples of io.fathom.cloud.compute.networks.IpRange

        // Horizon wants this to be present, even when empty
        model.ipRange = new SecurityGroupRule.IpRange();

        if (data.hasFromCidr()) {
            CidrData cidr = data.getFromCidr();
            IpRange range = Instance.toIpRange(cidr);

            model.ipRange.cidr = InetAddresses.toAddrString(range.getAddress()) + "/" + range.getNetmaskLength();
        }

        return model;
    }
View Full Code Here

Examples of io.fathom.cloud.compute.networks.IpRange

        super("host-create");
    }

    @Override
    protected HostData run0() throws Exception {
        IpRange range = IpRange.parse(cidr);
        if (!range.isIpv6()) {
            throw new IllegalArgumentException("Only IPV6 is supported");
        }

        if (range.getNetmaskLength() > 124) {
            // No real reason, just to keep things sensible
            throw new IllegalArgumentException("Must allocate at least a /124");
        }

        // DatacenterData dc = getDatacenter(datacenterKey);
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.