diff options
Diffstat (limited to 'dcae-controller-core/dcae-controller-platform-server')
3 files changed, 497 insertions, 525 deletions
diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryTest.java b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryTest.java index 0ad21dd..5be2c61 100644 --- a/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryTest.java +++ b/dcae-controller-core/dcae-controller-platform-server/src/main/java/org/openecomp/dcae/controller/platform/servers/controller/inventory/DcaeDcaeInventoryTest.java @@ -5,19 +5,17 @@ import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.ncomp.sirius.manager.ManagementServer; public class DcaeDcaeInventoryTest implements ISiriusServer { + private ManagementServer server = new ManagementServer(); - public static void main(String[] args) { - DcaeDcaeInventoryTest server = new DcaeDcaeInventoryTest(); - DcaeInventoryFactory f = new DcaeInventoryFactory(server); - DcaeInventory inv = f.createDcaeInventory(); - inv.poll(); - } - - private ManagementServer server = new ManagementServer(); - - @Override - public ManagementServer getServer() { - return server; - } + public static void main(String[] args) { + DcaeDcaeInventoryTest server = new DcaeDcaeInventoryTest(); + DcaeInventoryFactory f = new DcaeInventoryFactory(server); + DcaeInventory inv = f.createDcaeInventory(); + inv.poll(); + } + @Override + public ManagementServer getServer() { + return server; + } } diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerCluster.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerCluster.java index 893d909..d7b96a2 100644 --- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerCluster.java +++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerCluster.java @@ -18,132 +18,108 @@ * limitations under the License. * ============LICENSE_END============================================ */ - + // Autogenerated // Do not edit. No need to extend this class. package org.openecomp.dcae.controller.platform.servers.controller; - - - - -import java.io.InputStream; - -import org.openecomp.ncomp.sirius.manager.IRequestHandler; -import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; +import org.apache.log4j.Logger; +import org.openecomp.dcae.controller.platform.controller.impl.ControllerClusterImpl; +import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerClusterMessageEnum; +import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerClusterOperationEnum; +import org.openecomp.logger.EcompException; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.ncomp.component.ApiRequestStatus; 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.ISiriusServer; 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.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; -import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerClusterOperationEnum; -import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerClusterMessageEnum; - - - - -import org.openecomp.dcae.controller.platform.controller.impl.ControllerClusterImpl; - - - public class DcaeControllerCluster extends ControllerClusterImpl implements ISiriusProvider, ISiriusPlugin { - public static final Logger logger = Logger.getLogger(DcaeControllerCluster.class); - static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); - public DcaeControllerClusterProvider controller; - ISiriusServer server; - - public DcaeControllerCluster(ISiriusServer server) { - this.server = server; - this.controller = new DcaeControllerClusterProvider(server,this); - } - - public void pushData(java.lang.String serverName, java.lang.String dataName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.START, duration_,serverName,dataName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerClusterOperationEnum.ControllerCluster_pushData,server,this); - ecomplogger.recordMetricEventStart(ControllerClusterOperationEnum.ControllerCluster_pushData,"self:" + ManagementServer.object2ref(this)); - try { - controller.pushData(serverName,dataName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.ERROR, duration_,serverName,dataName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerClusterMessageEnum.REQUEST_FAILED_pushData, e.toString()); - EcompException e1 = EcompException.create(ControllerClusterMessageEnum.REQUEST_FAILED_pushData,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerClusterMessageEnum.REQUEST_FAILED_pushData, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.OKAY, duration_,serverName,dataName); - - } - - public void receiveData(java.lang.String serverName, java.lang.String dataName, java.util.Date time, java.lang.String content) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.START, duration_,serverName,dataName,time,content); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerClusterOperationEnum.ControllerCluster_receiveData,server,this); - ecomplogger.recordMetricEventStart(ControllerClusterOperationEnum.ControllerCluster_receiveData,"self:" + ManagementServer.object2ref(this)); - try { - controller.receiveData(serverName,dataName,time,content); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.ERROR, duration_,serverName,dataName,time,content); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerClusterMessageEnum.REQUEST_FAILED_receiveData, e.toString()); - EcompException e1 = EcompException.create(ControllerClusterMessageEnum.REQUEST_FAILED_receiveData,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerClusterMessageEnum.REQUEST_FAILED_receiveData, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.OKAY, duration_,serverName,dataName,time,content); - - } - - - - - - - - - @Override - public void start() { - controller.start(); - } - - public static void ecoreSetup() { - DcaeControllerClusterProvider.ecoreSetup(); - } - public DcaeControllerClusterProvider getSiriusProvider() { - return controller; - } + public static final Logger logger = Logger.getLogger(DcaeControllerCluster.class); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); + public DcaeControllerClusterProvider controller; + ISiriusServer server; + + public DcaeControllerCluster(ISiriusServer server) { + this.server = server; + this.controller = new DcaeControllerClusterProvider(server, this); + } + + public void pushData(java.lang.String serverName, java.lang.String dataName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.START, duration_, serverName, dataName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerClusterOperationEnum.ControllerCluster_pushData, server, this); + ecomplogger.recordMetricEventStart(ControllerClusterOperationEnum.ControllerCluster_pushData, "self:" + ManagementServer.object2ref(this)); + try { + controller.pushData(serverName, dataName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.ERROR, duration_, serverName, dataName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerClusterMessageEnum.REQUEST_FAILED_pushData, e.toString()); + EcompException e1 = EcompException.create(ControllerClusterMessageEnum.REQUEST_FAILED_pushData, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerClusterMessageEnum.REQUEST_FAILED_pushData, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pushData", ApiRequestStatus.OKAY, duration_, serverName, dataName); + } + + } + + public void receiveData(java.lang.String serverName, java.lang.String dataName, java.util.Date time, java.lang.String content) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.START, duration_, serverName, dataName, time, content); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerClusterOperationEnum.ControllerCluster_receiveData, server, this); + ecomplogger.recordMetricEventStart(ControllerClusterOperationEnum.ControllerCluster_receiveData, "self:" + ManagementServer.object2ref(this)); + try { + controller.receiveData(serverName, dataName, time, content); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.ERROR, duration_, serverName, dataName, time, content); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerClusterMessageEnum.REQUEST_FAILED_receiveData, e.toString()); + EcompException e1 = EcompException.create(ControllerClusterMessageEnum.REQUEST_FAILED_receiveData, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerClusterMessageEnum.REQUEST_FAILED_receiveData, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "receiveData", ApiRequestStatus.OKAY, duration_, serverName, dataName, time, content); + } + + } + + @Override + public void start() { + controller.start(); + } + + public static void ecoreSetup() { + DcaeControllerClusterProvider.ecoreSetup(); + } + + @Override + public DcaeControllerClusterProvider getSiriusProvider() { + return controller; + } } diff --git a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerVirtualMachineService.java b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerVirtualMachineService.java index a44f9bd..d088a34 100644 --- a/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerVirtualMachineService.java +++ b/dcae-controller-core/dcae-controller-platform-server/src/main/sirius-gen/org/openecomp/dcae/controller/platform/servers/controller/DcaeControllerVirtualMachineService.java @@ -18,412 +18,410 @@ * limitations under the License. * ============LICENSE_END============================================ */ - + // Autogenerated // Do not edit. No need to extend this class. package org.openecomp.dcae.controller.platform.servers.controller; - - - - -import java.io.InputStream; - -import org.openecomp.ncomp.sirius.manager.IRequestHandler; -import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EObject; +import org.openecomp.dcae.controller.platform.controller.impl.ControllerVirtualMachineServiceImpl; +import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerVirtualMachineServiceMessageEnum; +import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerVirtualMachineServiceOperationEnum; +import org.openecomp.logger.EcompException; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.ncomp.component.ApiRequestStatus; 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.ISiriusServer; 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.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; -import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerVirtualMachineServiceOperationEnum; -import org.openecomp.dcae.controller.platform.servers.controller.logging.ControllerVirtualMachineServiceMessageEnum; - - - - -import org.openecomp.dcae.controller.platform.controller.impl.ControllerVirtualMachineServiceImpl; - - - public class DcaeControllerVirtualMachineService extends ControllerVirtualMachineServiceImpl implements ISiriusProvider, ISiriusPlugin { - public static final Logger logger = Logger.getLogger(DcaeControllerVirtualMachineService.class); - static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); - public DcaeControllerVirtualMachineServiceProvider controller; - ISiriusServer server; - - public DcaeControllerVirtualMachineService(ISiriusServer server) { - this.server = server; - this.controller = new DcaeControllerVirtualMachineServiceProvider(server,this); - } - - public void deploy(java.lang.String instanceName, java.lang.String containerPath) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.START, duration_,instanceName,containerPath); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_deploy,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_deploy,"self:" + ManagementServer.object2ref(this)); - try { - controller.deploy(instanceName,containerPath); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.ERROR, duration_,instanceName,containerPath); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.OKAY, duration_,instanceName,containerPath); - - } - - public void undeploy(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_undeploy,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_undeploy,"self:" + ManagementServer.object2ref(this)); - try { - controller.undeploy(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { - org.openecomp.dcae.controller.core.service.HealthTestResponse res = null; - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_test,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_test,"self:" + ManagementServer.object2ref(this)); - try { - res = controller.test(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "test", ApiRequestStatus.OKAY, duration_,instanceName); - return res; - } - - public void suspend(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_suspend,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_suspend,"self:" + ManagementServer.object2ref(this)); - try { - controller.suspend(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public void resume(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_resume,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_resume,"self:" + ManagementServer.object2ref(this)); - try { - controller.resume(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "resume", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public void pushManagerConfiguration(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pushManagerConfiguration,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pushManagerConfiguration,"self:" + ManagementServer.object2ref(this)); - try { - controller.pushManagerConfiguration(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public void pollManagerConfiguration(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pollManagerConfiguration,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pollManagerConfiguration,"self:" + ManagementServer.object2ref(this)); - try { - controller.pollManagerConfiguration(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { - org.eclipse.emf.ecore.EObject res = null; - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerConfiguration,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerConfiguration,"self:" + ManagementServer.object2ref(this)); - try { - res = controller.managerConfiguration(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.OKAY, duration_,instanceName); - return res; - } - - public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { - org.json.JSONObject res = null; - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.START, duration_,instanceName,operation,parameters); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerOperation,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerOperation,"self:" + ManagementServer.object2ref(this)); - try { - res = controller.managerOperation(instanceName,operation,parameters); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.ERROR, duration_,instanceName,operation,parameters); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.OKAY, duration_,instanceName,operation,parameters); - return res; - } - - public void updateConfigurationFromPolicy(java.lang.String instanceName) { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.START, duration_,instanceName); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateConfigurationFromPolicy,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateConfigurationFromPolicy,"self:" + ManagementServer.object2ref(this)); - try { - controller.updateConfigurationFromPolicy(instanceName); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.ERROR, duration_,instanceName); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.OKAY, duration_,instanceName); - - } - - public void runHealthTests() { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.START, duration_); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_runHealthTests,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_runHealthTests,"self:" + ManagementServer.object2ref(this)); - try { - controller.runHealthTests(); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.ERROR, duration_); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.OKAY, duration_); - - } - - public void updateDeploymentStatus() { - - long duration_ = 0; - if (server != null) - server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.START, duration_); - Date now_ = new Date(); - ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateDeploymentStatus,server,this); - ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateDeploymentStatus,"self:" + ManagementServer.object2ref(this)); - try { - controller.updateDeploymentStatus(); - } - catch (Exception e) { - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.ERROR, duration_); - System.err.println("ERROR: " + e); - ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.toString()); - EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus,e,e.getMessage()); - ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.getMessage()); - throw e1; - } - ecomplogger.recordMetricEventEnd(); - duration_ = new Date().getTime()-now_.getTime(); - if (server != null) - server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.OKAY, duration_); - - } - - - - - - - - - @Override - public void start() { - controller.start(); - } - - public static void ecoreSetup() { - DcaeControllerVirtualMachineServiceProvider.ecoreSetup(); - } - public DcaeControllerVirtualMachineServiceProvider getSiriusProvider() { - return controller; - } + public static final Logger logger = Logger.getLogger(DcaeControllerVirtualMachineService.class); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); + public DcaeControllerVirtualMachineServiceProvider controller; + ISiriusServer server; + + public DcaeControllerVirtualMachineService(ISiriusServer server) { + this.server = server; + this.controller = new DcaeControllerVirtualMachineServiceProvider(server, this); + } + + public void deploy(java.lang.String instanceName, java.lang.String containerPath) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.START, duration_, instanceName, containerPath); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_deploy, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_deploy, "self:" + ManagementServer.object2ref(this)); + try { + controller.deploy(instanceName, containerPath); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.ERROR, duration_, instanceName, containerPath); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_deploy, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.OKAY, duration_, instanceName, containerPath); + } + + } + + public void undeploy(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_undeploy, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_undeploy, "self:" + ManagementServer.object2ref(this)); + try { + controller.undeploy(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_undeploy, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { + org.openecomp.dcae.controller.core.service.HealthTestResponse res = null; + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_test, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_test, "self:" + ManagementServer.object2ref(this)); + try { + res = controller.test(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_test, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "test", ApiRequestStatus.OKAY, duration_, instanceName); + } + return res; + } + + public void suspend(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_suspend, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_suspend, "self:" + ManagementServer.object2ref(this)); + try { + controller.suspend(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public void resume(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_resume, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_resume, "self:" + ManagementServer.object2ref(this)); + try { + controller.resume(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_resume, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public void pushManagerConfiguration(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pushManagerConfiguration, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pushManagerConfiguration, "self:" + ManagementServer.object2ref(this)); + try { + controller.pushManagerConfiguration(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public void pollManagerConfiguration(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pollManagerConfiguration, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_pollManagerConfiguration, "self:" + ManagementServer.object2ref(this)); + try { + controller.pollManagerConfiguration(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { + org.eclipse.emf.ecore.EObject res = null; + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerConfiguration, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerConfiguration, "self:" + ManagementServer.object2ref(this)); + try { + res = controller.managerConfiguration(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.OKAY, duration_, instanceName); + } + return res; + } + + public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { + org.json.JSONObject res = null; + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.START, duration_, instanceName, operation, parameters); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerOperation, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_managerOperation, "self:" + ManagementServer.object2ref(this)); + try { + res = controller.managerOperation(instanceName, operation, parameters); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.ERROR, duration_, instanceName, operation, parameters); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_managerOperation, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.OKAY, duration_, instanceName, operation, parameters); + } + return res; + } + + public void updateConfigurationFromPolicy(java.lang.String instanceName) { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.START, duration_, instanceName); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateConfigurationFromPolicy, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateConfigurationFromPolicy, "self:" + ManagementServer.object2ref(this)); + try { + controller.updateConfigurationFromPolicy(instanceName); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.ERROR, duration_, instanceName); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.OKAY, duration_, instanceName); + } + + } + + public void runHealthTests() { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.START, duration_); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_runHealthTests, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_runHealthTests, "self:" + ManagementServer.object2ref(this)); + try { + controller.runHealthTests(); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.ERROR, duration_); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.OKAY, duration_); + } + + } + + public void updateDeploymentStatus() { + + long duration_ = 0; + if (server != null) { + server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.START, duration_); + } + Date now_ = new Date(); + ecomplogger.recordAuditEventStartIfNeeded(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateDeploymentStatus, server, this); + ecomplogger.recordMetricEventStart(ControllerVirtualMachineServiceOperationEnum.ControllerVirtualMachineService_updateDeploymentStatus, "self:" + ManagementServer.object2ref(this)); + try { + controller.updateDeploymentStatus(); + } catch (Exception e) { + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.ERROR, duration_); + } + System.err.println("ERROR: " + e); + ecomplogger.warn(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.toString()); + EcompException e1 = EcompException.create(ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e, e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, ControllerVirtualMachineServiceMessageEnum.REQUEST_FAILED_updateDeploymentStatus, e.getMessage()); + throw e1; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime() - now_.getTime(); + if (server != null) { + server.getServer().recordApi(null, this, "updateDeploymentStatus", ApiRequestStatus.OKAY, duration_); + } + + } + + + @Override + public void start() { + controller.start(); + } + + public static void ecoreSetup() { + DcaeControllerVirtualMachineServiceProvider.ecoreSetup(); + } + + @Override + public DcaeControllerVirtualMachineServiceProvider getSiriusProvider() { + return controller; + } } |