Class MachineProperties.Guarder
java.lang.Object
me.ahoo.cosid.spring.boot.starter.machine.MachineProperties.Guarder
- Enclosing class:
- MachineProperties
Configuration for machine ID guarding mechanisms.
The guarder monitors machine ID health and prevents conflicts by periodically validating that the assigned machine ID is still valid. If a conflict is detected, the application can take corrective action.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDelay()Gets the delay between guarding checks.Gets the initial delay before starting guarding.Gets the safe guard duration.booleanChecks if machine ID guarding is enabled.Sets the delay between guarding checks.setEnabled(boolean enabled) Sets whether machine ID guarding should be enabled.setInitialDelay(Duration initialDelay) Sets the initial delay before starting guarding.setSafeGuardDuration(Duration safeGuardDuration) Sets the safe guard duration.
-
Constructor Details
-
Guarder
public Guarder()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Checks if machine ID guarding is enabled.- Returns:
- true if enabled, false otherwise
-
setEnabled
Sets whether machine ID guarding should be enabled.- Parameters:
enabled- true to enable guarding, false to disable- Returns:
- this guarder configuration for method chaining
-
getInitialDelay
Gets the initial delay before starting guarding.- Returns:
- the initial delay duration
-
setInitialDelay
Sets the initial delay before starting guarding.- Parameters:
initialDelay- the initial delay duration to set- Returns:
- this guarder configuration for method chaining
-
getDelay
Gets the delay between guarding checks.- Returns:
- the delay duration
-
setDelay
Sets the delay between guarding checks.- Parameters:
delay- the delay duration to set- Returns:
- this guarder configuration for method chaining
-
getSafeGuardDuration
Gets the safe guard duration.- Returns:
- the safe guard duration
-
setSafeGuardDuration
Sets the safe guard duration.- Parameters:
safeGuardDuration- the safe guard duration to set- Returns:
- this guarder configuration for method chaining
-