X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-failover%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Ffailover%2FFailoverMonitor.java;h=731abe7cc35982e8edad2bdd1c30a4ccc60680f7;hb=fbb02159b84435cf37221ae8ae5e0045167be15a;hp=cadddc24fcadac52dea0fa1990630df8515525d0;hpb=58f0fd2f6ef58de52e1f9a73540c1bb895c0d6e6;p=aai%2Faai-common.git diff --git a/aai-failover/src/main/java/org/onap/aai/failover/FailoverMonitor.java b/aai-failover/src/main/java/org/onap/aai/failover/FailoverMonitor.java index cadddc24..731abe7c 100644 --- a/aai-failover/src/main/java/org/onap/aai/failover/FailoverMonitor.java +++ b/aai-failover/src/main/java/org/onap/aai/failover/FailoverMonitor.java @@ -17,10 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.onap.aai.failover; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; +package org.onap.aai.failover; import java.io.IOException; import java.io.InputStream; @@ -29,6 +27,9 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + @Component public class FailoverMonitor { @@ -43,9 +44,9 @@ public class FailoverMonitor { Path failoverPath = Paths.get(failoverPropertiesPath); - if(Files.exists(failoverPath)){ + if (Files.exists(failoverPath)) { Properties properties = new Properties(); - try (InputStream is = Files.newInputStream(failoverPath)){ + try (InputStream is = Files.newInputStream(failoverPath)) { properties.load(is); // If the property is_primary is missing then it should proceed return TRUE.equals(properties.getProperty(IS_PRIMARY, DEFAULT_FOR_PRIMARY));