Example #1
0
 /**
  * Creates a new HostAddress with the given FQDN. The port will be set to the default XMPP client
  * port: 5222
  *
  * @param fqdn Fully qualified domain name.
  * @param port The port to connect on.
  * @throws IllegalArgumentException If the fqdn is null or port is out of valid range (0 - 65535).
  */
 public HostAddress(String fqdn, int port) {
   Objects.requireNonNull(fqdn, "FQDN is null");
   if (port < 0 || port > 65535)
     throw new IllegalArgumentException(
         "Port must be a 16-bit unsiged integer (i.e. between 0-65535. Port was: " + port);
   if (fqdn.charAt(fqdn.length() - 1) == '.') {
     this.fqdn = fqdn.substring(0, fqdn.length() - 1);
   } else {
     this.fqdn = fqdn;
   }
   this.port = port;
 }
Example #2
0
 public Manager(XMPPConnection xMPPConnection) {
   Objects.requireNonNull(xMPPConnection, "XMPPConnection must not be null");
   this.weakConnection = new WeakReference(xMPPConnection);
 }