Package org.opends.server.types
Class ProcessId
- java.lang.Object
-
- org.opends.server.types.ProcessId
-
public final class ProcessId extends Object
Represents a process ID which allows differentiating DS and RS instances running in the same JVM.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)booleanequalsIgnoringUnknown(Object o)Similar toequals(Object)except thatnewUnknownProcessId()is equal to itself.longgetLeastSignificantBits()Returns the least significant 64 bits of this process id's 128 bit value.longgetMostSignificantBits()Returns the most significant 64 bits of this process id's 128 bit value.inthashCode()booleanisUnknown()Whether the current process id is unknown.static ProcessIdnewProcessId(long mostSigBits, long leastSigBits)Reads and decodes theProcessIdfrom the provided scanner.static ProcessIdnewRandomProcessId()Returns a randomly generatedProcessId.static ProcessIdnewUnknownProcessId()Returns a new unknown process ID.StringtoString()
-
-
-
Method Detail
-
newRandomProcessId
public static ProcessId newRandomProcessId()
Returns a randomly generatedProcessId.- Returns:
- a new
ProcessId
-
newUnknownProcessId
public static ProcessId newUnknownProcessId()
Returns a new unknown process ID.- Returns:
- a new unknown process ID
-
newProcessId
public static ProcessId newProcessId(long mostSigBits, long leastSigBits)
Reads and decodes theProcessIdfrom the provided scanner.- Parameters:
mostSigBits- The most significant bits of theProcessIdleastSigBits- The last significant bits of theProcessId- Returns:
- The decoded processID.
-
getMostSignificantBits
public long getMostSignificantBits()
Returns the most significant 64 bits of this process id's 128 bit value.- Returns:
- The most significant 64 bits of this process id's 128 bit value
-
getLeastSignificantBits
public long getLeastSignificantBits()
Returns the least significant 64 bits of this process id's 128 bit value.- Returns:
- The least significant 64 bits of this process id's 128 bit value
-
isUnknown
public boolean isUnknown()
Whether the current process id is unknown.- Returns:
trueif the current process id is unknown,falseotherwise.
-
equalsIgnoringUnknown
public boolean equalsIgnoringUnknown(Object o)
Similar toequals(Object)except thatnewUnknownProcessId()is equal to itself.Only use this method when another field can act as a tie breaker.
- Parameters:
o- the other object- Returns:
- whether the current process id and
otherare equal.
-
-