* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
private static final String SITENAME = "mso.sitename";
- private static final String ADPTER_ENDPOINT = "mso.openecomp.adapters.db.endpoint";
- private static final String OPENECOMP_ADAPTER_NAMESPACE = "mso.openecomp.adapter.namespace";
+ private static final String ADAPTER_ENDPOINT = "mso.adapters.openecomp.db.endpoint";
+ private static final String ADAPTER_NAMESPACE = "mso.adapters.namespace";
private static final String CONFIG = "mso.bpmn.urn.properties";
private static final String CREDENTIAL = "mso.adapters.db.auth";
private static final String MSOKEY = "mso.msoKey";
}
String siteName = props.get(SITENAME);
- String endpoint = props.get(ADPTER_ENDPOINT);
+ String endpoint = props.get(ADAPTER_ENDPOINT);
if (null == siteName || siteName.length () == 0 || null == endpoint || endpoint.length () == 0) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, "Unable to load key attributes (" + SITENAME + " or " + ADPTER_ENDPOINT + ") from the config file:" + CONFIG);
+ msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, "Unable to load key attributes (" + SITENAME + " or " + ADAPTER_ENDPOINT + ") from the config file:" + CONFIG);
return NOT_STARTED_RESPONSE;
}
try {
- if (!this.getSiteStatus (endpoint, siteName, props.get(CREDENTIAL), props.get(MSOKEY), props.get(OPENECOMP_ADAPTER_NAMESPACE))) {
+ if (!this.getSiteStatus (endpoint, siteName, props.get(CREDENTIAL), props.get(MSOKEY), props.get(ADAPTER_NAMESPACE))) {
msoLogger.debug("This site is currently disabled for maintenance.");
return HEALTH_CHECK_NOK_RESPONSE;
}
}
String siteName = props.get(SITENAME);
- String endpoint = props.get(ADPTER_ENDPOINT);
+ String endpoint = props.get(ADAPTER_ENDPOINT);
if (null == siteName || siteName.length () == 0 || null == endpoint || endpoint.length () == 0) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, "Unable to load key attributes (" + SITENAME + " or " + ADPTER_ENDPOINT + ") from the config file:" + CONFIG);
+ msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, "Unable to load key attributes (" + SITENAME + " or " + ADAPTER_ENDPOINT + ") from the config file:" + CONFIG);
return NOT_STARTED_RESPONSE;
}
try {
- if (!this.getSiteStatus (endpoint, siteName, props.get(CREDENTIAL), props.get(MSOKEY), props.get(OPENECOMP_ADAPTER_NAMESPACE))) {
+ if (!this.getSiteStatus (endpoint, siteName, props.get(CREDENTIAL), props.get(MSOKEY), props.get(ADAPTER_NAMESPACE))) {
msoLogger.debug("This site is currently disabled for maintenance.");
return HEALTH_CHECK_NOK_RESPONSE;
}
}
try {
- ProcessEngines.getDefaultProcessEngine().getIdentityService().createGroupQuery().list();
+ // TODO: check the appropriate process engine
+ // ProcessEngines.getDefaultProcessEngine().getIdentityService().createGroupQuery().list();
} catch (final Exception e) {
msoLogger.error(MessageEnum.GENERAL_EXCEPTION_ARG, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception while verifying Camunda engine", e);
UUID uuid = UUID.fromString(id);
return uuid.toString().equalsIgnoreCase(id);
} catch (IllegalArgumentException iae) {
+ msoLogger.debug("IllegalArgumentException :",iae);
return false;
}
}
BPMNLogger.debug(healthcheckDebugEnabled, "Post url is: " + url);
//now create a soap request message as follows:
- final StringBuffer payload = new StringBuffer();
+ final StringBuilder payload = new StringBuilder();
payload.append("\n");
- payload.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:req=\"" + adapterNamespace + "/requestsdb\">\n");
+ payload.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:req=\"")
+ .append(adapterNamespace).append("/requestsdb\">\n");
payload.append("<soapenv:Header/>\n");
payload.append("<soapenv:Body>\n");
payload.append("<req:getSiteStatus>\n");
- payload.append("<siteName>" + site + "</siteName>\n");
+ payload.append("<siteName>").append(site).append("</siteName>\n");
payload.append("</req:getSiteStatus>\n");
payload.append("</soapenv:Body>\n");
payload.append("</soapenv:Envelope>\n");
BufferedReader rd = new BufferedReader(
new InputStreamReader(response.getEntity().getContent()));
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);