import org.onap.clamp.clds.model.refprop.RefProp;\r
import org.onap.clamp.clds.util.LoggingUtils;\r
import org.springframework.beans.factory.annotation.Autowired;\r
+import org.springframework.stereotype.Component;\r
\r
/**\r
* This class implements the communication with DCAE for the service inventory.\r
*/\r
+@Component\r
public class DcaeInventoryServices {\r
\r
protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeInventoryServices.class);\r
dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);\r
LoggingUtils.setResponseContext("0", "Set inventory success", this.getClass().getName());\r
} catch (JsonProcessingException e) {\r
- LoggingUtils.setResponseContext("900", "Set inventory failed", this.getClass().getName());\r
- LoggingUtils.setErrorContext("900", "Set inventory error");\r
+ LoggingUtils.setResponseContext("900", "Set inventory failed", this.getClass().getName());\r
+ LoggingUtils.setErrorContext("900", "Set inventory error");\r
logger.error("Error during JSON decoding", e);\r
} catch (IOException ex) {\r
- LoggingUtils.setResponseContext("900", "Set inventory failed", this.getClass().getName());\r
- LoggingUtils.setErrorContext("900", "Set inventory error");\r
+ LoggingUtils.setResponseContext("900", "Set inventory failed", this.getClass().getName());\r
+ LoggingUtils.setErrorContext("900", "Set inventory error");\r
logger.error("Error during DCAE communication", ex);\r
} finally {\r
LoggingUtils.setTimeContext(startTime, new Date());\r
* The vf UUID\r
* @return The DCAE inventory type id\r
*/\r
- public String createUpdateDCAEServiceType(String blueprintTemplate, String owner, String typeName, int typeVersion,\r
+ public String createupdateDCAEServiceType(String blueprintTemplate, String owner, String typeName, int typeVersion,\r
String asdcServiceId, String asdcResourceId) {\r
Date startTime = new Date();\r
LoggingUtils.setTargetContext("DCAE", "createDCAEServiceType");\r
Object obj0 = parser.parse(responseStr);\r
JSONObject jsonObj = (JSONObject) obj0;\r
typeId = (String) jsonObj.get("typeId"); // need to save this\r
- // as\r
- // service_type_id\r
- // in model table\r
+ // as\r
+ // service_type_id\r
+ // in model table\r
} catch (IOException | ParseException e) {\r
logger.error("Exception occurred during createupdateDCAEServiceType Operation with DCAE", e);\r
throw new BadRequestException("Exception occurred during createupdateDCAEServiceType Operation with DCAE",\r
e);\r
} finally {\r
- if(typeId != null) {\r
- LoggingUtils.setResponseContext("0", "Create update DCAE ServiceType success", this.getClass().getName());\r
- } else {\r
- LoggingUtils.setResponseContext("900", "Create update DCAE ServiceType failed", this.getClass().getName());\r
+ if (typeId != null) {\r
+ LoggingUtils.setResponseContext("0", "Create update DCAE ServiceType success",\r
+ this.getClass().getName());\r
+ } else {\r
+ LoggingUtils.setResponseContext("900", "Create update DCAE ServiceType failed",\r
+ this.getClass().getName());\r
LoggingUtils.setErrorContext("900", "Create update DCAE ServiceType error");\r
- }\r
+ }\r
LoggingUtils.setTimeContext(startTime, new Date());\r
metricsLogger.info("createupdateDCAEServiceType complete");\r
}\r