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";
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));
}
}
- 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 {
}
public PropAccess getPropAccess() {
- if (propAccess == null) {
- throw new IllegalStateException("Call AafPropsUtils.init(File propsFile) first");
- }
return propAccess;
}