-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from GoodforGod/dev
[2.3.0]
- Loading branch information
Showing
16 changed files
with
230 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/io/micronaut/configuration/arango/health/AbstractHealthConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.micronaut.configuration.arango.health; | ||
|
||
import io.micronaut.context.exceptions.ConfigurationException; | ||
|
||
/** | ||
* @author Anton Kurako (GoodforGod) | ||
* @since 13.08.2021 | ||
*/ | ||
public abstract class AbstractHealthConfiguration { | ||
|
||
private boolean enabled = true; | ||
private long timeoutInMillis = 5000; | ||
private int retry = 2; | ||
|
||
public boolean isEnabled() { | ||
return enabled; | ||
} | ||
|
||
public void setEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
public long getTimeoutInMillis() { | ||
return timeoutInMillis; | ||
} | ||
|
||
public void setTimeoutInMillis(long timeoutInMillis) { | ||
if (timeoutInMillis < 0) | ||
throw new ConfigurationException("Timeout for health can not be less than 0"); | ||
this.timeoutInMillis = timeoutInMillis; | ||
} | ||
|
||
public int getRetry() { | ||
return retry; | ||
} | ||
|
||
public void setRetry(int retry) { | ||
if (retry < 1) | ||
throw new ConfigurationException("Retry for health can not be less than 1"); | ||
this.retry = retry; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "[enabled=" + enabled + | ||
", timeoutInMillis=" + timeoutInMillis + | ||
", retry=" + retry + ']'; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/io/micronaut/configuration/arango/health/ArangoClusterHealthConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.micronaut.configuration.arango.health; | ||
|
||
import io.micronaut.configuration.arango.ArangoSettings; | ||
import io.micronaut.context.annotation.ConfigurationProperties; | ||
import io.micronaut.context.annotation.Requires; | ||
|
||
/** | ||
* @author Anton Kurako (GoodforGod) | ||
* @since 13.08.2021 | ||
*/ | ||
@Requires(property = ArangoSettings.PREFIX) | ||
@ConfigurationProperties(ArangoSettings.PREFIX + ".health-cluster") | ||
public class ArangoClusterHealthConfiguration extends AbstractHealthConfiguration { | ||
|
||
} |
Oops, something went wrong.