@Deprecated @Override public String getURL(String protocol) { String[] urls = this.getURLs(protocol); return (urls.length > 0 ? urls[0] : protocol + "://null:" + getPort()); }
@Deprecated @Override public String getURL(String protocol) { String[] urls = this.getURLs(protocol); return (urls.length > 0 ? urls[0] : protocol + "://null:" + getPort()); }
@Deprecated @Override public String getURL(String protocol) { String[] urls = this.getURLs(protocol); return (urls.length > 0 ? urls[0] : protocol + "://null:" + getPort()); }
@Deprecated @Override public String getURL(String protocol) { String[] urls = this.getURLs(protocol); return (urls.length > 0 ? urls[0] : protocol + "://null:" + getPort()); }
@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; }
@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 DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null) { if (this._port == info.getPort() != _server.equals(dns.getLocalHost().getName())) { return dns.addAnswer(in, addr, port, out, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), dns .getLocalHost().getName())); } } return out; }
@Override DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null) { if (this._port == info.getPort() != _server.equals(dns.getLocalHost().getName())) { return dns.addAnswer(in, addr, port, out, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), dns .getLocalHost().getName())); } } return out; }
@Override boolean handleResponse(JmDNSImpl dns) { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null && (_port != info.getPort() || !_server.equalsIgnoreCase(dns.getLocalHost().getName()))) { logger1.finer("handleResponse() Denial detected"); if (info.isProbing()) { String oldName = info.getQualifiedName().toLowerCase(); info.setName(dns.incrementName(info.getName())); dns.getServices().remove(oldName); dns.getServices().put(info.getQualifiedName().toLowerCase(), info); logger1.finer("handleResponse() New unique name chose:" + info.getName()); } info.revertState(); return true; } return false; }
@Override DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null) { if (this._port == info.getPort() != _server.equals(dns.getLocalHost().getName())) { return dns.addAnswer(in, addr, port, out, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), dns .getLocalHost().getName())); } } return out; }
@Override DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null) { if (this._port == info.getPort() != _server.equals(dns.getLocalHost().getName())) { return dns.addAnswer(in, addr, port, out, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.UNIQUE, DNSConstants.DNS_TTL, info.getPriority(), info.getWeight(), info.getPort(), dns .getLocalHost().getName())); } } return out; }
@Override boolean handleResponse(JmDNSImpl dns) { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null && (_port != info.getPort() || !_server.equalsIgnoreCase(dns.getLocalHost().getName()))) { logger1.finer("handleResponse() Denial detected"); if (info.isProbing()) { String oldName = info.getQualifiedName().toLowerCase(); info.setName(dns.incrementName(info.getName())); dns.getServices().remove(oldName); dns.getServices().put(info.getQualifiedName().toLowerCase(), info); logger1.finer("handleResponse() New unique name chose:" + info.getName()); } info.revertState(); return true; } return false; }
@Override boolean handleResponse(JmDNSImpl dns) { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null && (_port != info.getPort() || !_server.equalsIgnoreCase(dns.getLocalHost().getName()))) { logger1.finer("handleResponse() Denial detected"); if (info.isProbing()) { String oldName = info.getQualifiedName().toLowerCase(); info.setName(dns.incrementName(info.getName())); dns.getServices().remove(oldName); dns.getServices().put(info.getQualifiedName().toLowerCase(), info); logger1.finer("handleResponse() New unique name chose:" + info.getName()); } info.revertState(); return true; } return false; }
@Override boolean handleResponse(JmDNSImpl dns) { ServiceInfoImpl info = (ServiceInfoImpl) dns.getServices().get(this.getKey()); if (info != null && (_port != info.getPort() || !_server.equalsIgnoreCase(dns.getLocalHost().getName()))) { logger1.debug("handleResponse() Denial detected"); if (info.isProbing()) { String oldName = info.getQualifiedName().toLowerCase(); info.setName(NameRegister.Factory.getRegistry().incrementName(dns.getLocalHost().getInetAddress(), info.getName(), NameRegister.NameType.SERVICE)); dns.getServices().remove(oldName); dns.getServices().put(info.getQualifiedName().toLowerCase(), info); logger1.debug("handleResponse() New unique name chose:{}", info.getName()); } info.revertState(); return true; } return false; }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }
@Override protected DNSOutgoing buildOutgoingForInfo(ServiceInfoImpl info, DNSOutgoing out) throws IOException { DNSOutgoing newOut = out; newOut = this.addQuestion(newOut, DNSQuestion.newQuestion(info.getQualifiedName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE)); // the "unique" flag should be not set here because these answers haven't been proven unique yet this means the record will not exactly match the announcement record newOut = this.addAuthoritativeAnswer(newOut, new DNSRecord.Service(info.getQualifiedName(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, this.getTTL(), info.getPriority(), info.getWeight(), info.getPort(), this.getDns().getLocalHost() .getName())); return newOut; }