added logs, some refactor
This commit is contained in:
parent
ff9bfccee8
commit
8dea4b4c76
@ -33,17 +33,16 @@ public abstract class AbstractProcess {
|
||||
|
||||
protected AbstractProcess() {
|
||||
|
||||
setTrustStoreCredentials("TRUSTSTORE_PATH", "TRUSTSTORE_PASSWORD");
|
||||
setTrustStoreCredentials();
|
||||
|
||||
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
|
||||
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected static String getTrustStorePath(String trustStorePath) {
|
||||
protected static String getTrustStorePath() {
|
||||
String path = System.getProperty("user.dir") + File.separatorChar
|
||||
+ ConfigManager.getInstance().getTruststorePath();
|
||||
if (!new File(path).canRead())
|
||||
@ -51,9 +50,9 @@ public abstract class AbstractProcess {
|
||||
return path;
|
||||
}
|
||||
|
||||
protected static void setTrustStoreCredentials(String trustStorePath, String trustStorePassword) {
|
||||
log.info(getTrustStorePath(trustStorePath));
|
||||
System.setProperty("javax.net.ssl.trustStore", getTrustStorePath(trustStorePath));
|
||||
protected static void setTrustStoreCredentials() {
|
||||
log.info(getTrustStorePath());
|
||||
System.setProperty("javax.net.ssl.trustStore", getTrustStorePath());
|
||||
System.setProperty("javax.net.ssl.trustStorePassword", ConfigManager.getInstance().getTruststorePassword());
|
||||
}
|
||||
|
||||
|
||||
@ -12,14 +12,17 @@ public class ApiSync {
|
||||
protected final static String resourceName = "api-operator.properties";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
log.info("API Operator started.");
|
||||
if (args == null) {
|
||||
log.error("No parameters found.");
|
||||
printHelp();
|
||||
} else {
|
||||
|
||||
String commandLine = String.join("", args).trim();
|
||||
StartParameters sp = StartParameters.parse(commandLine);
|
||||
log.info("Parsed parameters: " + sp);
|
||||
|
||||
if (sp.getCommand().equalsIgnoreCase("import")) {
|
||||
log.info("Import command selected.");
|
||||
Import imp = new Import(sp);
|
||||
imp.process();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user