Class AFUNIXSocketCredentials


  • public final class AFUNIXSocketCredentials
    extends java.lang.Object
    AF_UNIX socket credentials.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static AFUNIXSocketCredentials SAME_PROCESS
      Special instance, indicating that there is no remote peer, but the referenced object is from the same process.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      long getGid()
      Returns the primary "gid" (group ID), or -1 if it could not be retrieved.
      long[] getGids()
      Returns all "gid" values (group IDs), or null if they could not be retrieved.
      long getPid()
      Returns the "pid" (process ID), or -1 if it could not be retrieved.
      long getUid()
      Returns the "uid" (user ID), or -1 if it could not be retrieved.
      java.util.UUID getUUID()
      Returns the process' unique identifier, or null if no such identifier could be retrieved.
      int hashCode()  
      static AFUNIXSocketCredentials remotePeerCredentials()
      Returns the AFUNIXSocketCredentials for the currently active remote session, or null if it was not possible to retrieve these credentials.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SAME_PROCESS

        public static final AFUNIXSocketCredentials SAME_PROCESS
        Special instance, indicating that there is no remote peer, but the referenced object is from the same process.
    • Method Detail

      • getPid

        public long getPid()
        Returns the "pid" (process ID), or -1 if it could not be retrieved.
        Returns:
        The pid, or -1.
      • getUid

        public long getUid()
        Returns the "uid" (user ID), or -1 if it could not be retrieved.
        Returns:
        The uid, or -1.
      • getGid

        public long getGid()
        Returns the primary "gid" (group ID), or -1 if it could not be retrieved.
        Returns:
        The gid, or -1.
      • getGids

        public long[] getGids()
        Returns all "gid" values (group IDs), or null if they could not be retrieved.
        Returns:
        The gids, or null.
      • getUUID

        public java.util.UUID getUUID()
        Returns the process' unique identifier, or null if no such identifier could be retrieved. Note that all processes run by the same Java runtime may share the same UUID.
        Returns:
        The UUID, or null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • remotePeerCredentials

        public static AFUNIXSocketCredentials remotePeerCredentials()
        Returns the AFUNIXSocketCredentials for the currently active remote session, or null if it was not possible to retrieve these credentials. NOTE: For now, only RMI remote sessions are supported (RemoteServer sessions during a remote method invocation). If you want to retrieve the peer credentials for an RMI server, see junixsocket-rmi's RemotePeerInfo.
        Returns:
        The credentials, or null if unable to retrieve.