import java.io.FileInputStream;
import java.util.Arrays;
import java.util.Properties;
+
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.pap.main.PapConstants;
import org.onap.policy.pap.main.PolicyPapException;
}
// Read the properties
- Properties props = new Properties();
+ final Properties props = new Properties();
try {
- String propFile = arguments.getFullPropertyFilePath();
+ final String propFile = arguments.getFullPropertyFilePath();
try (FileInputStream stream = new FileInputStream(propFile)) {
props.load(stream);
}
return;
}
+ // Initialize database
+ try {
+ new PapDatabaseInitializer().initializePapDatabase(parameterGroup.getDatabaseProviderParameters());
+ } catch (final PolicyPapException exp) {
+ LOGGER.error("start of policy pap service failed, used parameters are {}", Arrays.toString(args), exp);
+ return;
+ }
+
// Now, create the activator for the policy pap service
activator = new PapActivator(parameterGroup, props);
Registry.register(PapConstants.REG_PAP_ACTIVATOR, activator);