Code Review
/
ccsdk
/
sli
/
plugins.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
sync restapi-call-node with ecomp
[ccsdk/sli/plugins.git]
/
restapi-call-node
/
provider
/
src
/
main
/
java
/
org
/
onap
/
ccsdk
/
sli
/
plugins
/
restapicall
/
RetryPolicy.java
diff --git
a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java
b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java
index
65684d9
..
8d5143b
100644
(file)
--- a/
restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java
+++ b/
restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RetryPolicy.java
@@
-21,41
+21,44
@@
*/
package org.onap.ccsdk.sli.plugins.restapicall;
*/
package org.onap.ccsdk.sli.plugins.restapicall;
+
public class RetryPolicy {
private String[] hostnames;
private Integer maximumRetries;
public class RetryPolicy {
private String[] hostnames;
private Integer maximumRetries;
-
private int position;
private int position;
-
private int retryCount;
private int retryCount;
+
public RetryPolicy(String[] hostnames, Integer maximumRetries) {
public RetryPolicy(String[] hostnames, Integer maximumRetries) {
- this.hostnames = hostnames;
- this.maximumRetries = maximumRetries;
-
- this.position = 0;
-
- this.retryCount = 0;
+ this.hostnames = hostnames;
+ this.maximumRetries = maximumRetries;
+ this.position = 0;
+ this.retryCount = 0;
+
}
}
+
public Integer getMaximumRetries() {
public Integer getMaximumRetries() {
-
return maximumRetries;
+ return maximumRetries;
}
}
+
public int getRetryCount() {
public int getRetryCount() {
-
return retryCount;
+ return retryCount;
}
}
+
public Boolean shouldRetry() {
public Boolean shouldRetry() {
-
return retryCount < maximumRetries + 1;
+ return retryCount < maximumRetries + 1;
}
}
+
public String getRetryMessage() {
public String getRetryMessage() {
-
return retryCount + " retry attempts were made out of " + maximumRetries + " maximum retry attempts.";
+ return retryCount + " retry attempts were made out of " + maximumRetries + " maximum retry attempts.";
}
public String getNextHostName() throws RetryException {
}
public String getNextHostName() throws RetryException {
- retryCount++;
- position++;
-
- if (position > hostnames.length - 1) {
- position = 0;
- }
- return hostnames[position];
+ retryCount++;
+ position++;
+ if (position > hostnames.length - 1) {
+ position = 0;
}
}
-}
\ No newline at end of file
+ return hostnames[position];
+ }
+
+}