Add documentation. Add options to enable/disable the hash providers. Add the option for setup barrier for rotation per requests strategy.

This commit is contained in:
Anatoly Sablin
2019-12-02 23:23:17 +03:00
parent 51d9225dda
commit 7509174611
8 changed files with 120 additions and 5 deletions

View File

@@ -309,6 +309,7 @@ public class ExecConfig {
private Boolean enabled;
private int priority;
private Lookup lookup = new Lookup();
private boolean hashLookup = false;
public Boolean isEnabled() {
return enabled;
@@ -334,6 +335,13 @@ public class ExecConfig {
this.lookup = lookup;
}
public boolean isHashLookup() {
return hashLookup;
}
public void setHashLookup(boolean hashLookup) {
this.hashLookup = hashLookup;
}
}
public static class Profile {

View File

@@ -15,6 +15,7 @@ public class HashingConfig {
private RotationPolicyEnum rotationPolicy;
private HashStorageEnum hashStorageType;
private long delay = 10;
private int requests = 10;
private List<Algorithm> algorithms = new ArrayList<>();
public void build() {
@@ -26,6 +27,9 @@ public class HashingConfig {
if (RotationPolicyEnum.per_seconds == rotationPolicy) {
LOGGER.info(" Rotation delay: {}", delay);
}
if (RotationPolicyEnum.per_requests == rotationPolicy) {
LOGGER.info(" Rotation after requests: {}", requests);
}
LOGGER.info(" Algorithms: {}", algorithms);
} else {
LOGGER.info("Hash configuration disabled, used only `none` pepper.");
@@ -87,6 +91,14 @@ public class HashingConfig {
this.delay = delay;
}
public int getRequests() {
return requests;
}
public void setRequests(int requests) {
this.requests = requests;
}
public List<Algorithm> getAlgorithms() {
return algorithms;
}

View File

@@ -27,6 +27,7 @@ public class MemoryStoreConfig {
private boolean enabled;
private List<MemoryIdentityConfig> identities = new ArrayList<>();
private boolean hashEnabled = false;
public boolean isEnabled() {
return enabled;
@@ -44,6 +45,14 @@ public class MemoryStoreConfig {
this.identities = identities;
}
public boolean isHashEnabled() {
return hashEnabled;
}
public void setHashEnabled(boolean hashEnabled) {
this.hashEnabled = hashEnabled;
}
public void build() {
// no-op
}