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 boolean
equals(Object o)
boolean
equalsIgnoringUnknown(Object o)
Similar toequals(Object)
except thatnewUnknownProcessId()
is equal to itself.long
getLeastSignificantBits()
Returns the least significant 64 bits of this process id's 128 bit value.long
getMostSignificantBits()
Returns the most significant 64 bits of this process id's 128 bit value.int
hashCode()
boolean
isUnknown()
Whether the current process id is unknown.static ProcessId
newProcessId(long mostSigBits, long leastSigBits)
Reads and decodes theProcessId
from the provided scanner.static ProcessId
newRandomProcessId()
Returns a randomly generatedProcessId
.static ProcessId
newUnknownProcessId()
Returns a new unknown process ID.String
toString()
-
-
-
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 theProcessId
from the provided scanner.- Parameters:
mostSigBits
- The most significant bits of theProcessId
leastSigBits
- 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:
true
if the current process id is unknown,false
otherwise.
-
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
other
are equal.
-
-