- java.lang.Object
-
- org.newsclub.net.unix.AFUNIXSocketCredentials
-
public final class AFUNIXSocketCredentials extends java.lang.ObjectAF_UNIX socket credentials.
-
-
Field Summary
Fields Modifier and Type Field Description static AFUNIXSocketCredentialsSAME_PROCESSSpecial 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 booleanequals(java.lang.Object obj)longgetGid()Returns the primary "gid" (group ID), or-1if it could not be retrieved.long[]getGids()Returns all "gid" values (group IDs), ornullif they could not be retrieved.longgetPid()Returns the "pid" (process ID), or-1if it could not be retrieved.longgetUid()Returns the "uid" (user ID), or-1if it could not be retrieved.java.util.UUIDgetUUID()Returns the process' unique identifier, ornullif no such identifier could be retrieved.inthashCode()static AFUNIXSocketCredentialsremotePeerCredentials()Returns theAFUNIXSocketCredentialsfor the currently active remote session, ornullif it was not possible to retrieve these credentials.java.lang.StringtoString()
-
-
-
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-1if it could not be retrieved.- Returns:
- The pid, or -1.
-
getUid
public long getUid()
Returns the "uid" (user ID), or-1if it could not be retrieved.- Returns:
- The uid, or -1.
-
getGid
public long getGid()
Returns the primary "gid" (group ID), or-1if it could not be retrieved.- Returns:
- The gid, or -1.
-
getGids
public long[] getGids()
Returns all "gid" values (group IDs), ornullif they could not be retrieved.- Returns:
- The gids, or null.
-
getUUID
public java.util.UUID getUUID()
Returns the process' unique identifier, ornullif 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:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
remotePeerCredentials
public static AFUNIXSocketCredentials remotePeerCredentials()
Returns theAFUNIXSocketCredentialsfor the currently active remote session, ornullif 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
nullif unable to retrieve.
-
-