java.lang.Object
org.newsclub.net.unix.AFUNIXSocketCredentials
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AFUNIXSocketCredentials
Special instance, indicating that there is no remote peer, but the referenced object is from the same process. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
getGid()
Returns the primary "gid" (group ID), or-1
if it could not be retrieved.long[]
getGids()
Returns all "gid" values (group IDs), ornull
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.getUUID()
Returns the process' unique identifier, ornull
if no such identifier could be retrieved.int
hashCode()
boolean
isEmpty()
Checks if neither of the possible peer credentials are set.static AFUNIXSocketCredentials
Returns theAFUNIXSocketCredentials
for the currently active remote session, ornull
if it was not possible to retrieve these credentials.toString()
-
Field Details
-
SAME_PROCESS
Special instance, indicating that there is no remote peer, but the referenced object is from the same process.
-
-
Method Details
-
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), ornull
if they could not be retrieved. Note that this list may be incomplete (only the primary gid may be returned), but it is guaranteed that the first one in the list is the primary gid as returned bygetGid()
.- Returns:
- The gids, or null.
-
getUUID
Returns the process' unique identifier, ornull
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.
-
isEmpty
public boolean isEmpty()Checks if neither of the possible peer credentials are set.- Returns:
true
if no credentials set.
-
toString
-
hashCode
-
equals
-
remotePeerCredentials
Returns theAFUNIXSocketCredentials
for the currently active remote session, ornull
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.
-