Tabnine Logo
HostInfo.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
javax.jmdns.impl.HostInfo

Best Java code snippets using javax.jmdns.impl.HostInfo.getName (Showing top 20 results out of 315)

origin: org.jmdns/jmdns

/**
 * {@inheritDoc}
 */
@Override
public String getHostName() {
  return _localHost.getName();
}
origin: javax.jmdns/jmdns

/**
 * {@inheritDoc}
 */
@Override
public String getHostName() {
  return _localHost.getName();
}
origin: javax.jmdns/jmdns

@Override
public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl) {
  String name = this.getName().toLowerCase();
  return jmDNSImpl.getLocalHost().getName().equals(name) || jmDNSImpl.getServices().keySet().contains(name);
}
origin: org.jenkins-ci/jmdns

@Override
public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl) {
  String name = this.getName().toLowerCase();
  return jmDNSImpl.getLocalHost().getName().equals(name) || jmDNSImpl.getServices().keySet().contains(name);
}
origin: org.jmdns/jmdns

@Override
public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl) {
  String name = this.getName().toLowerCase();
  return jmDNSImpl.getLocalHost().getName().equals(name) || jmDNSImpl.getServices().containsKey(name);
}
origin: org.jmdns/jmdns

@Override
public boolean iAmTheOnlyOne(JmDNSImpl jmDNSImpl) {
  String name = this.getName().toLowerCase();
  return jmDNSImpl.getLocalHost().getName().equals(name) || jmDNSImpl.getServices().containsKey(name);
}
origin: javax.jmdns/jmdns

private DNSRecord.Pointer getDNS6ReverseAddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet6Address) {
    return new DNSRecord.Pointer(this.getInetAddress().getHostAddress() + ".ip6.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  return null;
}
origin: org.jmdns/jmdns

private DNSRecord.Pointer getDNS6ReverseAddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet6Address) {
    return new DNSRecord.Pointer(this.getInetAddress().getHostAddress() + ".ip6.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  return null;
}
origin: org.jmdns/jmdns

private DNSRecord.Address getDNS4AddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet4Address) {
    return new DNSRecord.IPv4Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress());
  }
  return null;
}
origin: org.jmdns/jmdns

private DNSRecord.Address getDNS6AddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet6Address) {
    return new DNSRecord.IPv6Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress());
  }
  return null;
}
origin: javax.jmdns/jmdns

private DNSRecord.Address getDNS6AddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet6Address) {
    return new DNSRecord.IPv6Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress());
  }
  return null;
}
origin: javax.jmdns/jmdns

private DNSRecord.Pointer getDNS4ReverseAddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet4Address) {
    return new DNSRecord.Pointer(this.getInetAddress().getHostAddress() + ".in-addr.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  if ((this.getInetAddress() instanceof Inet6Address) && (((Inet6Address) this.getInetAddress()).isIPv4CompatibleAddress())) {
    byte[] rawAddress = this.getInetAddress().getAddress();
    String address = (rawAddress[12] & 0xff) + "." + (rawAddress[13] & 0xff) + "." + (rawAddress[14] & 0xff) + "." + (rawAddress[15] & 0xff);
    return new DNSRecord.Pointer(address + ".in-addr.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  return null;
}
origin: org.jenkins-ci/jmdns

private DNSRecord.Pointer getDNS4ReverseAddressRecord(boolean unique, int ttl) {
  if (this.getInetAddress() instanceof Inet4Address) {
    return new DNSRecord.Pointer(this.getInetAddress().getHostAddress() + ".in-addr.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  if ((this.getInetAddress() instanceof Inet6Address) && (((Inet6Address) this.getInetAddress()).isIPv4CompatibleAddress())) {
    byte[] rawAddress = this.getInetAddress().getAddress();
    String address = (rawAddress[12] & 0xff) + "." + (rawAddress[13] & 0xff) + "." + (rawAddress[14] & 0xff) + "." + (rawAddress[15] & 0xff);
    return new DNSRecord.Pointer(address + ".in-addr.arpa.", DNSRecordClass.CLASS_IN, unique, ttl, this.getName());
  }
  return null;
}
origin: javax.jmdns/jmdns

public Collection<DNSRecord> answers(boolean unique, int ttl, HostInfo localHost) {
  List<DNSRecord> list = new ArrayList<DNSRecord>();
  if (this.getSubtype().length() > 0) {
    list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
  }
  list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
  list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
  list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getTextBytes()));
  return list;
}
origin: org.jenkins-ci/jmdns

public Collection<DNSRecord> answers(boolean unique, int ttl, HostInfo localHost) {
  List<DNSRecord> list = new ArrayList<DNSRecord>();
  if (this.getSubtype().length() > 0) {
    list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
  }
  list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
  list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
  list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getTextBytes()));
  return list;
}
origin: javax.jmdns/jmdns

@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;
}
origin: javax.jmdns/jmdns

private DNSRecord.Address getDNS4AddressRecord(boolean unique, int ttl) {
  if ((this.getInetAddress() instanceof Inet4Address) || ((this.getInetAddress() instanceof Inet6Address) && (((Inet6Address) this.getInetAddress()).isIPv4CompatibleAddress()))) {
    return new DNSRecord.IPv4Address(this.getName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getInetAddress());
  }
  return null;
}
origin: javax.jmdns/jmdns

@Override
protected DNSOutgoing buildOutgoingForDNS(DNSOutgoing out) throws IOException {
  DNSOutgoing newOut = out;
  newOut.addQuestion(DNSQuestion.newQuestion(this.getDns().getLocalHost().getName(), DNSRecordType.TYPE_ANY, DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE));
  for (DNSRecord answer : this.getDns().getLocalHost().answers(DNSRecordClass.NOT_UNIQUE, this.getTTL())) {
    newOut = this.addAuthoritativeAnswer(newOut, answer);
  }
  return newOut;
}
origin: javax.jmdns/jmdns

@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;
}
origin: org.jmdns/jmdns

@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;
}
javax.jmdns.implHostInfogetName

Popular methods of HostInfo

  • getInetAddress
  • <init>
  • advanceState
  • answers
  • associateWithTask
  • cancelState
  • closeState
  • getDNS4AddressRecord
  • getDNS4ReverseAddressRecord
  • getDNS6AddressRecord
  • getDNS6ReverseAddressRecord
  • getDNSAddressRecord
  • getDNS6ReverseAddressRecord,
  • getDNSAddressRecord,
  • getDNSReverseAddressRecord,
  • getInet4Address,
  • getInet6Address,
  • getInterface,
  • incrementHostName,
  • isAnnounced,
  • isAnnouncing

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now