Class RemotePeerInfo

java.lang.Object
org.newsclub.net.unix.rmi.RemotePeerInfo

public final class RemotePeerInfo extends Object
Information about the remote connection.
Author:
Christian Kohlschütter
  • Method Details

    • getSocketFactory

      public RMISocketFactory getSocketFactory()
      The socket factory used to establish connections.
      Returns:
      The socket factory.
    • getHost

      public String getHost()
      The hostname.
      Returns:
      The hostname
    • getPort

      public int getPort()
      The port.
      Returns:
      The port
    • getPeerCredentials

      public org.newsclub.net.unix.AFUNIXSocketCredentials getPeerCredentials()
      The remote socket credentials, or null if they could not be retrieved.
      Returns:
      The peer credentials, or null.
    • remotePeerCredentials

      public static org.newsclub.net.unix.AFUNIXSocketCredentials remotePeerCredentials()
      Returns the AFUNIXSocketCredentials for the currently active remote session (RemoteServer session during a remote method invocation), or null if it was not possible to retrieve these credentials.
      Returns:
      The credentials, or null if unable to retrieve.
    • remotePeerCredentials

      public static org.newsclub.net.unix.AFUNIXSocketCredentials remotePeerCredentials(Remote obj) throws IOException
      Returns the AFUNIXSocketCredentials for the peer (server) of the given Remote instance, or null if it was not possible to retrieve these credentials.
      Parameters:
      obj - The remote object.
      Returns:
      The credentials, or null if unable to retrieve.
      Throws:
      IOException - if an exception occurs.
    • getConnectionInfo

      public static RemotePeerInfo getConnectionInfo(Remote obj) throws IOException
      Returns the connection information (RMISocketFactory, hostname and port) used for the given Remote object, or null if no custom RMISocketFactory was specified. An IOException may be thrown if we couldn't determine the socket factory.
      Parameters:
      obj - The remote object.
      Returns:
      The factory, or null
      Throws:
      IOException - if the operation fails.
    • toString

      public String toString()
      Overrides:
      toString in class Object