* 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.
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
+import org.openecomp.mso.logger.MsoLogger;
+
public class TenantRequestCommon {
+ private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
public String toJsonString() {
try {
String jsonString = null;
jsonString = mapper.writeValueAsString(this);
return jsonString;
} catch (Exception e) {
- // Shouldn't happen...
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
return "";
}
}
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- // Shouldn't happen...
- e.printStackTrace();
+ LOGGER.debug("Exception :",e);
return "";
}
}
* 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.
* 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.
// tenantRollback);
}
catch (TenantAlreadyExists tae) {
+ LOGGER.debug("Exception :",tae);
CreateTenantError exc = new CreateTenantError(tae.getMessage(), tae.getFaultInfo().getCategory(), Boolean.TRUE);
return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).entity(exc).build();
}
catch (TenantException te) {
+ LOGGER.debug("Exception :",te);
CreateTenantError exc = new CreateTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
catch (Exception e) {
+ LOGGER.debug("Exception :",e);
CreateTenantError exc = new CreateTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
tenantDeleted = deleted.value;
}
catch (TenantException te) {
+ LOGGER.debug("Exception :",te);
DeleteTenantError exc = new DeleteTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
catch (Exception e) {
+ LOGGER.debug("Exception :",e);
DeleteTenantError exc = new DeleteTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
// tenant = TAImpl.queryTenant (cloudSiteId, tenantId, msoReq);
}
catch (TenantException te) {
+ LOGGER.debug("Exception :",te);
QueryTenantError exc = new QueryTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory());
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
catch (Exception e) {
+ LOGGER.debug("Exception :",e);
QueryTenantError exc = new QueryTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
impl.rollbackTenant(req.getTenantRollback());
}
catch (TenantException te) {
+ LOGGER.debug("Exception :",te);
RollbackTenantError exc = new RollbackTenantError(te.getFaultInfo().getMessage(), te.getFaultInfo().getCategory(), Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
catch (Exception e) {
+ LOGGER.debug("Exception :",e);
RollbackTenantError exc = new RollbackTenantError(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE);
return Response.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).entity(exc).build();
}
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.
try {
EntityUtils.consume(httpResponse.getEntity());
} catch(Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
try {
method.reset();
} catch(Exception e) {
- // Ignore
+ LOGGER.debug("Exception :",e);
}
}
}
* 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.
}
} catch (Exception e) {
// might be ok - both are just blank
- LOGGER.debug("ERROR trying to parse the volumeGroupHeatStackId " + volumeGroupHeatStackId);
+ LOGGER.debug("ERROR trying to parse the volumeGroupHeatStackId " + volumeGroupHeatStackId,e);
}
this.createVfModule(cloudSiteId,
tenantId,
String str = "" + stackOutputs.get(key);
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs");
+ LOGGER.debug("Unable to add " + key + " to outputs",e);
}
} else if (stackOutputs.get(key) instanceof JsonNode) {
try {
String str = this.convertNode((JsonNode) stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode");
+ LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode",e);
}
} else if (stackOutputs.get(key) instanceof java.util.LinkedHashMap) {
try {
String str = JSON_MAPPER.writeValueAsString(stackOutputs.get(key));
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap");
+ LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap",e);
}
} else {
try {
String str = stackOutputs.get(key).toString();
stringOutputs.put(key, str);
} catch (Exception e) {
- LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage());
+ LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage(),e);
}
}
}
try {
outputString = inputs.get(str).toString();
} catch (Exception e) {
+ LOGGER.debug("Exception :",e);
outputString = "Unable to call toString() on the value for " + str;
}
sb.append("\t\nitem " + i++ + ": '" + str + "'='" + outputString + "'");
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
} catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage());
+ LOGGER.debug("Error converting json to string " + jpe.getMessage(),jpe);
} catch (Exception e) {
- LOGGER.debug("Error converting json to string " + e.getMessage());
+ LOGGER.debug("Error converting json to string " + e.getMessage(),e);
}
return "[Error converting json to string]";
}
String str = this.convertNode((JsonNode) obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key,e);
//okay in this instance - only string values (fqdn) are expected to be needed
}
} else if (obj instanceof java.util.LinkedHashMap) {
String str = JSON_MAPPER.writeValueAsString(obj);
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key,e);
}
} else if (obj instanceof Integer) {
try {
String str = "" + obj;
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key);
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key,e);
}
} else {
try {
String str = obj.toString();
stringMap.put(key, str);
} catch (Exception e) {
- LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")");
+ LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")",e);
}
}
}
minVersionVnf = vnfResource.getAicVersionMin();
maxVersionVnf = vnfResource.getAicVersionMax();
} catch (Exception e) {
- LOGGER.debug("Unable to pull min/max version for this VNF Resource entry");
+ LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
minVersionVnf = null;
maxVersionVnf = null;
}
moreThanMax = aicV.isMoreRecentThan(maxVersionVnf);
equalToMax = aicV.isTheSameVersion(maxVersionVnf);
} catch (Exception e) {
- LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage() + " - will default to not check");
+ LOGGER.debug("An exception occured while trying to test AIC Version " + e.getMessage() + " - will default to not check",e);
doNotTest = true;
}
if (!doNotTest) {
}
LOGGER.debug(sb.toString());
} catch (Exception e) {
- LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage());
+ LOGGER.debug("??An exception occurred trying to go through Parameter Names " + e.getMessage(),e);
}
// Step 1 - convert what we got as inputs (Map<String, String>) to a
// Map<String, Object> - where the object matches the param type identified in the template
throw new VnfException ("NullPointerException during heat.createStack");
} catch (Exception e) {
LOGGER.recordMetricEvent (createStackStarttime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack", "OpenStack", "CreateStack", vfModuleName);
- LOGGER.debug("unhandled exception at heat.createStack");
+ LOGGER.debug("unhandled exception at heat.createStack",e);
LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while creating stack with OpenStack");
throw new VnfException("Exception during heat.createStack! " + e.getMessage());
}
} catch (Exception e) {
- LOGGER.debug("unhandled exception in create VF");
+ LOGGER.debug("unhandled exception in create VF",e);
throw new VnfException("Exception during create VF " + e.getMessage());
} finally {
minVersionVnf = vnfResource.getAicVersionMin();
maxVersionVnf = vnfResource.getAicVersionMax();
} catch (Exception e) {
- LOGGER.debug("Unable to pull min/max version for this VNF Resource entry");
+ LOGGER.debug("Unable to pull min/max version for this VNF Resource entry",e);
minVersionVnf = null;
maxVersionVnf = null;
}
//TODO - what to do here?
//for now - send the error to debug, but just leave it as a String
String errorMessage = jpe.getMessage();
- LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage);
+ LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
hasJson = false;
jsonNode = null;
} catch (Exception e) {
// or here?
- LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage());
+ LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
hasJson = false;
jsonNode = null;
}
//TODO - what to do here?
//for now - send the error to debug, but just leave it as a String
String errorMessage = jpe.getMessage();
- LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage);
+ LOGGER.debug("Json Error Converting " + parm.getParamName() + " - " + errorMessage,jpe);
hasJson = false;
jsonNode = null;
} catch (Exception e) {
// or here?
- LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage());
+ LOGGER.debug("Json Error Converting " + parm.getParamName() + " " + e.getMessage(),e);
hasJson = false;
jsonNode = null;
}
try {
vfModuleName = vfModuleStackId.substring(0, index);
} catch (Exception e) {
+ LOGGER.debug("Exception", e);
vfModuleName = null;
}
return vfModuleName;
* 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.
response = new CreateVfModuleResponse(req.getVnfId(), req.getVfModuleId(),
vfModuleStackId.value, Boolean.TRUE, outputs.value, modRollback, req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
response = new UpdateVfModuleResponse(req.getVnfId(), req.getVfModuleId(),
vfModuleStackId.value, outputs.value, req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VfModuleExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, Boolean.TRUE, req.getMessageId());
}
if (!req.isSynchronous()) {
* 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.
rb,
req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VolumeGroupExceptionResponse(
e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
}
response = new DeleteVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
vnfAdapter.rollbackVnf(vrb);
response = new RollbackVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {
req.getVolumeGroupId(), req.getVolumeGroupStackId(),
outputs.value, req.getMessageId());
} catch (VnfException e) {
+ LOGGER.debug("Exception :",e);
eresp = new VolumeGroupExceptionResponse(e.getMessage(), MsoExceptionCategory.INTERNAL, true, req.getMessageId());
}
if (!req.isSynchronous()) {