X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Futils%2FAafPropsUtils.java;h=57bc84bdce594c4d09b2050c222d0f2340a5d2b7;hb=bda6aeaa60607ab4fe5af508156019d7bd5c0ce4;hp=68981599891ffd5e5cbb60f7e53347e7ab423f43;hpb=9df67948f715f9cddd51287cd3e91f7cbcf1912b;p=dmaap%2Fdatarouter.git diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtils.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtils.java index 68981599..57bc84bd 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtils.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/utils/AafPropsUtils.java @@ -29,10 +29,8 @@ import org.onap.aaf.cadi.PropAccess; public class AafPropsUtils { - private static AafPropsUtils aafPropsUtilsInstance = null; - private static EELFLogger eelfLogger = EELFManager.getInstance().getLogger(AafPropsUtils.class); + private static final EELFLogger eelfLogger = EELFManager.getInstance().getLogger(AafPropsUtils.class); - public static final String DEFAULT_TRUSTSTORE = "/opt/app/osaaf/local/org.onap.dmaap-dr.trust.jks"; public static final String KEYSTORE_TYPE_PROPERTY = "PKCS12"; public static final String TRUESTSTORE_TYPE_PROPERTY = "jks"; private static final String KEYSTORE_PATH_PROPERTY = "cadi_keystore"; @@ -40,9 +38,9 @@ public class AafPropsUtils { private static final String TRUSTSTORE_PATH_PROPERTY = "cadi_truststore"; private static final String TRUSTSTORE_PASS_PROPERTY = "cadi_truststore_password"; - private PropAccess propAccess; + private final PropAccess propAccess; - private AafPropsUtils(File propsFile) throws IOException { + public AafPropsUtils(File propsFile) throws IOException { propAccess = new PropAccess(); try { propAccess.load(new FileInputStream(propsFile)); @@ -52,20 +50,6 @@ public class AafPropsUtils { } } - public static synchronized void init(File propsFile) throws IOException { - if (aafPropsUtilsInstance != null) { - throw new IllegalStateException("Already initialized"); - } - aafPropsUtilsInstance = new AafPropsUtils(propsFile); - } - - public static AafPropsUtils getInstance() { - if (aafPropsUtilsInstance == null) { - throw new IllegalStateException("Call AafPropsUtils.init(File propsFile) first"); - } - return aafPropsUtilsInstance; - } - private String decryptedPass(String password) { String decryptedPass = null; try { @@ -77,9 +61,6 @@ public class AafPropsUtils { } public PropAccess getPropAccess() { - if (propAccess == null) { - throw new IllegalStateException("Call AafPropsUtils.init(File propsFile) first"); - } return propAccess; }