public static String getStringIpAddress(IpAddress ipAddress) { if (ipAddress.getIpv4Address() != null) { return ipAddress.getIpv4Address().getValue(); } return ipAddress.getIpv6Address().getValue(); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } NextHopAddressKey other = (NextHopAddressKey) obj; if (_nextHopAddress == null) { if (other._nextHopAddress != null) { return false; } } else if(!_nextHopAddress.equals(other._nextHopAddress)) { return false; } return true; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override protected Ipv4Address maybeIpv4Address(final IpAddress addr) { return addr.getIpv4Address(); }
@Override protected IpAddress ipv6Address(final Ipv6Address addr) { return new IpAddress(addr); }
public Host(IpAddress _ipAddress) { super(); this._ipAddress = _ipAddress; this._domainName = null; this._value = _ipAddress.getValue(); }
@Override protected Ipv6Address maybeIpv6Address(final IpAddress addr) { return addr.getIpv6Address(); } }
private String getIpAddress(EndpointType endpoint) { String ipAddress = ""; if( endpoint instanceof IpAddress) { ipAddress = ((IpAddress) endpoint).getIpAddress().getIpv4Address().getValue(); } else if (endpoint instanceof Interface) { ipAddress = ((Interface)endpoint).getInterfaceIp().getIpv4Address().getValue(); } return ipAddress; }
@Override protected IpAddress ipv4Address(final Ipv4Address addr) { return new IpAddress(addr); }
public char[] getValue() { if (_value == null) { if (_ipAddress != null) { _value = _ipAddress.getValue(); } else if (_domainName != null) { _value = _domainName.getValue().toString().toCharArray(); } } return _value == null ? null : _value.clone(); }
private InetSocketAddress getInetAddress() { try { final InetAddress inetAd = InetAddress.getByName(getBindingAddress().getIpv4Address() == null ? getBindingAddress().getIpv6Address().getValue() : getBindingAddress().getIpv4Address().getValue()); return new InetSocketAddress(inetAd, getPort().getValue()); } catch (final UnknownHostException e) { throw new IllegalArgumentException("Unable to bind netconf endpoint to address " + getBindingAddress(), e); } }
protected DhcpInfo setDnsServersIpAddrs(List<IpAddress> dnsServers) { for (IpAddress ipAddr: dnsServers) { addDnsServer(ipAddr.getIpv4Address().getValue()); } return this; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VrfPrefixKey other = (VrfPrefixKey) obj; if (_prefix == null) { if (other._prefix != null) { return false; } } else if(!_prefix.equals(other._prefix)) { return false; } if (_prefixLength == null) { if (other._prefixLength != null) { return false; } } else if(!_prefixLength.equals(other._prefixLength)) { return false; } return true; }
public static IpAddress getDefaultInstance(final String defaultValue) { final Matcher ipv4Matcher = IPV4_PATTERN.matcher(defaultValue); if (ipv4Matcher.matches()) { if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { throw new IllegalArgumentException( String.format("Cannot create IpAddress from \"%s\", matches both %s and %s", defaultValue, Ipv4Address.class.getSimpleName(), Ipv6Address.class.getSimpleName())); } return new IpAddress(new Ipv4Address(defaultValue)); } else if (IPV6_PATTERN1.matcher(defaultValue).matches() && IPV6_PATTERN2.matcher(defaultValue).matches()) { return new IpAddress(new Ipv6Address(defaultValue)); } else { throw new IllegalArgumentException("Cannot create IpAddress from " + defaultValue); } }
public static List<Neutron_IPs> convertMDSalIpToNeutronIp(List<FixedIps> fixedIps) { List<Neutron_IPs> ips = null; if (fixedIps != null) { ips = new ArrayList<Neutron_IPs>(); for (FixedIps mdIP : fixedIps) { Neutron_IPs ip = new Neutron_IPs(); ip.setIpAddress(String.valueOf(mdIP.getIpAddress().getValue())); ip.setSubnetUUID(mdIP.getSubnetId().getValue()); ips.add(ip); } } return ips; }
private boolean isHostAddressPresent(final Host address) { return address.getDomainName() != null || address.getIpAddress() != null && (address.getIpAddress().getIpv4Address() != null || address.getIpAddress().getIpv6Address() != null); }
private String getIpAddress(EndpointType source) { String ipAddress = null; if( source instanceof IpAddress) { ipAddress = ((IpAddress) source).getIpAddress().getIpv4Address().getValue(); } else if (source instanceof Interface) { ipAddress = ((Interface)source).getInterfaceIp().getIpv4Address().getValue(); } return ipAddress; }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_subscriberId == null) ? 0 : _subscriberId.hashCode()); hash = result; hashValid = true; return result; }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VrfPrefixTopologyKey other = (VrfPrefixTopologyKey) obj; if (_prefix == null) { if (other._prefix != null) { return false; } } else if(!_prefix.equals(other._prefix)) { return false; } if (_prefixLength == null) { if (other._prefixLength != null) { return false; } } else if(!_prefixLength.equals(other._prefixLength)) { return false; } return true; }