Address (Apache Tomcat 8.5.89 API Documentation)

Package org.apache.tomcat.jni

## Class Address

- java.lang.Object
- - org.apache.tomcat.jni.Address

-     @Deprecated
      public class Address
      extends java.lang.Object

  Deprecated.
  The scope of the APR/Native Library will be reduced in Tomcat 10.1.x / Tomcat Native 2.x onwards to only include those components required to provide OpenSSL integration with the NIO and NIO2 connectors.
  Address
  Author:
    Mladen Turk

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `APR_ANYADDR` | Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Address()` | Deprecated.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static boolean` | `equal​(long a, long b)` | Deprecated. See if the IP addresses in two APR socket addresses are equivalent.
    `static boolean` | `fill​(Sockaddr info, long sa)` | Deprecated. Fill the Sockaddr class from apr_sockaddr_t
    `static long` | `get​(int which, long sock)` | Deprecated. Return an apr_sockaddr_t from an apr_socket_t
    `static Sockaddr` | `getInfo​(long sa)` | Deprecated. Create the Sockaddr object from apr_sockaddr_t
    `static java.lang.String` | `getip​(long sa)` | Deprecated. Return the IP address (in numeric address string format) in an APR socket address.
    `static java.lang.String` | `getnameinfo​(long sa, int flags)` | Deprecated. Look up the host name from an apr_sockaddr_t.
    `static int` | `getservbyname​(long sockaddr, java.lang.String servname)` | Deprecated. Given an apr_sockaddr_t and a service name, set the port for the service
    `static long` | `info​(java.lang.String hostname, int family, int port, int flags, long p)` | Deprecated. Create apr_sockaddr_t from hostname, address family, and port.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### APR_ANYADDR

          public static final java.lang.String APR_ANYADDR

      Deprecated.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Address

          public Address()

      Deprecated.

  - ### Method Detail

    - #### fill

          public static boolean fill​(Sockaddr info,
                                     long sa)

      Deprecated.
      Fill the Sockaddr class from apr_sockaddr_t
      Parameters:
        `info` - Sockaddr class to fill
        `sa` - Structure pointer
      Returns:
        `true` if the operation was successful

    - #### getInfo

          public static Sockaddr getInfo​(long sa)

      Deprecated.
      Create the Sockaddr object from apr_sockaddr_t
      Parameters:
        `sa` - Structure pointer
      Returns:
        the socket address

    - #### info

          public static long info​(java.lang.String hostname,
                                  int family,
                                  int port,
                                  int flags,
                                  long p)
                           throws java.lang.Exception

      Deprecated.
      Create apr_sockaddr_t from hostname, address family, and port.
      Parameters:
        `hostname` - The hostname or numeric address string to resolve/parse, or NULL to build an address that corresponds to 0.0.0.0 or ::
        `family` - The address family to use, or APR_UNSPEC if the system should decide.
        `port` - The port number.
        `flags` - Special processing flags:

                   APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look
                                             for IPv6 addresses if the first query failed;
                                             only valid if family is APR_UNSPEC and hostname
                                             isn't NULL; mutually exclusive with
                                             APR_IPV6_ADDR_OK
                   APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look
                                             for IPv4 addresses if the first query failed;
                                             only valid if family is APR_UNSPEC and hostname
                                             isn't NULL and APR_HAVE_IPV6; mutually exclusive
                                             with APR_IPV4_ADDR_OK

        `p` - The pool for the apr_sockaddr_t and associated storage.
      Returns:
        The new apr_sockaddr_t.
      Throws:
        `java.lang.Exception` - Operation failed

    - #### getnameinfo

          public static java.lang.String getnameinfo​(long sa,
                                                     int flags)

      Deprecated.
      Look up the host name from an apr_sockaddr_t.
      Parameters:
        `sa` - The apr_sockaddr_t.
        `flags` - Special processing flags.
      Returns:
        The hostname.

    - #### getip

          public static java.lang.String getip​(long sa)

      Deprecated.
      Return the IP address (in numeric address string format) in an APR socket address. APR will allocate storage for the IP address string from the pool of the apr_sockaddr_t.
      Parameters:
        `sa` - The socket address to reference.
      Returns:
        The IP address.

    - #### getservbyname

          public static int getservbyname​(long sockaddr,
                                          java.lang.String servname)

      Deprecated.
      Given an apr_sockaddr_t and a service name, set the port for the service
      Parameters:
        `sockaddr` - The apr_sockaddr_t that will have its port set
        `servname` - The name of the service you wish to use
      Returns:
        APR status code.

    - #### get

          public static long get​(int which,
                                 long sock)
                          throws java.lang.Exception

      Deprecated.
      Return an apr_sockaddr_t from an apr_socket_t
      Parameters:
        `which` - Which interface do we want the apr_sockaddr_t for?
        `sock` - The socket to use
      Returns:
        The returned apr_sockaddr_t.
      Throws:
        `java.lang.Exception` - An error occurred

    - #### equal

          public static boolean equal​(long a,
                                      long b)

      Deprecated.
      See if the IP addresses in two APR socket addresses are equivalent. Appropriate logic is present for comparing IPv4-mapped IPv6 addresses with IPv4 addresses.
      Parameters:
        `a` - One of the APR socket addresses.
        `b` - The other APR socket address.
      Returns:
        `true` if the addresses are equal