/** * {@inheritDoc} */ @Deprecated @Override public InetAddress getInetAddress() { InetAddress[] addresses = this.getInetAddresses(); return (addresses.length > 0 ? addresses[0] : null); }
/** * {@inheritDoc} */ @Deprecated @Override public InetAddress getInetAddress() { InetAddress[] addresses = this.getInetAddresses(); return (addresses.length > 0 ? addresses[0] : null); }
/** * {@inheritDoc} */ @Deprecated @Override public InetAddress getInetAddress() { InetAddress[] addresses = this.getInetAddresses(); return (addresses.length > 0 ? addresses[0] : null); }
/** * {@inheritDoc} */ @Deprecated @Override public InetAddress getInetAddress() { InetAddress[] addresses = this.getInetAddresses(); return (addresses.length > 0 ? addresses[0] : null); }
/** * {@inheritDoc} */ @Override public String[] getHostAddresses() { InetAddress[] addresses = this.getInetAddresses(); String[] names = new String[addresses.length]; for (int i = 0; i < addresses.length; i++) { names[i] = addresses[i].getHostAddress(); } return names; }
@Override public boolean hasSameAddresses(ServiceInfo other) { if (other == null) return false; if (other instanceof ServiceInfoImpl) { ServiceInfoImpl otherImpl = (ServiceInfoImpl) other; return _ipv4Addresses.size() == otherImpl._ipv4Addresses.size() && _ipv6Addresses.size() == otherImpl._ipv6Addresses.size() && _ipv4Addresses.equals(otherImpl._ipv4Addresses) && _ipv6Addresses.equals(otherImpl._ipv6Addresses); } else { InetAddress[] addresses = getInetAddresses(); InetAddress[] otherAddresses = other.getInetAddresses(); return addresses.length == otherAddresses.length && new HashSet<InetAddress>(Arrays.asList(addresses)).equals(new HashSet<InetAddress>(Arrays.asList(otherAddresses))); } }
@Override public String[] getURLs(String protocol) { InetAddress[] addresses = this.getInetAddresses(); List<String> urls = new ArrayList<String>(addresses.length); for (InetAddress address : addresses) { String hostAddress = address.getHostAddress(); if (address instanceof Inet6Address) { hostAddress = "[" + hostAddress + "]"; } String url = protocol + "://" + hostAddress + ":" + getPort(); String path = getPropertyString("path"); if (path != null) { if (path.indexOf("://") >= 0) { url = path; } else { url += path.startsWith("/") ? path : "/" + path; } } urls.add(url); } return urls.toArray(new String[urls.size()]); }
@Override public String[] getURLs(String protocol) { InetAddress[] addresses = this.getInetAddresses(); String[] urls = new String[addresses.length]; for (int i = 0; i < addresses.length; i++) { String url = protocol + "://" + addresses[i].getHostAddress() + ":" + getPort(); String path = getPropertyString("path"); if (path != null) { if (path.indexOf("://") >= 0) { url = path; } else { url += path.startsWith("/") ? path : "/" + path; } } urls[i] = url; } return urls; }
@Override public String[] getURLs(String protocol) { InetAddress[] addresses = this.getInetAddresses(); String[] urls = new String[addresses.length]; for (int i = 0; i < addresses.length; i++) { String url = protocol + "://" + addresses[i].getHostAddress() + ":" + getPort(); String path = getPropertyString("path"); if (path != null) { if (path.indexOf("://") >= 0) { url = path; } else { url += path.startsWith("/") ? path : "/" + path; } } urls[i] = url; } return urls; }
@Override public String[] getURLs(String protocol) { InetAddress[] addresses = this.getInetAddresses(); String[] urls = new String[addresses.length]; for (int i = 0; i < addresses.length; i++) { String url = protocol + "://" + addresses[i].getHostAddress() + ":" + getPort(); String path = getPropertyString("path"); if (path != null) { if (path.indexOf("://") >= 0) { url = path; } else { url += path.startsWith("/") ? path : "/" + path; } } urls[i] = url; } return urls; }
InetAddress[] addresses = this.getInetAddresses(); if (addresses.length > 0) { for (InetAddress address : addresses) {
buf.append((this.getName().length() > 0 ? this.getName() + "." : "") + this.getTypeWithSubtype()); buf.append("' address: '"); InetAddress[] addresses = this.getInetAddresses(); if (addresses.length > 0) { for (InetAddress address : addresses) {
buf.append((this.getName().length() > 0 ? this.getName() + "." : "") + this.getTypeWithSubtype()); buf.append("' address: '"); InetAddress[] addresses = this.getInetAddresses(); if (addresses.length > 0) { for (InetAddress address : addresses) {
buf.append((this.getName().length() > 0 ? this.getName() + "." : "") + this.getTypeWithSubtype()); buf.append("' address: '"); InetAddress[] addresses = this.getInetAddresses(); if (addresses.length > 0) { for (InetAddress address : addresses) {