diff options
author | Carsten Lund <lund@research.att.com> | 2017-04-16 14:17:52 +0000 |
---|---|---|
committer | Carsten Lund <lund@research.att.com> | 2017-04-19 21:37:15 +0000 |
commit | e3c3eb5012b02d87a8d7143be3c195e86c298461 (patch) | |
tree | 349ac19ea8f8682fc48df58a54f084c237061980 /dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen | |
parent | 1650c3b0dda805110cac90dcaab8288d6b607b43 (diff) |
[DCAE-15] Changes related to version 1.1
See Jira for details
Change-Id: I29280abce45f53e80adf675f48cf1e0fff9e2c0a
Signed-off-by: Carsten Lund <lund@research.att.com>
Diffstat (limited to 'dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen')
15 files changed, 776 insertions, 809 deletions
diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/ControllerVirtualMachineServiceInstance.yaml b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/ControllerVirtualMachineServiceInstance.yaml deleted file mode 100644 index d728705..0000000 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/ControllerVirtualMachineServiceInstance.yaml +++ /dev/null @@ -1,3 +0,0 @@ -operations: {} -messages: - dummy: {} diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineManager.yaml b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineManager.yaml index 63cb773..5d17d1a 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineManager.yaml +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineManager.yaml @@ -1,179 +1,147 @@ operations: - test: {} - suspend: {} - resume: {} - publicKey: {} - configurationChanged: {} - updateStreams: {} - logs: {} - metrics: {} - properties: {} - uploadInfo: {} - getValues: {} - getValuesAll: {} - getMessages: {} - getRequestLogger: {} - evaluate: {} - update: {} - REMOTE_test: - decription: Remote call test - REMOTE_suspend: - decription: Remote call suspend - REMOTE_resume: - decription: Remote call resume - REMOTE_publicKey: - decription: Remote call publicKey - REMOTE_configurationChanged: - decription: Remote call configurationChanged - REMOTE_updateStreams: - decription: Remote call updateStreams - REMOTE_logs: - decription: Remote call logs - REMOTE_metrics: - decription: Remote call metrics - REMOTE_properties: - decription: Remote call properties - REMOTE_uploadInfo: - decription: Remote call uploadInfo - REMOTE_getValues: - decription: Remote call getValues - REMOTE_getValuesAll: - decription: Remote call getValuesAll - REMOTE_getMessages: - decription: Remote call getMessages - REMOTE_getRequestLogger: - decription: Remote call getRequestLogger - REMOTE_evaluate: - decription: Remote call evaluate - REMOTE_update: - decription: Remote call update + VirtualMachineManager@test: {} + VirtualMachineManager@suspend: {} + VirtualMachineManager@resume: {} + VirtualMachineManager@publicKey: {} + VirtualMachineManager@configurationChanged: {} + VirtualMachineManager@updateStreams: {} + VirtualMachineManager@logs: {} + VirtualMachineManager@metrics: {} + VirtualMachineManager@properties: {} + VirtualMachineManager@uploadInfo: {} + VirtualMachineManager@getValues: {} + VirtualMachineManager@getValuesAll: {} + VirtualMachineManager@getMessages: {} + VirtualMachineManager@getRequestLogger: {} + VirtualMachineManager@evaluate: {} + VirtualMachineManager@update: {} messages: dummy: {} - test: - errorCode: test-FAILED-5001W + REQUEST-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - suspend: - errorCode: suspend-FAILED-5001W + REQUEST-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - resume: - errorCode: resume-FAILED-5001W + REQUEST-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - publicKey: - errorCode: publicKey-FAILED-5001W + REQUEST-FAILED-publicKey: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - configurationChanged: - errorCode: configurationChanged-FAILED-5001W + REQUEST-FAILED-configurationChanged: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - updateStreams: - errorCode: updateStreams-FAILED-5001W + REQUEST-FAILED-updateStreams: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - logs: - errorCode: logs-FAILED-5001W + REQUEST-FAILED-logs: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - metrics: - errorCode: metrics-FAILED-5001W + REQUEST-FAILED-metrics: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - properties: - errorCode: properties-FAILED-5001W + REQUEST-FAILED-properties: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - uploadInfo: - errorCode: uploadInfo-FAILED-5001W + REQUEST-FAILED-uploadInfo: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getValues: - errorCode: getValues-FAILED-5001W + REQUEST-FAILED-getValues: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getValuesAll: - errorCode: getValuesAll-FAILED-5001W + REQUEST-FAILED-getValuesAll: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getMessages: - errorCode: getMessages-FAILED-5001W + REQUEST-FAILED-getMessages: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getRequestLogger: - errorCode: getRequestLogger-FAILED-5001W + REQUEST-FAILED-getRequestLogger: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - evaluate: - errorCode: evaluate-FAILED-5001W + REQUEST-FAILED-evaluate: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - update: - errorCode: update-FAILED-5001W + REQUEST-FAILED-update: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - REMOTE_test: - errorCode: REMOTE-test-FAILED-5001W + REMOTE-CALL-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_suspend: - errorCode: REMOTE-suspend-FAILED-5001W + REMOTE-CALL-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_resume: - errorCode: REMOTE-resume-FAILED-5001W + REMOTE-CALL-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_publicKey: - errorCode: REMOTE-publicKey-FAILED-5001W + REMOTE-CALL-FAILED-publicKey: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_configurationChanged: - errorCode: REMOTE-configurationChanged-FAILED-5001W + REMOTE-CALL-FAILED-configurationChanged: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_updateStreams: - errorCode: REMOTE-updateStreams-FAILED-5001W + REMOTE-CALL-FAILED-updateStreams: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_logs: - errorCode: REMOTE-logs-FAILED-5001W + REMOTE-CALL-FAILED-logs: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_metrics: - errorCode: REMOTE-metrics-FAILED-5001W + REMOTE-CALL-FAILED-metrics: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_properties: - errorCode: REMOTE-properties-FAILED-5001W + REMOTE-CALL-FAILED-properties: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_uploadInfo: - errorCode: REMOTE-uploadInfo-FAILED-5001W + REMOTE-CALL-FAILED-uploadInfo: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getValues: - errorCode: REMOTE-getValues-FAILED-5001W + REMOTE-CALL-FAILED-getValues: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getValuesAll: - errorCode: REMOTE-getValuesAll-FAILED-5001W + REMOTE-CALL-FAILED-getValuesAll: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getMessages: - errorCode: REMOTE-getMessages-FAILED-5001W + REMOTE-CALL-FAILED-getMessages: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getRequestLogger: - errorCode: REMOTE-getRequestLogger-FAILED-5001W + REMOTE-CALL-FAILED-getRequestLogger: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_evaluate: - errorCode: REMOTE-evaluate-FAILED-5001W + REMOTE-CALL-FAILED-evaluate: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_update: - errorCode: REMOTE-update-FAILED-5001W + REMOTE-CALL-FAILED-update: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineService.yaml b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineService.yaml index 6ac8c34..9b03a21 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineService.yaml +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/VirtualMachineService.yaml @@ -1,135 +1,111 @@ operations: - deploy: {} - undeploy: {} - test: {} - suspend: {} - resume: {} - pushManagerConfiguration: {} - pollManagerConfiguration: {} - managerConfiguration: {} - managerOperation: {} - updateConfigurationFromPolicy: {} - runHealthTests: {} - updateDeploymentStatus: {} - REMOTE_deploy: - decription: Remote call deploy - REMOTE_undeploy: - decription: Remote call undeploy - REMOTE_test: - decription: Remote call test - REMOTE_suspend: - decription: Remote call suspend - REMOTE_resume: - decription: Remote call resume - REMOTE_pushManagerConfiguration: - decription: Remote call pushManagerConfiguration - REMOTE_pollManagerConfiguration: - decription: Remote call pollManagerConfiguration - REMOTE_managerConfiguration: - decription: Remote call managerConfiguration - REMOTE_managerOperation: - decription: Remote call managerOperation - REMOTE_updateConfigurationFromPolicy: - decription: Remote call updateConfigurationFromPolicy - REMOTE_runHealthTests: - decription: Remote call runHealthTests - REMOTE_updateDeploymentStatus: - decription: Remote call updateDeploymentStatus + VirtualMachineService@deploy: {} + VirtualMachineService@undeploy: {} + VirtualMachineService@test: {} + VirtualMachineService@suspend: {} + VirtualMachineService@resume: {} + VirtualMachineService@pushManagerConfiguration: {} + VirtualMachineService@pollManagerConfiguration: {} + VirtualMachineService@managerConfiguration: {} + VirtualMachineService@managerOperation: {} + VirtualMachineService@updateConfigurationFromPolicy: {} + VirtualMachineService@runHealthTests: {} + VirtualMachineService@updateDeploymentStatus: {} messages: dummy: {} - deploy: - errorCode: deploy-FAILED-5001W + REQUEST-FAILED-deploy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - undeploy: - errorCode: undeploy-FAILED-5001W + REQUEST-FAILED-undeploy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - test: - errorCode: test-FAILED-5001W + REQUEST-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - suspend: - errorCode: suspend-FAILED-5001W + REQUEST-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - resume: - errorCode: resume-FAILED-5001W + REQUEST-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - pushManagerConfiguration: - errorCode: pushManagerConfiguration-FAILED-5001W + REQUEST-FAILED-pushManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - pollManagerConfiguration: - errorCode: pollManagerConfiguration-FAILED-5001W + REQUEST-FAILED-pollManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - managerConfiguration: - errorCode: managerConfiguration-FAILED-5001W + REQUEST-FAILED-managerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - managerOperation: - errorCode: managerOperation-FAILED-5001W + REQUEST-FAILED-managerOperation: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - updateConfigurationFromPolicy: - errorCode: updateConfigurationFromPolicy-FAILED-5001W + REQUEST-FAILED-updateConfigurationFromPolicy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - runHealthTests: - errorCode: runHealthTests-FAILED-5001W + REQUEST-FAILED-runHealthTests: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - updateDeploymentStatus: - errorCode: updateDeploymentStatus-FAILED-5001W + REQUEST-FAILED-updateDeploymentStatus: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - REMOTE_deploy: - errorCode: REMOTE-deploy-FAILED-5001W + REMOTE-CALL-FAILED-deploy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_undeploy: - errorCode: REMOTE-undeploy-FAILED-5001W + REMOTE-CALL-FAILED-undeploy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_test: - errorCode: REMOTE-test-FAILED-5001W + REMOTE-CALL-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_suspend: - errorCode: REMOTE-suspend-FAILED-5001W + REMOTE-CALL-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_resume: - errorCode: REMOTE-resume-FAILED-5001W + REMOTE-CALL-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_pushManagerConfiguration: - errorCode: REMOTE-pushManagerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-pushManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_pollManagerConfiguration: - errorCode: REMOTE-pollManagerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-pollManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_managerConfiguration: - errorCode: REMOTE-managerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-managerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_managerOperation: - errorCode: REMOTE-managerOperation-FAILED-5001W + REMOTE-CALL-FAILED-managerOperation: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_updateConfigurationFromPolicy: - errorCode: REMOTE-updateConfigurationFromPolicy-FAILED-5001W + REMOTE-CALL-FAILED-updateConfigurationFromPolicy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_runHealthTests: - errorCode: REMOTE-runHealthTests-FAILED-5001W + REMOTE-CALL-FAILED-runHealthTests: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_updateDeploymentStatus: - errorCode: REMOTE-updateDeploymentStatus-FAILED-5001W + REMOTE-CALL-FAILED-updateDeploymentStatus: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineService.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineService.java index 1d8d251..fd5b93d 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineService.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineService.java @@ -26,20 +26,27 @@ package org.openecomp.dcae.controller.service.servers.vm; + import java.io.InputStream; import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.SwaggerUtils; import org.openecomp.ncomp.sirius.function.FunctionUtils; import org.openecomp.ncomp.component.ApiRequestStatus; import org.apache.log4j.Logger; -import org.openecomp.logger.EcompLogger; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.json.JSONObject; import java.util.Date; @@ -54,9 +61,9 @@ import org.openecomp.dcae.controller.service.vm.impl.VirtualMachineServiceImpl; -public class DcaeVirtualMachineService extends VirtualMachineServiceImpl implements ISiriusPlugin { +public class DcaeVirtualMachineService extends VirtualMachineServiceImpl implements ISiriusProvider, ISiriusPlugin { public static final Logger logger = Logger.getLogger(DcaeVirtualMachineService.class); - static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DcaeVirtualMachineServiceProvider controller; ISiriusServer server; @@ -71,9 +78,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.updateDeploymentStatus); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_updateDeploymentStatus,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_updateDeploymentStatus,"self:" + ManagementServer.object2ref(this)); try { controller.updateDeploymentStatus(); } @@ -82,8 +88,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.updateDeploymentStatus, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -98,9 +106,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.START, duration_,instanceName,containerPath); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.deploy); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_deploy,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_deploy,"self:" + ManagementServer.object2ref(this)); try { controller.deploy(instanceName,containerPath); } @@ -109,8 +116,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.ERROR, duration_,instanceName,containerPath); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.deploy, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -125,9 +134,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.undeploy); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_undeploy,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_undeploy,"self:" + ManagementServer.object2ref(this)); try { controller.undeploy(instanceName); } @@ -136,8 +144,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.undeploy, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -152,9 +162,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.test); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_test,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_test,"self:" + ManagementServer.object2ref(this)); try { res = controller.test(instanceName); } @@ -163,8 +172,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.test, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -179,9 +190,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.suspend); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_suspend,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_suspend,"self:" + ManagementServer.object2ref(this)); try { controller.suspend(instanceName); } @@ -190,8 +200,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.suspend, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -206,9 +218,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.resume); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_resume,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_resume,"self:" + ManagementServer.object2ref(this)); try { controller.resume(instanceName); } @@ -217,8 +228,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.resume, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -233,9 +246,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.pushManagerConfiguration); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_pushManagerConfiguration,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_pushManagerConfiguration,"self:" + ManagementServer.object2ref(this)); try { controller.pushManagerConfiguration(instanceName); } @@ -244,8 +256,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.pushManagerConfiguration, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -260,9 +274,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.pollManagerConfiguration); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_pollManagerConfiguration,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_pollManagerConfiguration,"self:" + ManagementServer.object2ref(this)); try { controller.pollManagerConfiguration(instanceName); } @@ -271,8 +284,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.pollManagerConfiguration, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -287,9 +302,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.managerConfiguration); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_managerConfiguration,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_managerConfiguration,"self:" + ManagementServer.object2ref(this)); try { res = controller.managerConfiguration(instanceName); } @@ -298,8 +312,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.managerConfiguration, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -314,9 +330,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.START, duration_,instanceName,operation,parameters); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.managerOperation); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_managerOperation,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_managerOperation,"self:" + ManagementServer.object2ref(this)); try { res = controller.managerOperation(instanceName,operation,parameters); } @@ -325,8 +340,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.ERROR, duration_,instanceName,operation,parameters); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.managerOperation, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -341,9 +358,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.updateConfigurationFromPolicy); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_updateConfigurationFromPolicy,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_updateConfigurationFromPolicy,"self:" + ManagementServer.object2ref(this)); try { controller.updateConfigurationFromPolicy(instanceName); } @@ -352,8 +368,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.updateConfigurationFromPolicy, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -368,9 +386,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.runHealthTests); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineServiceOperationEnum.VirtualMachineService_runHealthTests,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_runHealthTests,"self:" + ManagementServer.object2ref(this)); try { controller.runHealthTests(); } @@ -379,8 +396,10 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme if (server != null) server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineServiceMessageEnum.runHealthTests, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -394,6 +413,8 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme + + @Override public void start() { controller.start(); @@ -402,7 +423,7 @@ public class DcaeVirtualMachineService extends VirtualMachineServiceImpl impleme public static void ecoreSetup() { DcaeVirtualMachineServiceProvider.ecoreSetup(); } - public DcaeVirtualMachineServiceProvider getSomfProvider() { + public DcaeVirtualMachineServiceProvider getSiriusProvider() { return controller; } } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceClient.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceClient.java index 65cdc1b..61cbeb4 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceClient.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceClient.java @@ -30,6 +30,8 @@ import org.openecomp.ncomp.sirius.manager.GenericHttpClient; import org.apache.log4j.Logger; import org.openecomp.logger.EcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -54,33 +56,37 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { DcaeVirtualMachineService.ecoreSetup(); client = new GenericHttpClient(file,name); client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeVirtualMachineServiceClient(String file, String name1, String name2) { HighAvailabilityClient client1 = new HighAvailabilityClient(file,name1,name2); client = client1.all; // requests should be forwarded to all. client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeVirtualMachineServiceClient(AbstractClient c) { client = c; client.add("/resources", this); + client.setVersion("ONAP-R2"); } @Override public void updateDeploymentStatus() { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_updateDeploymentStatus); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_updateDeploymentStatus,client.getRemote()); try { client.operationPath("/resources", c, "updateDeploymentStatus", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_updateDeploymentStatus, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@updateDeploymentStatus: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateDeploymentStatus, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateDeploymentStatus,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateDeploymentStatus,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -88,16 +94,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void deploy(java.lang.String instanceName, java.lang.String containerPath) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_deploy); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_deploy,client.getRemote()); try { client.operationPath("/resources", c, "deploy", null, instanceName,containerPath); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_deploy, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@deploy: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_deploy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_deploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_deploy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -105,16 +112,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void undeploy(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_undeploy); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_undeploy,client.getRemote()); try { client.operationPath("/resources", c, "undeploy", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_undeploy, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@undeploy: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_undeploy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_undeploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_undeploy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -122,16 +130,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_test); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_test,client.getRemote()); org.openecomp.dcae.controller.core.service.HealthTestResponse res; try { res = (org.openecomp.dcae.controller.core.service.HealthTestResponse) client.operationPath("/resources", c, "test", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_test, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@test: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_test,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -139,16 +148,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void suspend(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_suspend); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_suspend,client.getRemote()); try { client.operationPath("/resources", c, "suspend", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_suspend, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@suspend: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_suspend,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -156,16 +166,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void resume(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_resume); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_resume,client.getRemote()); try { client.operationPath("/resources", c, "resume", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_resume, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@resume: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_resume,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -173,16 +184,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void pushManagerConfiguration(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_pushManagerConfiguration); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_pushManagerConfiguration,client.getRemote()); try { client.operationPath("/resources", c, "pushManagerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_pushManagerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@pushManagerConfiguration: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -190,16 +202,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void pollManagerConfiguration(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_pollManagerConfiguration); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_pollManagerConfiguration,client.getRemote()); try { client.operationPath("/resources", c, "pollManagerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_pollManagerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@pollManagerConfiguration: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -207,16 +220,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_managerConfiguration); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_managerConfiguration,client.getRemote()); org.eclipse.emf.ecore.EObject res; try { res = (org.eclipse.emf.ecore.EObject) client.operationPath("/resources", c, "managerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_managerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@managerConfiguration: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -224,16 +238,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_managerOperation); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_managerOperation,client.getRemote()); org.json.JSONObject res; try { res = (org.json.JSONObject) client.operationPath("/resources", c, "managerOperation", null, instanceName,operation,parameters); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_managerOperation, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@managerOperation: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -241,16 +256,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void updateConfigurationFromPolicy(java.lang.String instanceName) { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_updateConfigurationFromPolicy); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_updateConfigurationFromPolicy,client.getRemote()); try { client.operationPath("/resources", c, "updateConfigurationFromPolicy", null, instanceName); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_updateConfigurationFromPolicy, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@updateConfigurationFromPolicy: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -258,16 +274,17 @@ public class DcaeVirtualMachineServiceClient extends VirtualMachineServiceImpl { @Override public void runHealthTests() { - EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineServiceOperationEnum.REMOTE_runHealthTests); + EClass c = VmPackage.eINSTANCE.getVirtualMachineService(); + ecomplogger.recordMetricEventStart(VirtualMachineServiceOperationEnum.VirtualMachineService_runHealthTests,client.getRemote()); try { client.operationPath("/resources", c, "runHealthTests", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_runHealthTests, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@runHealthTests: " + e); + ecomplogger.warn(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceServer.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceServer.java index 56173b7..50a9c13 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceServer.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/DcaeVirtualMachineServiceServer.java @@ -26,17 +26,16 @@ package org.openecomp.dcae.controller.service.servers.vm; import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; import java.io.IOException; +import java.io.InputStream; import java.util.Properties; import java.util.TimeZone; import org.apache.log4j.Logger; import org.eclipse.emf.ecore.EFactory; - -import org.openecomp.entity.EcompComponent; -import org.openecomp.entity.EcompSubComponent; -import org.openecomp.entity.EcompSubComponentInstance; +import org.json.JSONObject; import org.openecomp.ncomp.sirius.manager.Jetty8Server; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.IRequestHandler; import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.dcae.controller.service.vm.VirtualMachineService; @@ -46,7 +45,7 @@ import org.openecomp.dcae.controller.service.vm.VirtualMachineService; -public class DcaeVirtualMachineServiceServer implements ISiriusServer { +public class DcaeVirtualMachineServiceServer implements ISiriusServer, IRequestHandler { public static final Logger logger = Logger.getLogger(DcaeVirtualMachineServiceServer.class); String serverPath; ManagementServer server; @@ -64,6 +63,7 @@ public class DcaeVirtualMachineServiceServer implements ISiriusServer { props = getPropertiesFromClasspath(filename); serverPath = (String) props.get("server.dir"); server = new ManagementServer(f, "VirtualMachineService", serverPath, filename); + ManagementServer.setBuildVersion("ONAP-R2"); server.addFactory(f); server.addRuntimeFactories(this); @@ -73,6 +73,7 @@ public class DcaeVirtualMachineServiceServer implements ISiriusServer { controller = (DcaeVirtualMachineService) server.find("/").o; webServer = new Jetty8Server("vm.properties"); webServer.add("/resources",server); + webServer.add("/api",this); @@ -95,4 +96,17 @@ public class DcaeVirtualMachineServiceServer implements ISiriusServer { public ManagementServer getServer() { return server; } + public Object handleJson(String userName, String action, String resourcePath, JSONObject json, JSONObject context, + String clientVersion) { + switch ((String) context.get("path")) { + case "/api/versions": + return server.supportedVersions(); + } + logger.warn("Unknown request action=" + action + " path=" + resourcePath + " context=" + context.toString(2)); + throw new RuntimeException("Unknown request"); + } + public Object handleBinary(String userName, String action, String resourcePath, InputStream in) { + return null; + } + } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineService.properties b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineService.properties index d32cf07..1218d2a 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineService.properties +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineService.properties @@ -1,150 +1,150 @@ dummy=\ - null|\ + dummy-null|\ null|\ null|\ null -deploy=\ - deploy-FAILED-5001W|\ +REQUEST_FAILED_deploy=\ + REQUEST-FAILED-deploy-4001W|\ {0}|\ null|\ Operation Failed with Exception -undeploy=\ - undeploy-FAILED-5001W|\ +REQUEST_FAILED_undeploy=\ + REQUEST-FAILED-undeploy-4001W|\ {0}|\ null|\ Operation Failed with Exception -test=\ - test-FAILED-5001W|\ +REQUEST_FAILED_test=\ + REQUEST-FAILED-test-4001W|\ {0}|\ null|\ Operation Failed with Exception -suspend=\ - suspend-FAILED-5001W|\ +REQUEST_FAILED_suspend=\ + REQUEST-FAILED-suspend-4001W|\ {0}|\ null|\ Operation Failed with Exception -resume=\ - resume-FAILED-5001W|\ +REQUEST_FAILED_resume=\ + REQUEST-FAILED-resume-4001W|\ {0}|\ null|\ Operation Failed with Exception -pushManagerConfiguration=\ - pushManagerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_pushManagerConfiguration=\ + REQUEST-FAILED-pushManagerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -pollManagerConfiguration=\ - pollManagerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_pollManagerConfiguration=\ + REQUEST-FAILED-pollManagerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -managerConfiguration=\ - managerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_managerConfiguration=\ + REQUEST-FAILED-managerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -managerOperation=\ - managerOperation-FAILED-5001W|\ +REQUEST_FAILED_managerOperation=\ + REQUEST-FAILED-managerOperation-4001W|\ {0}|\ null|\ Operation Failed with Exception -updateConfigurationFromPolicy=\ - updateConfigurationFromPolicy-FAILED-5001W|\ +REQUEST_FAILED_updateConfigurationFromPolicy=\ + REQUEST-FAILED-updateConfigurationFromPolicy-4001W|\ {0}|\ null|\ Operation Failed with Exception -runHealthTests=\ - runHealthTests-FAILED-5001W|\ +REQUEST_FAILED_runHealthTests=\ + REQUEST-FAILED-runHealthTests-4001W|\ {0}|\ null|\ Operation Failed with Exception -updateDeploymentStatus=\ - updateDeploymentStatus-FAILED-5001W|\ +REQUEST_FAILED_updateDeploymentStatus=\ + REQUEST-FAILED-updateDeploymentStatus-4001W|\ {0}|\ null|\ Operation Failed with Exception -REMOTE_deploy=\ - REMOTE-deploy-FAILED-5001W|\ +REMOTE_CALL_FAILED_deploy=\ + REMOTE-CALL-FAILED-deploy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_undeploy=\ - REMOTE-undeploy-FAILED-5001W|\ +REMOTE_CALL_FAILED_undeploy=\ + REMOTE-CALL-FAILED-undeploy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_test=\ - REMOTE-test-FAILED-5001W|\ +REMOTE_CALL_FAILED_test=\ + REMOTE-CALL-FAILED-test-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_suspend=\ - REMOTE-suspend-FAILED-5001W|\ +REMOTE_CALL_FAILED_suspend=\ + REMOTE-CALL-FAILED-suspend-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_resume=\ - REMOTE-resume-FAILED-5001W|\ +REMOTE_CALL_FAILED_resume=\ + REMOTE-CALL-FAILED-resume-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_pushManagerConfiguration=\ - REMOTE-pushManagerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_pushManagerConfiguration=\ + REMOTE-CALL-FAILED-pushManagerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_pollManagerConfiguration=\ - REMOTE-pollManagerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_pollManagerConfiguration=\ + REMOTE-CALL-FAILED-pollManagerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_managerConfiguration=\ - REMOTE-managerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_managerConfiguration=\ + REMOTE-CALL-FAILED-managerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_managerOperation=\ - REMOTE-managerOperation-FAILED-5001W|\ +REMOTE_CALL_FAILED_managerOperation=\ + REMOTE-CALL-FAILED-managerOperation-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_updateConfigurationFromPolicy=\ - REMOTE-updateConfigurationFromPolicy-FAILED-5001W|\ +REMOTE_CALL_FAILED_updateConfigurationFromPolicy=\ + REMOTE-CALL-FAILED-updateConfigurationFromPolicy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_runHealthTests=\ - REMOTE-runHealthTests-FAILED-5001W|\ +REMOTE_CALL_FAILED_runHealthTests=\ + REMOTE-CALL-FAILED-runHealthTests-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_updateDeploymentStatus=\ - REMOTE-updateDeploymentStatus-FAILED-5001W|\ +REMOTE_CALL_FAILED_updateDeploymentStatus=\ + REMOTE-CALL-FAILED-updateDeploymentStatus-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceMessageEnum.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceMessageEnum.java index d0f7bf2..9973d3c 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceMessageEnum.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceMessageEnum.java @@ -1,25 +1,4 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.vm.logging; import com.att.eelf.i18n.EELFResourceManager; @@ -28,32 +7,32 @@ import org.openecomp.logger.EcompMessageEnum; public enum VirtualMachineServiceMessageEnum implements EcompMessageEnum { dummy, - deploy, - undeploy, - test, - suspend, - resume, - pushManagerConfiguration, - pollManagerConfiguration, - managerConfiguration, - managerOperation, - updateConfigurationFromPolicy, - runHealthTests, - updateDeploymentStatus, - REMOTE_deploy, - REMOTE_undeploy, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_pushManagerConfiguration, - REMOTE_pollManagerConfiguration, - REMOTE_managerConfiguration, - REMOTE_managerOperation, - REMOTE_updateConfigurationFromPolicy, - REMOTE_runHealthTests, - REMOTE_updateDeploymentStatus; + REQUEST_FAILED_deploy, + REQUEST_FAILED_undeploy, + REQUEST_FAILED_test, + REQUEST_FAILED_suspend, + REQUEST_FAILED_resume, + REQUEST_FAILED_pushManagerConfiguration, + REQUEST_FAILED_pollManagerConfiguration, + REQUEST_FAILED_managerConfiguration, + REQUEST_FAILED_managerOperation, + REQUEST_FAILED_updateConfigurationFromPolicy, + REQUEST_FAILED_runHealthTests, + REQUEST_FAILED_updateDeploymentStatus, + REMOTE_CALL_FAILED_deploy, + REMOTE_CALL_FAILED_undeploy, + REMOTE_CALL_FAILED_test, + REMOTE_CALL_FAILED_suspend, + REMOTE_CALL_FAILED_resume, + REMOTE_CALL_FAILED_pushManagerConfiguration, + REMOTE_CALL_FAILED_pollManagerConfiguration, + REMOTE_CALL_FAILED_managerConfiguration, + REMOTE_CALL_FAILED_managerOperation, + REMOTE_CALL_FAILED_updateConfigurationFromPolicy, + REMOTE_CALL_FAILED_runHealthTests, + REMOTE_CALL_FAILED_updateDeploymentStatus; static { - EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.servers.vm.logging.VirtualMachineService"); + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineService"); } } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceOperationEnum.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceOperationEnum.java index 52d420c..d63d19c 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceOperationEnum.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vm/logging/VirtualMachineServiceOperationEnum.java @@ -1,53 +1,33 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.vm.logging; import org.openecomp.entity.EcompOperationEnum; public enum VirtualMachineServiceOperationEnum implements EcompOperationEnum { - deploy, - undeploy, - test, - suspend, - resume, - pushManagerConfiguration, - pollManagerConfiguration, - managerConfiguration, - managerOperation, - updateConfigurationFromPolicy, - runHealthTests, - updateDeploymentStatus, - REMOTE_deploy, - REMOTE_undeploy, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_pushManagerConfiguration, - REMOTE_pollManagerConfiguration, - REMOTE_managerConfiguration, - REMOTE_managerOperation, - REMOTE_updateConfigurationFromPolicy, - REMOTE_runHealthTests, - REMOTE_updateDeploymentStatus; + VirtualMachineService_deploy("VirtualMachineService@deploy"), + VirtualMachineService_undeploy("VirtualMachineService@undeploy"), + VirtualMachineService_test("VirtualMachineService@test"), + VirtualMachineService_suspend("VirtualMachineService@suspend"), + VirtualMachineService_resume("VirtualMachineService@resume"), + VirtualMachineService_pushManagerConfiguration("VirtualMachineService@pushManagerConfiguration"), + VirtualMachineService_pollManagerConfiguration("VirtualMachineService@pollManagerConfiguration"), + VirtualMachineService_managerConfiguration("VirtualMachineService@managerConfiguration"), + VirtualMachineService_managerOperation("VirtualMachineService@managerOperation"), + VirtualMachineService_updateConfigurationFromPolicy("VirtualMachineService@updateConfigurationFromPolicy"), + VirtualMachineService_runHealthTests("VirtualMachineService@runHealthTests"), + VirtualMachineService_updateDeploymentStatus("VirtualMachineService@updateDeploymentStatus") ; + + + private String n; + + private VirtualMachineServiceOperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManager.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManager.java index 889b01c..0f6c576 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManager.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManager.java @@ -26,20 +26,27 @@ package org.openecomp.dcae.controller.service.servers.vmmanager; + import java.io.InputStream; import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.SwaggerUtils; import org.openecomp.ncomp.sirius.function.FunctionUtils; import org.openecomp.ncomp.component.ApiRequestStatus; import org.apache.log4j.Logger; -import org.openecomp.logger.EcompLogger; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.json.JSONObject; import java.util.Date; @@ -72,9 +79,9 @@ import org.openecomp.dcae.controller.service.vmmanager.impl.VirtualMachineManage -public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { +public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl implements ISiriusProvider { public static final Logger logger = Logger.getLogger(DcaeVirtualMachineManager.class); - static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DcaeVirtualMachineManagerProvider controller; ISiriusServer server; @@ -89,9 +96,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.test); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_test,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_test,"self:" + ManagementServer.object2ref(this)); try { res = controller.test(); } @@ -100,8 +106,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.test, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_test, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -116,9 +124,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.suspend); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_suspend,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_suspend,"self:" + ManagementServer.object2ref(this)); try { controller.suspend(); } @@ -127,8 +134,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.suspend, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -143,9 +152,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.resume); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_resume,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_resume,"self:" + ManagementServer.object2ref(this)); try { controller.resume(); } @@ -154,8 +162,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.resume, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_resume, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -170,9 +180,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.publicKey); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_publicKey,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_publicKey,"self:" + ManagementServer.object2ref(this)); try { res = controller.publicKey(); } @@ -181,8 +190,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.publicKey, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_publicKey, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_publicKey,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_publicKey, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -197,9 +208,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.configurationChanged); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_configurationChanged,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_configurationChanged,"self:" + ManagementServer.object2ref(this)); try { controller.configurationChanged(); } @@ -208,8 +218,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.configurationChanged, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_configurationChanged, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_configurationChanged,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_configurationChanged, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -224,9 +236,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.START, duration_,inputStreams,outputStreams); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.updateStreams); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_updateStreams,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_updateStreams,"self:" + ManagementServer.object2ref(this)); try { controller.updateStreams(inputStreams,outputStreams); } @@ -235,8 +246,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.ERROR, duration_,inputStreams,outputStreams); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.updateStreams, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_updateStreams, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_updateStreams,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_updateStreams, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -251,9 +264,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "logs", ApiRequestStatus.START, duration_,cx,logs); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.logs); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_logs,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_logs,"self:" + ManagementServer.object2ref(this)); try { controller.logs(cx,logs); } @@ -262,8 +274,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "logs", ApiRequestStatus.ERROR, duration_,cx,logs); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.logs, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_logs, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_logs,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_logs, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -278,9 +292,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "metrics", ApiRequestStatus.START, duration_,cx,metrics); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.metrics); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_metrics,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_metrics,"self:" + ManagementServer.object2ref(this)); try { controller.metrics(cx,metrics); } @@ -289,8 +302,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "metrics", ApiRequestStatus.ERROR, duration_,cx,metrics); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.metrics, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_metrics, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_metrics,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_metrics, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -305,9 +320,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "properties", ApiRequestStatus.START, duration_,cx,l); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.properties); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_properties,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_properties,"self:" + ManagementServer.object2ref(this)); try { controller.properties(cx,l); } @@ -316,8 +330,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "properties", ApiRequestStatus.ERROR, duration_,cx,l); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.properties, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_properties, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_properties,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_properties, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -332,9 +348,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "uploadInfo", ApiRequestStatus.START, duration_,cx,info); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.uploadInfo); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_uploadInfo,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_uploadInfo,"self:" + ManagementServer.object2ref(this)); try { controller.uploadInfo(cx,info); } @@ -343,8 +358,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "uploadInfo", ApiRequestStatus.ERROR, duration_,cx,info); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.uploadInfo, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_uploadInfo, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_uploadInfo,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_uploadInfo, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -359,9 +376,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getValues", ApiRequestStatus.START, duration_,cx,path,start,end,option,relativeInterval); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.getValues); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValues,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValues,"self:" + ManagementServer.object2ref(this)); try { res = controller.getValues(cx,path,start,end,option,relativeInterval); } @@ -370,8 +386,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getValues", ApiRequestStatus.ERROR, duration_,cx,path,start,end,option,relativeInterval); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.getValues, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValues, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValues,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValues, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -386,9 +404,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getValuesAll", ApiRequestStatus.START, duration_,cx,path,metrics,start,end,option,relativeInterval); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.getValuesAll); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValuesAll,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValuesAll,"self:" + ManagementServer.object2ref(this)); try { res = controller.getValuesAll(cx,path,metrics,start,end,option,relativeInterval); } @@ -397,8 +414,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getValuesAll", ApiRequestStatus.ERROR, duration_,cx,path,metrics,start,end,option,relativeInterval); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.getValuesAll, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValuesAll, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValuesAll,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_getValuesAll, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -413,9 +432,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getMessages", ApiRequestStatus.START, duration_,cx,path,start,end); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.getMessages); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_getMessages,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getMessages,"self:" + ManagementServer.object2ref(this)); try { res = controller.getMessages(cx,path,start,end); } @@ -424,8 +442,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getMessages", ApiRequestStatus.ERROR, duration_,cx,path,start,end); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.getMessages, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getMessages, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getMessages,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_getMessages, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -440,9 +460,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getRequestLogger", ApiRequestStatus.START, duration_,userName,action,resourcePath,context); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.getRequestLogger); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_getRequestLogger,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getRequestLogger,"self:" + ManagementServer.object2ref(this)); try { res = controller.getRequestLogger(userName,action,resourcePath,context); } @@ -451,8 +470,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "getRequestLogger", ApiRequestStatus.ERROR, duration_,userName,action,resourcePath,context); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.getRequestLogger, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getRequestLogger, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_getRequestLogger,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_getRequestLogger, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -467,9 +488,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "evaluate", ApiRequestStatus.START, duration_,path,function); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.evaluate); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_evaluate,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_evaluate,"self:" + ManagementServer.object2ref(this)); try { res = controller.evaluate(path,function); } @@ -478,8 +498,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "evaluate", ApiRequestStatus.ERROR, duration_,path,function); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.evaluate, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_evaluate, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_evaluate,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_evaluate, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -494,9 +516,8 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "update", ApiRequestStatus.START, duration_,path,function); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.update); - ecomplogger.setInstanceId(ManagementServer.object2ref(this)); + ecomplogger.recordAuditEventStartIfNeeded(VirtualMachineManagerOperationEnum.VirtualMachineManager_update,server,this); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_update,"self:" + ManagementServer.object2ref(this)); try { controller.update(path,function); } @@ -505,8 +526,10 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { if (server != null) server.getServer().recordApi(null, this, "update", ApiRequestStatus.ERROR, duration_,path,function); System.err.println("ERROR: " + e); - ecomplogger.warn(VirtualMachineManagerMessageEnum.update, e.toString()); - throw e; + ecomplogger.warn(VirtualMachineManagerMessageEnum.REQUEST_FAILED_update, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REQUEST_FAILED_update,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, VirtualMachineManagerMessageEnum.REQUEST_FAILED_update, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -520,10 +543,12 @@ public class DcaeVirtualMachineManager extends VirtualMachineManagerImpl { + + public static void ecoreSetup() { DcaeVirtualMachineManagerProvider.ecoreSetup(); } - public DcaeVirtualMachineManagerProvider getSomfProvider() { + public DcaeVirtualMachineManagerProvider getSiriusProvider() { return controller; } } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerClient.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerClient.java index 1030b1c..e175e49 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerClient.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerClient.java @@ -30,6 +30,8 @@ import org.openecomp.ncomp.sirius.manager.GenericHttpClient; import org.apache.log4j.Logger; import org.openecomp.logger.EcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -54,33 +56,37 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { DcaeVirtualMachineManager.ecoreSetup(); client = new GenericHttpClient(file,name); client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeVirtualMachineManagerClient(String file, String name1, String name2) { HighAvailabilityClient client1 = new HighAvailabilityClient(file,name1,name2); client = client1.all; // requests should be forwarded to all. client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeVirtualMachineManagerClient(AbstractClient c) { client = c; client.add("/resources", this); + client.setVersion("ONAP-R2"); } @Override public org.openecomp.dcae.controller.core.service.HealthTestResponse test() { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_test); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_test,client.getRemote()); org.openecomp.dcae.controller.core.service.HealthTestResponse res; try { res = (org.openecomp.dcae.controller.core.service.HealthTestResponse) client.operationPath("/resources", c, "test", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_test, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@test: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_test,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -88,16 +94,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void suspend() { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_suspend); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_suspend,client.getRemote()); try { client.operationPath("/resources", c, "suspend", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_suspend, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@suspend: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_suspend,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -105,16 +112,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void resume() { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_resume); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_resume,client.getRemote()); try { client.operationPath("/resources", c, "resume", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_resume, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@resume: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_resume,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -122,16 +130,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public java.lang.String publicKey() { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_publicKey); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_publicKey,client.getRemote()); java.lang.String res; try { res = (java.lang.String) client.operationPath("/resources", c, "publicKey", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_publicKey, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@publicKey: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_publicKey, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_publicKey,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_publicKey,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -139,16 +148,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void configurationChanged() { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_configurationChanged); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_configurationChanged,client.getRemote()); try { client.operationPath("/resources", c, "configurationChanged", null); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_configurationChanged, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@configurationChanged: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -156,16 +166,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void updateStreams(EList<org.openecomp.dcae.controller.core.stream.DcaeStream> inputStreams, EList<org.openecomp.dcae.controller.core.stream.DcaeStream> outputStreams) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_updateStreams); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_updateStreams,client.getRemote()); try { client.operationPath("/resources", c, "updateStreams", null, inputStreams,outputStreams); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_updateStreams, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@updateStreams: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -173,16 +184,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void logs(org.json.JSONObject cx, EList<org.openecomp.ncomp.core.logs.LogMessage> logs) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_logs); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_logs,client.getRemote()); try { client.operationPath("/resources", c, "logs", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,logs); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_logs, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@logs: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_logs, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_logs,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_logs,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -190,16 +202,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void metrics(org.json.JSONObject cx, EList<org.openecomp.ncomp.core.metrics.Metric> metrics) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_metrics); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_metrics,client.getRemote()); try { client.operationPath("/resources", c, "metrics", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,metrics); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_metrics, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@metrics: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_metrics, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_metrics,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_metrics,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -207,16 +220,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void properties(org.json.JSONObject cx, EList<org.openecomp.ncomp.sirius.manager.properties.AbstractProperty> l) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_properties); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_properties,client.getRemote()); try { client.operationPath("/resources", c, "properties", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,l); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_properties, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@properties: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_properties, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_properties,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_properties,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -224,16 +238,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void uploadInfo(org.json.JSONObject cx, EList<org.openecomp.ncomp.sirius.manager.server.ManagementInfo> info) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_uploadInfo); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_uploadInfo,client.getRemote()); try { client.operationPath("/resources", c, "uploadInfo", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,info); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_uploadInfo, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@uploadInfo: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_uploadInfo, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_uploadInfo,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_uploadInfo,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -241,16 +256,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public EList<org.openecomp.ncomp.core.metrics.DoubleMetric> getValues(org.json.JSONObject cx, java.lang.String path, java.lang.Long start, java.lang.Long end, org.openecomp.ncomp.core.metrics.MetricValueOption option, boolean relativeInterval) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_getValues); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValues,client.getRemote()); EList<org.openecomp.ncomp.core.metrics.DoubleMetric> res; try { res = (EList<org.openecomp.ncomp.core.metrics.DoubleMetric>) client.operationPath("/resources", c, "getValues", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,path,start,end,option,relativeInterval); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_getValues, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@getValues: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValues, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValues,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValues,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -258,16 +274,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public EList<org.openecomp.ncomp.core.metrics.DoubleMetric> getValuesAll(org.json.JSONObject cx, java.lang.String path, EList<java.lang.String> metrics, java.lang.Long start, java.lang.Long end, org.openecomp.ncomp.core.metrics.MetricValueOption option, boolean relativeInterval) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_getValuesAll); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getValuesAll,client.getRemote()); EList<org.openecomp.ncomp.core.metrics.DoubleMetric> res; try { res = (EList<org.openecomp.ncomp.core.metrics.DoubleMetric>) client.operationPath("/resources", c, "getValuesAll", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,path,metrics,start,end,option,relativeInterval); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_getValuesAll, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@getValuesAll: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValuesAll, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValuesAll,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getValuesAll,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -275,16 +292,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public EList<org.openecomp.ncomp.core.logs.LogMessage> getMessages(org.json.JSONObject cx, java.lang.String path, java.lang.Long start, java.lang.Long end) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_getMessages); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getMessages,client.getRemote()); EList<org.openecomp.ncomp.core.logs.LogMessage> res; try { res = (EList<org.openecomp.ncomp.core.logs.LogMessage>) client.operationPath("/resources", c, "getMessages", cx != null && cx.has("timeout") ? cx.getLong("timeout") : null, cx,path,start,end); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_getMessages, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@getMessages: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getMessages, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getMessages,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getMessages,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -292,16 +310,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public org.openecomp.ncomp.sirius.manager.server.LoggerInfo getRequestLogger(java.lang.String userName, java.lang.String action, java.lang.String resourcePath, org.json.JSONObject context) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_getRequestLogger); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_getRequestLogger,client.getRemote()); org.openecomp.ncomp.sirius.manager.server.LoggerInfo res; try { res = (org.openecomp.ncomp.sirius.manager.server.LoggerInfo) client.operationPath("/resources", c, "getRequestLogger", null, userName,action,resourcePath,context); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_getRequestLogger, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@getRequestLogger: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getRequestLogger, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getRequestLogger,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_getRequestLogger,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -309,16 +328,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public EList<org.openecomp.ncomp.core.function.ValuePair> evaluate(java.lang.String path, org.openecomp.ncomp.core.function.Function function) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_evaluate); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_evaluate,client.getRemote()); EList<org.openecomp.ncomp.core.function.ValuePair> res; try { res = (EList<org.openecomp.ncomp.core.function.ValuePair>) client.operationPath("/resources", c, "evaluate", null, path,function); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_evaluate, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@evaluate: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_evaluate, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_evaluate,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_evaluate,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -326,16 +346,17 @@ public class DcaeVirtualMachineManagerClient extends VirtualMachineManagerImpl { @Override public void update(java.lang.String path, org.openecomp.ncomp.core.function.Function function) { - EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(VirtualMachineManagerOperationEnum.REMOTE_update); + EClass c = VmmanagerPackage.eINSTANCE.getVirtualMachineManager(); + ecomplogger.recordMetricEventStart(VirtualMachineManagerOperationEnum.VirtualMachineManager_update,client.getRemote()); try { client.operationPath("/resources", c, "update", null, path,function); } catch (Exception e) { - ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_update, e.toString()); - throw new RuntimeException("remote call failed: " + client.getRemote() + "@update: " + e); + ecomplogger.warn(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_update, e.toString()); + EcompException e1 = EcompException.create(VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_update,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,VirtualMachineManagerMessageEnum.REMOTE_CALL_FAILED_update,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerServer.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerServer.java index b769ee8..b30fc6d 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerServer.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/DcaeVirtualMachineManagerServer.java @@ -26,17 +26,16 @@ package org.openecomp.dcae.controller.service.servers.vmmanager; import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; import java.io.IOException; +import java.io.InputStream; import java.util.Properties; import java.util.TimeZone; import org.apache.log4j.Logger; import org.eclipse.emf.ecore.EFactory; - -import org.openecomp.entity.EcompComponent; -import org.openecomp.entity.EcompSubComponent; -import org.openecomp.entity.EcompSubComponentInstance; +import org.json.JSONObject; import org.openecomp.ncomp.sirius.manager.Jetty8Server; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.IRequestHandler; import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.dcae.controller.service.vmmanager.VirtualMachineManager; @@ -46,7 +45,7 @@ import org.openecomp.dcae.controller.service.vmmanager.VirtualMachineManager; -public class DcaeVirtualMachineManagerServer implements ISiriusServer { +public class DcaeVirtualMachineManagerServer implements ISiriusServer, IRequestHandler { public static final Logger logger = Logger.getLogger(DcaeVirtualMachineManagerServer.class); String serverPath; ManagementServer server; @@ -64,6 +63,7 @@ public class DcaeVirtualMachineManagerServer implements ISiriusServer { props = getPropertiesFromClasspath(filename); serverPath = (String) props.get("server.dir"); server = new ManagementServer(f, "VirtualMachineManager", serverPath, filename); + ManagementServer.setBuildVersion("ONAP-R2"); server.addFactory(f); server.addRuntimeFactories(this); @@ -73,6 +73,7 @@ public class DcaeVirtualMachineManagerServer implements ISiriusServer { controller = (DcaeVirtualMachineManager) server.find("/").o; webServer = new Jetty8Server("vmmanager.properties"); webServer.add("/resources",server); + webServer.add("/api",this); @@ -95,4 +96,17 @@ public class DcaeVirtualMachineManagerServer implements ISiriusServer { public ManagementServer getServer() { return server; } + public Object handleJson(String userName, String action, String resourcePath, JSONObject json, JSONObject context, + String clientVersion) { + switch ((String) context.get("path")) { + case "/api/versions": + return server.supportedVersions(); + } + logger.warn("Unknown request action=" + action + " path=" + resourcePath + " context=" + context.toString(2)); + throw new RuntimeException("Unknown request"); + } + public Object handleBinary(String userName, String action, String resourcePath, InputStream in) { + return null; + } + } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManager.properties b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManager.properties index 9eb6331..ec788c2 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManager.properties +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManager.properties @@ -1,198 +1,198 @@ dummy=\ - null|\ + dummy-null|\ null|\ null|\ null -test=\ - test-FAILED-5001W|\ +REQUEST_FAILED_test=\ + REQUEST-FAILED-test-4001W|\ {0}|\ null|\ Operation Failed with Exception -suspend=\ - suspend-FAILED-5001W|\ +REQUEST_FAILED_suspend=\ + REQUEST-FAILED-suspend-4001W|\ {0}|\ null|\ Operation Failed with Exception -resume=\ - resume-FAILED-5001W|\ +REQUEST_FAILED_resume=\ + REQUEST-FAILED-resume-4001W|\ {0}|\ null|\ Operation Failed with Exception -publicKey=\ - publicKey-FAILED-5001W|\ +REQUEST_FAILED_publicKey=\ + REQUEST-FAILED-publicKey-4001W|\ {0}|\ null|\ Operation Failed with Exception -configurationChanged=\ - configurationChanged-FAILED-5001W|\ +REQUEST_FAILED_configurationChanged=\ + REQUEST-FAILED-configurationChanged-4001W|\ {0}|\ null|\ Operation Failed with Exception -updateStreams=\ - updateStreams-FAILED-5001W|\ +REQUEST_FAILED_updateStreams=\ + REQUEST-FAILED-updateStreams-4001W|\ {0}|\ null|\ Operation Failed with Exception -logs=\ - logs-FAILED-5001W|\ +REQUEST_FAILED_logs=\ + REQUEST-FAILED-logs-4001W|\ {0}|\ null|\ Operation Failed with Exception -metrics=\ - metrics-FAILED-5001W|\ +REQUEST_FAILED_metrics=\ + REQUEST-FAILED-metrics-4001W|\ {0}|\ null|\ Operation Failed with Exception -properties=\ - properties-FAILED-5001W|\ +REQUEST_FAILED_properties=\ + REQUEST-FAILED-properties-4001W|\ {0}|\ null|\ Operation Failed with Exception -uploadInfo=\ - uploadInfo-FAILED-5001W|\ +REQUEST_FAILED_uploadInfo=\ + REQUEST-FAILED-uploadInfo-4001W|\ {0}|\ null|\ Operation Failed with Exception -getValues=\ - getValues-FAILED-5001W|\ +REQUEST_FAILED_getValues=\ + REQUEST-FAILED-getValues-4001W|\ {0}|\ null|\ Operation Failed with Exception -getValuesAll=\ - getValuesAll-FAILED-5001W|\ +REQUEST_FAILED_getValuesAll=\ + REQUEST-FAILED-getValuesAll-4001W|\ {0}|\ null|\ Operation Failed with Exception -getMessages=\ - getMessages-FAILED-5001W|\ +REQUEST_FAILED_getMessages=\ + REQUEST-FAILED-getMessages-4001W|\ {0}|\ null|\ Operation Failed with Exception -getRequestLogger=\ - getRequestLogger-FAILED-5001W|\ +REQUEST_FAILED_getRequestLogger=\ + REQUEST-FAILED-getRequestLogger-4001W|\ {0}|\ null|\ Operation Failed with Exception -evaluate=\ - evaluate-FAILED-5001W|\ +REQUEST_FAILED_evaluate=\ + REQUEST-FAILED-evaluate-4001W|\ {0}|\ null|\ Operation Failed with Exception -update=\ - update-FAILED-5001W|\ +REQUEST_FAILED_update=\ + REQUEST-FAILED-update-4001W|\ {0}|\ null|\ Operation Failed with Exception -REMOTE_test=\ - REMOTE-test-FAILED-5001W|\ +REMOTE_CALL_FAILED_test=\ + REMOTE-CALL-FAILED-test-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_suspend=\ - REMOTE-suspend-FAILED-5001W|\ +REMOTE_CALL_FAILED_suspend=\ + REMOTE-CALL-FAILED-suspend-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_resume=\ - REMOTE-resume-FAILED-5001W|\ +REMOTE_CALL_FAILED_resume=\ + REMOTE-CALL-FAILED-resume-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_publicKey=\ - REMOTE-publicKey-FAILED-5001W|\ +REMOTE_CALL_FAILED_publicKey=\ + REMOTE-CALL-FAILED-publicKey-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_configurationChanged=\ - REMOTE-configurationChanged-FAILED-5001W|\ +REMOTE_CALL_FAILED_configurationChanged=\ + REMOTE-CALL-FAILED-configurationChanged-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_updateStreams=\ - REMOTE-updateStreams-FAILED-5001W|\ +REMOTE_CALL_FAILED_updateStreams=\ + REMOTE-CALL-FAILED-updateStreams-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_logs=\ - REMOTE-logs-FAILED-5001W|\ +REMOTE_CALL_FAILED_logs=\ + REMOTE-CALL-FAILED-logs-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_metrics=\ - REMOTE-metrics-FAILED-5001W|\ +REMOTE_CALL_FAILED_metrics=\ + REMOTE-CALL-FAILED-metrics-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_properties=\ - REMOTE-properties-FAILED-5001W|\ +REMOTE_CALL_FAILED_properties=\ + REMOTE-CALL-FAILED-properties-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_uploadInfo=\ - REMOTE-uploadInfo-FAILED-5001W|\ +REMOTE_CALL_FAILED_uploadInfo=\ + REMOTE-CALL-FAILED-uploadInfo-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getValues=\ - REMOTE-getValues-FAILED-5001W|\ +REMOTE_CALL_FAILED_getValues=\ + REMOTE-CALL-FAILED-getValues-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getValuesAll=\ - REMOTE-getValuesAll-FAILED-5001W|\ +REMOTE_CALL_FAILED_getValuesAll=\ + REMOTE-CALL-FAILED-getValuesAll-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getMessages=\ - REMOTE-getMessages-FAILED-5001W|\ +REMOTE_CALL_FAILED_getMessages=\ + REMOTE-CALL-FAILED-getMessages-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getRequestLogger=\ - REMOTE-getRequestLogger-FAILED-5001W|\ +REMOTE_CALL_FAILED_getRequestLogger=\ + REMOTE-CALL-FAILED-getRequestLogger-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_evaluate=\ - REMOTE-evaluate-FAILED-5001W|\ +REMOTE_CALL_FAILED_evaluate=\ + REMOTE-CALL-FAILED-evaluate-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_update=\ - REMOTE-update-FAILED-5001W|\ +REMOTE_CALL_FAILED_update=\ + REMOTE-CALL-FAILED-update-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerMessageEnum.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerMessageEnum.java index f8087ef..4566a70 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerMessageEnum.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerMessageEnum.java @@ -1,25 +1,4 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.vmmanager.logging; import com.att.eelf.i18n.EELFResourceManager; @@ -28,40 +7,40 @@ import org.openecomp.logger.EcompMessageEnum; public enum VirtualMachineManagerMessageEnum implements EcompMessageEnum { dummy, - test, - suspend, - resume, - publicKey, - configurationChanged, - updateStreams, - logs, - metrics, - properties, - uploadInfo, - getValues, - getValuesAll, - getMessages, - getRequestLogger, - evaluate, - update, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_publicKey, - REMOTE_configurationChanged, - REMOTE_updateStreams, - REMOTE_logs, - REMOTE_metrics, - REMOTE_properties, - REMOTE_uploadInfo, - REMOTE_getValues, - REMOTE_getValuesAll, - REMOTE_getMessages, - REMOTE_getRequestLogger, - REMOTE_evaluate, - REMOTE_update; + REQUEST_FAILED_test, + REQUEST_FAILED_suspend, + REQUEST_FAILED_resume, + REQUEST_FAILED_publicKey, + REQUEST_FAILED_configurationChanged, + REQUEST_FAILED_updateStreams, + REQUEST_FAILED_logs, + REQUEST_FAILED_metrics, + REQUEST_FAILED_properties, + REQUEST_FAILED_uploadInfo, + REQUEST_FAILED_getValues, + REQUEST_FAILED_getValuesAll, + REQUEST_FAILED_getMessages, + REQUEST_FAILED_getRequestLogger, + REQUEST_FAILED_evaluate, + REQUEST_FAILED_update, + REMOTE_CALL_FAILED_test, + REMOTE_CALL_FAILED_suspend, + REMOTE_CALL_FAILED_resume, + REMOTE_CALL_FAILED_publicKey, + REMOTE_CALL_FAILED_configurationChanged, + REMOTE_CALL_FAILED_updateStreams, + REMOTE_CALL_FAILED_logs, + REMOTE_CALL_FAILED_metrics, + REMOTE_CALL_FAILED_properties, + REMOTE_CALL_FAILED_uploadInfo, + REMOTE_CALL_FAILED_getValues, + REMOTE_CALL_FAILED_getValuesAll, + REMOTE_CALL_FAILED_getMessages, + REMOTE_CALL_FAILED_getRequestLogger, + REMOTE_CALL_FAILED_evaluate, + REMOTE_CALL_FAILED_update; static { - EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.servers.vmmanager.logging.VirtualMachineManager"); + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManager"); } } diff --git a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerOperationEnum.java b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerOperationEnum.java index 71aeeda..3d59dc3 100644 --- a/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerOperationEnum.java +++ b/dcae-controller-service-vm/dcae-controller-service-vm-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/vmmanager/logging/VirtualMachineManagerOperationEnum.java @@ -1,61 +1,37 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.vmmanager.logging; import org.openecomp.entity.EcompOperationEnum; public enum VirtualMachineManagerOperationEnum implements EcompOperationEnum { - test, - suspend, - resume, - publicKey, - configurationChanged, - updateStreams, - logs, - metrics, - properties, - uploadInfo, - getValues, - getValuesAll, - getMessages, - getRequestLogger, - evaluate, - update, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_publicKey, - REMOTE_configurationChanged, - REMOTE_updateStreams, - REMOTE_logs, - REMOTE_metrics, - REMOTE_properties, - REMOTE_uploadInfo, - REMOTE_getValues, - REMOTE_getValuesAll, - REMOTE_getMessages, - REMOTE_getRequestLogger, - REMOTE_evaluate, - REMOTE_update; + VirtualMachineManager_test("VirtualMachineManager@test"), + VirtualMachineManager_suspend("VirtualMachineManager@suspend"), + VirtualMachineManager_resume("VirtualMachineManager@resume"), + VirtualMachineManager_publicKey("VirtualMachineManager@publicKey"), + VirtualMachineManager_configurationChanged("VirtualMachineManager@configurationChanged"), + VirtualMachineManager_updateStreams("VirtualMachineManager@updateStreams"), + VirtualMachineManager_logs("VirtualMachineManager@logs"), + VirtualMachineManager_metrics("VirtualMachineManager@metrics"), + VirtualMachineManager_properties("VirtualMachineManager@properties"), + VirtualMachineManager_uploadInfo("VirtualMachineManager@uploadInfo"), + VirtualMachineManager_getValues("VirtualMachineManager@getValues"), + VirtualMachineManager_getValuesAll("VirtualMachineManager@getValuesAll"), + VirtualMachineManager_getMessages("VirtualMachineManager@getMessages"), + VirtualMachineManager_getRequestLogger("VirtualMachineManager@getRequestLogger"), + VirtualMachineManager_evaluate("VirtualMachineManager@evaluate"), + VirtualMachineManager_update("VirtualMachineManager@update") ; + + + private String n; + + private VirtualMachineManagerOperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + } |