Class Mutex
java.lang.Object
org.tasktide.mutex.model.Mutex
Model class for
MutexActor-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet election fileGet end jittergetFileForType(MutexFileType fileType) Get the path for suppliedMutexFileType, or unchecked exceptionGet host lock fileGet host lockgetId()Fetch IdGet locking directoryGet lock central fileRetry interval between lock attemptsStale file thresholdGet start jittergetState()Get currentMutexStatelongGet mutex timestampvoidsetConfirmBallot(Path confirmBallot) voidsetElectionFile(Path electionFile) voidsetEndJitter(Duration endJitter) voidsetHostLock(HostLock hostLock) SetHostLockvoidsetRetryInterval(Duration retryInterval) voidsetStaleFileThreshold(Duration staleFileThreshold) voidsetStartJitter(Duration startJitter) voidsetState(MutexState state) Set newMutexStatevoidsetTimestamp(long timestamp) Represent as JSON documenttoString()Represent as string
-
Constructor Details
-
Mutex
public Mutex(String id, long timestamp, Path lockDir, Path lockFile, Path hostFile, Path electionFile, Duration retryInterval, Duration staleFileThreshold, Duration startJitter, Duration endJitter, MutexState state) Construct with properties- Parameters:
id-timestamp-lockDir-lockFile-hostFile-electionFile-retryInterval-staleFileThreshold-startJitter-endJitter-state-
-
-
Method Details
-
getConfirmBallot
-
setConfirmBallot
-
getLockDir
-
getLockFile
-
getHostFile
-
getRetryInterval
-
getStaleFileThreshold
-
getStartJitter
-
getEndJitter
-
getState
-
setState
-
getId
-
getTimestamp
public long getTimestamp()Get mutex timestamp- Returns:
- long
-
getElectionFile
-
getFileForType
Get the path for suppliedMutexFileType, or unchecked exception- Parameters:
fileType-- Returns:
- Path
-
getHostLock
-
setHostLock
-
toJsonDoc
-
setTimestamp
public void setTimestamp(long timestamp) -
setElectionFile
-
setRetryInterval
-
setStaleFileThreshold
-
setStartJitter
-
setEndJitter
-
toString
-