summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
be53989)
Either log or rethrow this exception
This block of commented-out lines of code should be removed
Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'
Issue-ID: PORTAL-562
Change-Id: I72a7651070462de9bd1e0abb1e83c175d03aa1f3
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
public static Client getClient() throws Exception {
String methodName = "getClient";
ClientConfig config = new ClientConfig();
public static Client getClient() throws Exception {
String methodName = "getClient";
ClientConfig config = new ClientConfig();
- //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
- //config.getClasses().add(org.onap.aai.util.CustomJacksonJaxBJsonProvider.class);
SimpleDateFormat dateFormat = DateUtil.getDateFormat();
config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
SimpleDateFormat dateFormat = DateUtil.getDateFormat();
config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
- String truststore_path = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_FILENAME);
+ String truststorePath = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_FILENAME);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " "
+ "truststore_path=" +
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " "
+ "truststore_path=" +
- truststore_path);
- String truststore_password = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_PASSWD_X);
+ truststorePath);
+ String truststorePassword = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_PASSWD_X);
- String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+ String decryptedTruststorePassword = Password.deobfuscate(truststorePassword);
//logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
//logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
- File tr = new File (truststore_path);
+ File tr = new File (truststorePath);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute "
+ "truststore path=" + tr.getAbsolutePath());
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute "
+ "truststore path=" + tr.getAbsolutePath());
//String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
//String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
//String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
//String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
- System.setProperty("javax.net.ssl.trustStore", truststore_path);
- System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+ System.setProperty("javax.net.ssl.trustStore", truststorePath);
+ System.setProperty("javax.net.ssl.trustStorePassword", decryptedTruststorePassword);
HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
public boolean verify(String string,SSLSession ssls) {
return true;
HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
public boolean verify(String string,SSLSession ssls) {
return true;
ctx.init(kmf.getKeyManagers(), null, null);
*/
ctx.init(null, null, null);
ctx.init(kmf.getKeyManagers(), null, null);
*/
ctx.init(null, null, null);
- //config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
- // new HTTPSProperties( , ctx));
-
return ClientBuilder.newBuilder()
.sslContext(ctx)
.hostnameVerifier(new HostnameVerifier() {
return ClientBuilder.newBuilder()
.sslContext(ctx)
.hostnameVerifier(new HostnameVerifier() {
.build()
.register(CustomJacksonJaxBJsonProvider.class);
.build()
.register(CustomJacksonJaxBJsonProvider.class);
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
- //System.out.println("Error setting up config: exiting");
- e.printStackTrace();
- return null;
- }
-
- //Client client = ClientBuilder.newClient(config);
- // uncomment this line to get more logging for the request/response
- // client.addFilter(new LoggingFilter(System.out));
-
- //return client;
- }
-}
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting", e);
+ return null;
+ }
+ }
+}
logger.debug(EELFLoggerDelegate.debugLogger, "http response status=" + status);
MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(status));
if (!isHttpSuccess(status)) {
logger.debug(EELFLoggerDelegate.debugLogger, "http response status=" + status);
MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(status));
if (!isHttpSuccess(status)) {
- String errMsg = "Failed. Status=" + status + restPath +"; [" + ((ResponseImpl)response).getStatusInfo().getReasonPhrase().toString()
+ String errMsg = "Failed. Status=" + status + restPath +"; [" + ((ResponseImpl)response).getStatusInfo().getReasonPhrase()
+ "]";
URL url = null;
try {
+ "]";
URL url = null;
try {
Response response = getResponse(appId, restPath);
if (response != null) {
Response response = getResponse(appId, restPath);
if (response != null) {
- //verifyResponse(response);
verifyResponse(response,restPath);
/* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
verifyResponse(response,restPath);
/* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
Response response = getResponse(appId, restPath);
if (response != null) {
Response response = getResponse(appId, restPath);
if (response != null) {
- //verifyResponse(response);
verifyResponse(response,restPath);
/* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
doesn't work as expected. Created Portal-253 for tracking */
verifyResponse(response,restPath);
/* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
doesn't work as expected. Created Portal-253 for tracking */
- String incomingJson = ((ResponseImpl)response).readEntity(String.class);
- return incomingJson;
+ return ((ResponseImpl)response).readEntity(String.class);
Response response = getResponse(appId, restPath);
if (response != null) {
Response response = getResponse(appId, restPath);
if (response != null) {
- //verifyResponse(response);
verifyResponse(response,restPath);
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
verifyResponse(response,restPath);
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
try {
t = mapper.readValue(str, clazz);
} catch (Exception e) {
try {
t = mapper.readValue(str, clazz);
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
}
}
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
}
}
}
if (response != null) {
}
if (response != null) {
- //verifyResponse(response);
verifyResponse(response,restPath);
verifyResponse(response,restPath);
- // String contentType = response.getHeaderString("Content-Type");
if (clazz != null) {
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
try {
t = (T) gson.fromJson(str, clazz);
if (clazz != null) {
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
try {
t = (T) gson.fromJson(str, clazz);
-
- //t = gson.fromJson(str, clazz);
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
}
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
}
}
if (response != null) {
}
if (response != null) {
- //verifyResponse(response);
verifyResponse(response,restPath);
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT result =", str);
verifyResponse(response,restPath);
String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT result =", str);
dataAccessService.executeNamedQuery("deleteMicroservice", params, null);
} catch (Exception e) {
dataAccessService.executeNamedQuery("deleteMicroservice", params, null);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "deleteMicroservice failed", e);
throw e;
}
logger.error(EELFLoggerDelegate.errorLogger, "deleteMicroservice failed", e);
throw e;
}