From a84b847a3409df445482674feffa2872a8cbae83 Mon Sep 17 00:00:00 2001 From: lj1412 Date: Tue, 14 Feb 2017 15:12:08 +0000 Subject: Init dcae.controller Change-Id: I460f09494faa84b55d9c5d54112e098b0e74d007 Signed-off-by: lj1412 --- .../src/main/sirius-gen/CommonDockerManager.yaml | 69 ++++ .../src/main/sirius-gen/CommonDockerService.yaml | 124 +++++++ .../src/main/sirius-gen/GuiClientApi.yaml | 69 ++++ .../servers/manager/DcaeCommonDockerManager.java | 226 +++++++++++++ .../manager/DcaeCommonDockerManagerClient.java | 174 ++++++++++ .../manager/DcaeCommonDockerManagerConsole.java | 127 ++++++++ .../DcaeCommonDockerManagerProviderTemplate.java | 63 ++++ .../manager/DcaeCommonDockerManagerServer.java | 112 +++++++ .../docker/servers/manager/DcaeManagerFactory.java | 54 ++++ .../servers/manager/gui/DcaeGuiClientApi.java | 256 +++++++++++++++ .../manager/gui/DcaeGuiClientApiClient.java | 175 ++++++++++ .../manager/gui/DcaeGuiClientApiConsole.java | 123 +++++++ .../gui/DcaeGuiClientApiProviderTemplate.java | 78 +++++ .../servers/manager/gui/DcaeModelFactory.java | 54 ++++ .../manager/gui/logging/GuiClientApi.properties | 78 +++++ .../gui/logging/GuiClientApiMessageEnum.java | 47 +++ .../gui/logging/GuiClientApiOperationEnum.java | 41 +++ .../manager/logging/CommonDockerManager.properties | 78 +++++ .../logging/CommonDockerManagerMessageEnum.java | 47 +++ .../logging/CommonDockerManagerOperationEnum.java | 41 +++ .../servers/service/DcaeCommonDockerService.java | 356 +++++++++++++++++++++ .../service/DcaeCommonDockerServiceClient.java | 259 +++++++++++++++ .../service/DcaeCommonDockerServiceConsole.java | 178 +++++++++++ .../DcaeCommonDockerServiceProviderTemplate.java | 65 ++++ .../service/DcaeCommonDockerServiceServer.java | 101 ++++++ .../docker/servers/service/DcaeServiceFactory.java | 54 ++++ .../service/logging/CommonDockerService.properties | 138 ++++++++ .../logging/CommonDockerServiceMessageEnum.java | 57 ++++ .../logging/CommonDockerServiceOperationEnum.java | 51 +++ 29 files changed, 3295 insertions(+) create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerManager.yaml create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerService.yaml create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/GuiClientApi.yaml create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManager.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerClient.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerConsole.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerProviderTemplate.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerServer.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeManagerFactory.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApi.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiClient.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiConsole.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiProviderTemplate.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeModelFactory.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApi.properties create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiMessageEnum.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiOperationEnum.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManager.properties create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerMessageEnum.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerOperationEnum.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerService.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceClient.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceConsole.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceProviderTemplate.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceServer.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeServiceFactory.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerService.properties create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceMessageEnum.java create mode 100644 dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceOperationEnum.java (limited to 'dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen') diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerManager.yaml b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerManager.yaml new file mode 100644 index 0000000..6ab6771 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerManager.yaml @@ -0,0 +1,69 @@ +operations: + test: {} + suspend: {} + resume: {} + publicKey: {} + configurationChanged: {} + updateStreams: {} + 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 +messages: + dummy: {} + test: + errorCode: test-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + suspend: + errorCode: suspend-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + resume: + errorCode: resume-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + publicKey: + errorCode: publicKey-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + configurationChanged: + errorCode: configurationChanged-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + updateStreams: + errorCode: updateStreams-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + REMOTE_test: + errorCode: REMOTE-test-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_suspend: + errorCode: REMOTE-suspend-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_resume: + errorCode: REMOTE-resume-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_publicKey: + errorCode: REMOTE-publicKey-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_configurationChanged: + errorCode: REMOTE-configurationChanged-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_updateStreams: + errorCode: REMOTE-updateStreams-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerService.yaml b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerService.yaml new file mode 100644 index 0000000..c449feb --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/CommonDockerService.yaml @@ -0,0 +1,124 @@ +operations: + deploy: {} + undeploy: {} + test: {} + suspend: {} + resume: {} + pushManagerConfiguration: {} + pollManagerConfiguration: {} + managerConfiguration: {} + managerOperation: {} + updateConfigurationFromPolicy: {} + runHealthTests: {} + 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 +messages: + dummy: {} + deploy: + errorCode: deploy-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + undeploy: + errorCode: undeploy-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + test: + errorCode: test-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + suspend: + errorCode: suspend-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + resume: + errorCode: resume-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + pushManagerConfiguration: + errorCode: pushManagerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + pollManagerConfiguration: + errorCode: pollManagerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + managerConfiguration: + errorCode: managerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + managerOperation: + errorCode: managerOperation-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + updateConfigurationFromPolicy: + errorCode: updateConfigurationFromPolicy-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + runHealthTests: + errorCode: runHealthTests-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + REMOTE_deploy: + errorCode: REMOTE-deploy-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_undeploy: + errorCode: REMOTE-undeploy-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_test: + errorCode: REMOTE-test-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_suspend: + errorCode: REMOTE-suspend-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_resume: + errorCode: REMOTE-resume-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_pushManagerConfiguration: + errorCode: REMOTE-pushManagerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_pollManagerConfiguration: + errorCode: REMOTE-pollManagerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_managerConfiguration: + errorCode: REMOTE-managerConfiguration-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_managerOperation: + errorCode: REMOTE-managerOperation-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_updateConfigurationFromPolicy: + errorCode: REMOTE-updateConfigurationFromPolicy-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_runHealthTests: + errorCode: REMOTE-runHealthTests-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/GuiClientApi.yaml b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/GuiClientApi.yaml new file mode 100644 index 0000000..bf3d69d --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/GuiClientApi.yaml @@ -0,0 +1,69 @@ +operations: + getTree: {} + getObject: {} + getTimeSerie: {} + getTable: {} + getHtml: {} + getGraph: {} + REMOTE_getTree: + decription: Remote call getTree + REMOTE_getObject: + decription: Remote call getObject + REMOTE_getTimeSerie: + decription: Remote call getTimeSerie + REMOTE_getTable: + decription: Remote call getTable + REMOTE_getHtml: + decription: Remote call getHtml + REMOTE_getGraph: + decription: Remote call getGraph +messages: + dummy: {} + getTree: + errorCode: getTree-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + getObject: + errorCode: getObject-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + getTimeSerie: + errorCode: getTimeSerie-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + getTable: + errorCode: getTable-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + getHtml: + errorCode: getHtml-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + getGraph: + errorCode: getGraph-FAILED-5001W + messageFormat: '{0}' + description: Operation Failed with Exception + REMOTE_getTree: + errorCode: REMOTE-getTree-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_getObject: + errorCode: REMOTE-getObject-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_getTimeSerie: + errorCode: REMOTE-getTimeSerie-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_getTable: + errorCode: REMOTE-getTable-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_getHtml: + errorCode: REMOTE-getHtml-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception + REMOTE_getGraph: + errorCode: REMOTE-getGraph-FAILED-5001W + messageFormat: '{0}' + description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManager.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManager.java new file mode 100644 index 0000000..06abb03 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManager.java @@ -0,0 +1,226 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager; + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +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.eclipse.emf.common.util.EList; +import org.json.JSONObject; + +import java.util.Date; + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.logging.CommonDockerManagerOperationEnum; + + + + +import org.openecomp.dcae.controller.service.common.docker.manager.impl.CommonDockerManagerImpl; + + + +public class DcaeCommonDockerManager extends CommonDockerManagerImpl { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerManager.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public DcaeCommonDockerManagerProvider controller; + ISiriusServer server; + + public DcaeCommonDockerManager(ISiriusServer server) { + this.server = server; + this.controller = new DcaeCommonDockerManagerProvider(server,this); + } + + public org.openecomp.dcae.controller.core.service.HealthTestResponse test() { + org.openecomp.dcae.controller.core.service.HealthTestResponse res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.test); + try { + res = controller.test(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "test", ApiRequestStatus.OKAY, duration_); + return res; + } + + public void suspend() { + + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.suspend); + try { + controller.suspend(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.OKAY, duration_); + + } + + public void resume() { + + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.resume); + try { + controller.resume(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "resume", ApiRequestStatus.OKAY, duration_); + + } + + public java.lang.String publicKey() { + java.lang.String res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.publicKey); + try { + res = controller.publicKey(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.OKAY, duration_); + return res; + } + + public void configurationChanged() { + + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.configurationChanged); + try { + controller.configurationChanged(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.OKAY, duration_); + + } + + public void updateStreams(EList inputStreams, EList outputStreams) { + + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.START, duration_,inputStreams,outputStreams); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.updateStreams); + try { + controller.updateStreams(inputStreams,outputStreams); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.ERROR, duration_,inputStreams,outputStreams); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.OKAY, duration_,inputStreams,outputStreams); + + } + + + + + + + public static void ecoreSetup() { + DcaeCommonDockerManagerProvider.ecoreSetup(); + } + public DcaeCommonDockerManagerProvider getSomfProvider() { + return controller; + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerClient.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerClient.java new file mode 100644 index 0000000..669bad8 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerClient.java @@ -0,0 +1,174 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager; + +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.HighAvailabilityClient; +import org.openecomp.ncomp.sirius.manager.GenericHttpClient; + +import org.apache.log4j.Logger; + +import org.openecomp.logger.EcompLogger; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; + +import org.openecomp.dcae.controller.service.common.docker.manager.impl.CommonDockerManagerImpl; +import org.openecomp.dcae.controller.service.common.docker.manager.ManagerPackage; +import org.openecomp.dcae.controller.service.common.docker.servers.manager.logging.CommonDockerManagerOperationEnum; +import org.openecomp.dcae.controller.service.common.docker.servers.manager.logging.CommonDockerManagerMessageEnum; + + + + + + +@SuppressWarnings("unchecked") +public class DcaeCommonDockerManagerClient extends CommonDockerManagerImpl { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerManagerClient.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public AbstractClient client; + + public DcaeCommonDockerManagerClient(String file, String name) { + DcaeCommonDockerManager.ecoreSetup(); + client = new GenericHttpClient(file,name); + client.add("/resources", this); + } + + public DcaeCommonDockerManagerClient(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); + } + + public DcaeCommonDockerManagerClient(AbstractClient c) { + client = c; + client.add("/resources", this); + } + + + + @Override + public org.openecomp.dcae.controller.core.service.HealthTestResponse test() { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_test); + 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(CommonDockerManagerMessageEnum.REMOTE_test, e.toString()); + throw new RuntimeException("remote call failed: test", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public void suspend() { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_suspend); + + try { + client.operationPath("/resources", c, "suspend", null); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerManagerMessageEnum.REMOTE_suspend, e.toString()); + throw new RuntimeException("remote call failed: suspend", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void resume() { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_resume); + + try { + client.operationPath("/resources", c, "resume", null); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerManagerMessageEnum.REMOTE_resume, e.toString()); + throw new RuntimeException("remote call failed: resume", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public java.lang.String publicKey() { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_publicKey); + java.lang.String res; + try { + res = (java.lang.String) client.operationPath("/resources", c, "publicKey", null); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerManagerMessageEnum.REMOTE_publicKey, e.toString()); + throw new RuntimeException("remote call failed: publicKey", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public void configurationChanged() { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_configurationChanged); + + try { + client.operationPath("/resources", c, "configurationChanged", null); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerManagerMessageEnum.REMOTE_configurationChanged, e.toString()); + throw new RuntimeException("remote call failed: configurationChanged", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void updateStreams(EList inputStreams, EList outputStreams) { + EClass c = ManagerPackage.eINSTANCE.getCommonDockerManager(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerManagerOperationEnum.REMOTE_updateStreams); + + try { + client.operationPath("/resources", c, "updateStreams", null, inputStreams,outputStreams); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerManagerMessageEnum.REMOTE_updateStreams, e.toString()); + throw new RuntimeException("remote call failed: updateStreams", e); + } + ecomplogger.recordMetricEventEnd(); + + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerConsole.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerConsole.java new file mode 100644 index 0000000..8d27657 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerConsole.java @@ -0,0 +1,127 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit but extend this class as needed +package org.openecomp.dcae.controller.service.common.docker.servers.manager; + + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; + +import org.openecomp.ncomp.sirius.manager.console.Console; +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.ManagementServerError; + + + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.DcaeGuiClientApiConsole; + + +public class DcaeCommonDockerManagerConsole extends Console { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerManagerConsole.class); + protected DcaeCommonDockerManagerClient controller; + + + DcaeGuiClientApiConsole gui; + + + public DcaeCommonDockerManagerConsole(String filename, String name) { + super(filename, name); + controller = new DcaeCommonDockerManagerClient(filename,name); + client = controller.client; + + gui = new DcaeGuiClientApiConsole(filename,name); + } + + public DcaeCommonDockerManagerConsole(AbstractClient c) { + controller = new DcaeCommonDockerManagerClient(c); + client = controller.client; + } + + + public org.openecomp.dcae.controller.core.service.HealthTestResponse test() { + org.openecomp.dcae.controller.core.service.HealthTestResponse res = null; + try { + res = controller.test(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public void suspend() { + + try { + controller.suspend(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void resume() { + + try { + controller.resume(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public java.lang.String publicKey() { + java.lang.String res = null; + try { + res = controller.publicKey(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public void configurationChanged() { + + try { + controller.configurationChanged(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void updateStreams(EList inputStreams, EList outputStreams) { + + try { + controller.updateStreams(inputStreams,outputStreams); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerProviderTemplate.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerProviderTemplate.java new file mode 100644 index 0000000..fd23969 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerProviderTemplate.java @@ -0,0 +1,63 @@ + +/*- + * ============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.common.docker.servers.manager; + + + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.function.FunctionUtils; + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; +import org.json.JSONObject; + + + +import org.openecomp.dcae.controller.service.servers.dockermanager.DcaeDockerManagerProvider; + + +import org.openecomp.dcae.controller.service.common.docker.manager.impl.CommonDockerManagerImpl; +import org.openecomp.dcae.controller.service.common.docker.manager.CommonDockerManager; + + +public class DcaeCommonDockerManagerProviderTemplate extends DcaeDockerManagerProvider { + private static final Logger logger = Logger.getLogger(DcaeCommonDockerManagerProviderTemplate.class); + CommonDockerManager o; + + public DcaeCommonDockerManagerProviderTemplate(ISiriusServer controller, CommonDockerManager o) { + super(controller, o); + this.o = o; + } + + + + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerServer.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerServer.java new file mode 100644 index 0000000..1bbc232 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeCommonDockerManagerServer.java @@ -0,0 +1,112 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit but extend this class as needed +package org.openecomp.dcae.controller.service.common.docker.servers.manager; + +import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; + +import java.io.IOException; +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.openecomp.ncomp.sirius.manager.Jetty8Server; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; + +import org.openecomp.dcae.controller.service.common.docker.manager.CommonDockerManager; + + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.DcaeModelFactory; + + + + + +public class DcaeCommonDockerManagerServer implements ISiriusServer { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerManagerServer.class); + String serverPath; + ManagementServer server; + DcaeCommonDockerManager controller; + String directory = "data"; +// LocationControllerApi api ; + Jetty8Server webServer; + DcaeManagerFactory f = new DcaeManagerFactory(this); + + + String guiPath; + ManagementServer guiServer; + + + public DcaeCommonDockerManagerServer(String filename) throws IOException { + logger.warn("controller restarting"); + DcaeCommonDockerManager.ecoreSetup(); + props = getPropertiesFromClasspath(filename); + serverPath = (String) props.get("server.dir"); + server = new ManagementServer(f, "CommonDockerManager", serverPath, filename); + server.addFactory(f); + + server.addFactory(org.openecomp.dcae.controller.service.common.docker.service.ServiceFactory.eINSTANCE); + + + server.addRuntimeFactories(this); + server.start(); + } + public void runWebserver() throws IOException { + controller = (DcaeCommonDockerManager) server.find("/").o; + webServer = new Jetty8Server("manager.properties"); + webServer.add("/resources",server); + + + + EFactory guiFactory = new DcaeModelFactory(this); + guiPath = serverPath + "/gui"; + guiServer = new ManagementServer(guiFactory, "GuiClientApi", guiPath, "gui.properties"); + guiServer.start(); + webServer.add("/gui",guiServer); + + + + logger.info("Joining webserver"); + webServer.join(); + } + static Properties props = null; + public static void main(String []args) throws IOException { + // ALWAYS USE GMT. + TimeZone.setDefault(TimeZone.getTimeZone("GMT")); + + DcaeCommonDockerManagerServer s = new DcaeCommonDockerManagerServer("manager.properties"); + s.runWebserver(); + } + public CommonDockerManager getController() { + return controller; + } + public ManagementServer getServer() { + return server; + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeManagerFactory.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeManagerFactory.java new file mode 100644 index 0000000..37f3e3b --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/DcaeManagerFactory.java @@ -0,0 +1,54 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager; + +import org.eclipse.emf.ecore.EPackage; +import org.apache.log4j.Logger; + +import org.openecomp.ncomp.sirius.manager.ISiriusServer; + +import org.openecomp.dcae.controller.service.common.docker.manager.CommonDockerManager; +import org.openecomp.dcae.controller.service.common.docker.manager.ManagerPackage; +import org.openecomp.dcae.controller.service.common.docker.manager.impl.ManagerFactoryImpl; + + + + + +public class DcaeManagerFactory extends ManagerFactoryImpl { + public static final Logger logger = Logger.getLogger(DcaeManagerFactory.class); + ISiriusServer server = null; + @Override + public EPackage getEPackage() { return ManagerPackage.eINSTANCE; } + public DcaeManagerFactory(ISiriusServer server) { + this.server = server; + } + @Override + public CommonDockerManager createCommonDockerManager() { + return new DcaeCommonDockerManager(server); + } + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApi.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApi.java new file mode 100644 index 0000000..0573e74 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApi.java @@ -0,0 +1,256 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager.gui; + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +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.eclipse.emf.common.util.EList; +import org.json.JSONObject; + +import java.util.Date; + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.logging.GuiClientApiOperationEnum; + + + + + + + +import org.openecomp.ncomp.sirius.gui.tools.*; + + + + + +import org.openecomp.ncomp.gwt.siriusportal.model.*; + + + + + +import org.openecomp.ncomp.sirius.manager.Subject; + + + + + +import org.openecomp.ncomp.sirius.manager.ManagementServer; + + + + + +import org.openecomp.ncomp.sirius.manager.server.AbstractManagementServer; + + +import org.openecomp.ncomp.gwt.siriusportal.model.impl.GuiClientApiImpl; + + + +public class DcaeGuiClientApi extends GuiClientApiImpl { + public static final Logger logger = Logger.getLogger(DcaeGuiClientApi.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public DcaeGuiClientApiProvider controller; + ISiriusServer server; + + public DcaeGuiClientApi(ISiriusServer server) { + this.server = server; + this.controller = new DcaeGuiClientApiProvider(server,this); + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTree getTree() { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTree res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.START, duration_); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getTree); + try { + res = controller.getTree(); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.ERROR, duration_); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.OKAY, duration_); + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiObject getObject(java.lang.String path) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiObject res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.START, duration_,path); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getObject); + try { + res = controller.getObject(path); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.ERROR, duration_,path); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.OKAY, duration_,path); + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie getTimeSerie(java.lang.String path, java.lang.String start, java.lang.String end, java.lang.String duration) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.START, duration_,path,start,end,duration); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getTimeSerie); + try { + res = controller.getTimeSerie(path,start,end,duration); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.ERROR, duration_,path,start,end,duration); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.OKAY, duration_,path,start,end,duration); + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTable getTable(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTable res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.START, duration_,path,start,end); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getTable); + try { + res = controller.getTable(path,start,end); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.ERROR, duration_,path,start,end); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.OKAY, duration_,path,start,end); + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml getHtml(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.START, duration_,path,start,end); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getHtml); + try { + res = controller.getHtml(path,start,end); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.ERROR, duration_,path,start,end); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.OKAY, duration_,path,start,end); + return res; + } + + public org.openecomp.ncomp.sirius.manager.graph.GuiGraph getGraph(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.sirius.manager.graph.GuiGraph res = null; + long duration_ = 0; + if (server != null) + server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.START, duration_,path,start,end); + Date now_ = new Date(); + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.getGraph); + try { + res = controller.getGraph(path,start,end); + } + catch (Exception e) { + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.ERROR, duration_,path,start,end); + System.err.println("ERROR: " + e); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.OKAY, duration_,path,start,end); + return res; + } + + + + + + + public static void ecoreSetup() { + DcaeGuiClientApiProvider.ecoreSetup(); + } + public DcaeGuiClientApiProvider getSomfProvider() { + return controller; + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiClient.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiClient.java new file mode 100644 index 0000000..3d09fd0 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiClient.java @@ -0,0 +1,175 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager.gui; + +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.HighAvailabilityClient; +import org.openecomp.ncomp.sirius.manager.GenericHttpClient; + +import org.apache.log4j.Logger; + +import org.openecomp.logger.EcompLogger; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; + +import org.openecomp.ncomp.gwt.siriusportal.model.impl.GuiClientApiImpl; +import org.openecomp.ncomp.gwt.siriusportal.model.ModelPackage; +import org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.logging.GuiClientApiOperationEnum; +import org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.logging.GuiClientApiMessageEnum; + + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.DcaeCommonDockerManager; + + + + +@SuppressWarnings("unchecked") +public class DcaeGuiClientApiClient extends GuiClientApiImpl { + public static final Logger logger = Logger.getLogger(DcaeGuiClientApiClient.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public AbstractClient client; + + public DcaeGuiClientApiClient(String file, String name) { + DcaeCommonDockerManager.ecoreSetup(); + client = new GenericHttpClient(file,name); + client.add("/gui", this); + } + + public DcaeGuiClientApiClient(String file, String name1, String name2) { + HighAvailabilityClient client1 = new HighAvailabilityClient(file,name1,name2); + client = client1.all; // requests should be forwarded to all. + client.add("/gui", this); + } + + public DcaeGuiClientApiClient(AbstractClient c) { + client = c; + client.add("/resources", this); + } + + + + @Override + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTree getTree() { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getTree); + org.openecomp.ncomp.gwt.siriusportal.model.GuiTree res; + try { + res = (org.openecomp.ncomp.gwt.siriusportal.model.GuiTree) client.operationPath("/gui", c, "getTree", null); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getTree, e.toString()); + throw new RuntimeException("remote call failed: getTree", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.openecomp.ncomp.gwt.siriusportal.model.GuiObject getObject(java.lang.String path) { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getObject); + org.openecomp.ncomp.gwt.siriusportal.model.GuiObject res; + try { + res = (org.openecomp.ncomp.gwt.siriusportal.model.GuiObject) client.operationPath("/gui", c, "getObject", null, path); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getObject, e.toString()); + throw new RuntimeException("remote call failed: getObject", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie getTimeSerie(java.lang.String path, java.lang.String start, java.lang.String end, java.lang.String duration) { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getTimeSerie); + org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie res; + try { + res = (org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie) client.operationPath("/gui", c, "getTimeSerie", null, path,start,end,duration); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getTimeSerie, e.toString()); + throw new RuntimeException("remote call failed: getTimeSerie", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTable getTable(java.lang.String path, java.lang.String start, java.lang.String end) { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getTable); + org.openecomp.ncomp.gwt.siriusportal.model.GuiTable res; + try { + res = (org.openecomp.ncomp.gwt.siriusportal.model.GuiTable) client.operationPath("/gui", c, "getTable", null, path,start,end); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getTable, e.toString()); + throw new RuntimeException("remote call failed: getTable", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml getHtml(java.lang.String path, java.lang.String start, java.lang.String end) { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getHtml); + org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml res; + try { + res = (org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml) client.operationPath("/gui", c, "getHtml", null, path,start,end); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getHtml, e.toString()); + throw new RuntimeException("remote call failed: getHtml", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.openecomp.ncomp.sirius.manager.graph.GuiGraph getGraph(java.lang.String path, java.lang.String start, java.lang.String end) { + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getGraph); + org.openecomp.ncomp.sirius.manager.graph.GuiGraph res; + try { + res = (org.openecomp.ncomp.sirius.manager.graph.GuiGraph) client.operationPath("/gui", c, "getGraph", null, path,start,end); + } + catch (Exception e) { + ecomplogger.warn(GuiClientApiMessageEnum.REMOTE_getGraph, e.toString()); + throw new RuntimeException("remote call failed: getGraph", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiConsole.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiConsole.java new file mode 100644 index 0000000..30d1e77 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiConsole.java @@ -0,0 +1,123 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit but extend this class as needed +package org.openecomp.dcae.controller.service.common.docker.servers.manager.gui; + + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; + +import org.openecomp.ncomp.sirius.manager.console.Console; +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.ManagementServerError; + + + + +public class DcaeGuiClientApiConsole extends Console { + public static final Logger logger = Logger.getLogger(DcaeGuiClientApiConsole.class); + protected DcaeGuiClientApiClient controller; + + + + + public DcaeGuiClientApiConsole(String filename, String name) { + super(filename, name); + controller = new DcaeGuiClientApiClient(filename,name); + client = controller.client; + + } + + public DcaeGuiClientApiConsole(AbstractClient c) { + controller = new DcaeGuiClientApiClient(c); + client = controller.client; + } + + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTree getTree() { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTree res = null; + try { + res = controller.getTree(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiObject getObject(java.lang.String path) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiObject res = null; + try { + res = controller.getObject(path); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie getTimeSerie(java.lang.String path, java.lang.String start, java.lang.String end, java.lang.String duration) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie res = null; + try { + res = controller.getTimeSerie(path,start,end,duration); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiTable getTable(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiTable res = null; + try { + res = controller.getTable(path,start,end); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml getHtml(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml res = null; + try { + res = controller.getHtml(path,start,end); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.openecomp.ncomp.sirius.manager.graph.GuiGraph getGraph(java.lang.String path, java.lang.String start, java.lang.String end) { + org.openecomp.ncomp.sirius.manager.graph.GuiGraph res = null; + try { + res = controller.getGraph(path,start,end); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiProviderTemplate.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiProviderTemplate.java new file mode 100644 index 0000000..94c1dbd --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeGuiClientApiProviderTemplate.java @@ -0,0 +1,78 @@ + +/*- + * ============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.common.docker.servers.manager.gui; + + + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.function.FunctionUtils; + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; +import org.json.JSONObject; + + + +import org.openecomp.ncomp.sirius.gui.tools.*; + + +import org.openecomp.ncomp.gwt.siriusportal.model.*; + + +import org.openecomp.ncomp.sirius.manager.Subject; + + +import org.openecomp.ncomp.sirius.manager.ManagementServer; + + +import org.openecomp.ncomp.sirius.manager.server.AbstractManagementServer; + + +import org.openecomp.ncomp.sirius.manager.BasicGuiClientApiProvider; + + +import org.openecomp.ncomp.gwt.siriusportal.model.impl.GuiClientApiImpl; +import org.openecomp.ncomp.gwt.siriusportal.model.GuiClientApi; + + +public class DcaeGuiClientApiProviderTemplate extends BasicGuiClientApiProvider { + private static final Logger logger = Logger.getLogger(DcaeGuiClientApiProviderTemplate.class); + GuiClientApi o; + + public DcaeGuiClientApiProviderTemplate(ISiriusServer controller, GuiClientApi o) { + super(controller, o); + this.o = o; + } + + + + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeModelFactory.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeModelFactory.java new file mode 100644 index 0000000..c7986e7 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/DcaeModelFactory.java @@ -0,0 +1,54 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.manager.gui; + +import org.eclipse.emf.ecore.EPackage; +import org.apache.log4j.Logger; + +import org.openecomp.ncomp.sirius.manager.ISiriusServer; + +import org.openecomp.ncomp.gwt.siriusportal.model.GuiClientApi; +import org.openecomp.ncomp.gwt.siriusportal.model.ModelPackage; +import org.openecomp.ncomp.gwt.siriusportal.model.impl.ModelFactoryImpl; + +import org.openecomp.dcae.controller.service.common.docker.servers.manager.DcaeCommonDockerManagerServer; + + + +public class DcaeModelFactory extends ModelFactoryImpl { + public static final Logger logger = Logger.getLogger(DcaeModelFactory.class); + ISiriusServer server = null; + @Override + public EPackage getEPackage() { return ModelPackage.eINSTANCE; } + public DcaeModelFactory(ISiriusServer server) { + this.server = server; + } + @Override + public GuiClientApi createGuiClientApi() { + return new DcaeGuiClientApi(server); + } + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApi.properties b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApi.properties new file mode 100644 index 0000000..8705ab8 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApi.properties @@ -0,0 +1,78 @@ + +dummy=\ + null|\ + null|\ + null|\ + null + +getTree=\ + getTree-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +getObject=\ + getObject-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +getTimeSerie=\ + getTimeSerie-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +getTable=\ + getTable-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +getHtml=\ + getHtml-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +getGraph=\ + getGraph-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +REMOTE_getTree=\ + REMOTE-getTree-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_getObject=\ + REMOTE-getObject-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_getTimeSerie=\ + REMOTE-getTimeSerie-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_getTable=\ + REMOTE-getTable-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_getHtml=\ + REMOTE-getHtml-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_getGraph=\ + REMOTE-getGraph-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiMessageEnum.java new file mode 100644 index 0000000..2e524ab --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiMessageEnum.java @@ -0,0 +1,47 @@ + +/*- + * ============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.common.docker.servers.manager.gui.logging; + +import com.att.eelf.i18n.EELFResourceManager; +import org.openecomp.logger.EcompMessageEnum; + +public enum GuiClientApiMessageEnum implements EcompMessageEnum { + + dummy, + getTree, + getObject, + getTimeSerie, + getTable, + getHtml, + getGraph, + REMOTE_getTree, + REMOTE_getObject, + REMOTE_getTimeSerie, + REMOTE_getTable, + REMOTE_getHtml, + REMOTE_getGraph; + + static { + EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.common.docker.servers.manager.gui.logging.GuiClientApi"); + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiOperationEnum.java new file mode 100644 index 0000000..45c9703 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/gui/logging/GuiClientApiOperationEnum.java @@ -0,0 +1,41 @@ + +/*- + * ============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.common.docker.servers.manager.gui.logging; + +import org.openecomp.entity.EcompOperationEnum; + +public enum GuiClientApiOperationEnum implements EcompOperationEnum { + + getTree, + getObject, + getTimeSerie, + getTable, + getHtml, + getGraph, + REMOTE_getTree, + REMOTE_getObject, + REMOTE_getTimeSerie, + REMOTE_getTable, + REMOTE_getHtml, + REMOTE_getGraph; +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManager.properties b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManager.properties new file mode 100644 index 0000000..ef19f9b --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManager.properties @@ -0,0 +1,78 @@ + +dummy=\ + null|\ + null|\ + null|\ + null + +test=\ + test-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +suspend=\ + suspend-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +resume=\ + resume-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +publicKey=\ + publicKey-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +configurationChanged=\ + configurationChanged-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +updateStreams=\ + updateStreams-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +REMOTE_test=\ + REMOTE-test-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_suspend=\ + REMOTE-suspend-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_resume=\ + REMOTE-resume-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_publicKey=\ + REMOTE-publicKey-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_configurationChanged=\ + REMOTE-configurationChanged-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_updateStreams=\ + REMOTE-updateStreams-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerMessageEnum.java new file mode 100644 index 0000000..4ae696f --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerMessageEnum.java @@ -0,0 +1,47 @@ + +/*- + * ============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.common.docker.servers.manager.logging; + +import com.att.eelf.i18n.EELFResourceManager; +import org.openecomp.logger.EcompMessageEnum; + +public enum CommonDockerManagerMessageEnum implements EcompMessageEnum { + + dummy, + test, + suspend, + resume, + publicKey, + configurationChanged, + updateStreams, + REMOTE_test, + REMOTE_suspend, + REMOTE_resume, + REMOTE_publicKey, + REMOTE_configurationChanged, + REMOTE_updateStreams; + + static { + EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.common.docker.servers.manager.logging.CommonDockerManager"); + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerOperationEnum.java new file mode 100644 index 0000000..30478f6 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/manager/logging/CommonDockerManagerOperationEnum.java @@ -0,0 +1,41 @@ + +/*- + * ============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.common.docker.servers.manager.logging; + +import org.openecomp.entity.EcompOperationEnum; + +public enum CommonDockerManagerOperationEnum implements EcompOperationEnum { + + test, + suspend, + resume, + publicKey, + configurationChanged, + updateStreams, + REMOTE_test, + REMOTE_suspend, + REMOTE_resume, + REMOTE_publicKey, + REMOTE_configurationChanged, + REMOTE_updateStreams; +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerService.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerService.java new file mode 100644 index 0000000..6b6f7bc --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerService.java @@ -0,0 +1,356 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.service; + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +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.eclipse.emf.common.util.EList; +import org.json.JSONObject; + +import java.util.Date; + +import org.openecomp.dcae.controller.service.common.docker.servers.service.logging.CommonDockerServiceOperationEnum; + + + + +import org.openecomp.dcae.controller.service.common.docker.service.impl.CommonDockerServiceImpl; + + + +public class DcaeCommonDockerService extends CommonDockerServiceImpl implements ISiriusPlugin { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerService.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public DcaeCommonDockerServiceProvider controller; + ISiriusServer server; + + public DcaeCommonDockerService(ISiriusServer server) { + this.server = server; + this.controller = new DcaeCommonDockerServiceProvider(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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.deploy); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.undeploy); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.test); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.suspend); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.resume); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.pushManagerConfiguration); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.pollManagerConfiguration); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.managerConfiguration); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.managerOperation); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.updateConfigurationFromPolicy); + 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); + throw e; + } + 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.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.runHealthTests); + 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); + throw e; + } + ecomplogger.recordMetricEventEnd(); + duration_ = new Date().getTime()-now_.getTime(); + if (server != null) + server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.OKAY, duration_); + + } + + + + + + + @Override + public void start() { + controller.start(); + } + + public static void ecoreSetup() { + DcaeCommonDockerServiceProvider.ecoreSetup(); + } + public DcaeCommonDockerServiceProvider getSomfProvider() { + return controller; + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceClient.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceClient.java new file mode 100644 index 0000000..876ed4f --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceClient.java @@ -0,0 +1,259 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.service; + +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.HighAvailabilityClient; +import org.openecomp.ncomp.sirius.manager.GenericHttpClient; + +import org.apache.log4j.Logger; + +import org.openecomp.logger.EcompLogger; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; + +import org.openecomp.dcae.controller.service.common.docker.service.impl.CommonDockerServiceImpl; +import org.openecomp.dcae.controller.service.common.docker.service.ServicePackage; +import org.openecomp.dcae.controller.service.common.docker.servers.service.logging.CommonDockerServiceOperationEnum; +import org.openecomp.dcae.controller.service.common.docker.servers.service.logging.CommonDockerServiceMessageEnum; + + + + + + +@SuppressWarnings("unchecked") +public class DcaeCommonDockerServiceClient extends CommonDockerServiceImpl { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerServiceClient.class); + static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + public AbstractClient client; + + public DcaeCommonDockerServiceClient(String file, String name) { + DcaeCommonDockerService.ecoreSetup(); + client = new GenericHttpClient(file,name); + client.add("/resources", this); + } + + public DcaeCommonDockerServiceClient(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); + } + + public DcaeCommonDockerServiceClient(AbstractClient c) { + client = c; + client.add("/resources", this); + } + + + + @Override + public void deploy(java.lang.String instanceName, java.lang.String containerPath) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_deploy); + + try { + client.operationPath("/resources", c, "deploy", null, instanceName,containerPath); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_deploy, e.toString()); + throw new RuntimeException("remote call failed: deploy", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void undeploy(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_undeploy); + + try { + client.operationPath("/resources", c, "undeploy", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_undeploy, e.toString()); + throw new RuntimeException("remote call failed: undeploy", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_test); + 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(CommonDockerServiceMessageEnum.REMOTE_test, e.toString()); + throw new RuntimeException("remote call failed: test", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public void suspend(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_suspend); + + try { + client.operationPath("/resources", c, "suspend", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_suspend, e.toString()); + throw new RuntimeException("remote call failed: suspend", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void resume(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_resume); + + try { + client.operationPath("/resources", c, "resume", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_resume, e.toString()); + throw new RuntimeException("remote call failed: resume", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void pushManagerConfiguration(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_pushManagerConfiguration); + + try { + client.operationPath("/resources", c, "pushManagerConfiguration", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_pushManagerConfiguration, e.toString()); + throw new RuntimeException("remote call failed: pushManagerConfiguration", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void pollManagerConfiguration(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_pollManagerConfiguration); + + try { + client.operationPath("/resources", c, "pollManagerConfiguration", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_pollManagerConfiguration, e.toString()); + throw new RuntimeException("remote call failed: pollManagerConfiguration", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_managerConfiguration); + 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(CommonDockerServiceMessageEnum.REMOTE_managerConfiguration, e.toString()); + throw new RuntimeException("remote call failed: managerConfiguration", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_managerOperation); + org.json.JSONObject res; + try { + res = (org.json.JSONObject) client.operationPath("/resources", c, "managerOperation", null, instanceName,operation,parameters); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_managerOperation, e.toString()); + throw new RuntimeException("remote call failed: managerOperation", e); + } + ecomplogger.recordMetricEventEnd(); + return res; + } + + @Override + public void updateConfigurationFromPolicy(java.lang.String instanceName) { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_updateConfigurationFromPolicy); + + try { + client.operationPath("/resources", c, "updateConfigurationFromPolicy", null, instanceName); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_updateConfigurationFromPolicy, e.toString()); + throw new RuntimeException("remote call failed: updateConfigurationFromPolicy", e); + } + ecomplogger.recordMetricEventEnd(); + + } + + @Override + public void runHealthTests() { + EClass c = ServicePackage.eINSTANCE.getCommonDockerService(); //foo + ecomplogger.recordMetricEventStart(); + ecomplogger.setOperation(CommonDockerServiceOperationEnum.REMOTE_runHealthTests); + + try { + client.operationPath("/resources", c, "runHealthTests", null); + } + catch (Exception e) { + ecomplogger.warn(CommonDockerServiceMessageEnum.REMOTE_runHealthTests, e.toString()); + throw new RuntimeException("remote call failed: runHealthTests", e); + } + ecomplogger.recordMetricEventEnd(); + + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceConsole.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceConsole.java new file mode 100644 index 0000000..11ed107 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceConsole.java @@ -0,0 +1,178 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit but extend this class as needed +package org.openecomp.dcae.controller.service.common.docker.servers.service; + + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; + +import org.openecomp.ncomp.sirius.manager.console.Console; +import org.openecomp.ncomp.sirius.manager.AbstractClient; +import org.openecomp.ncomp.sirius.manager.ManagementServerError; + + + + +public class DcaeCommonDockerServiceConsole extends Console { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerServiceConsole.class); + protected DcaeCommonDockerServiceClient controller; + + + + + public DcaeCommonDockerServiceConsole(String filename, String name) { + super(filename, name); + controller = new DcaeCommonDockerServiceClient(filename,name); + client = controller.client; + + } + + public DcaeCommonDockerServiceConsole(AbstractClient c) { + controller = new DcaeCommonDockerServiceClient(c); + client = controller.client; + } + + + public void deploy(java.lang.String instanceName, java.lang.String containerPath) { + + try { + controller.deploy(instanceName,containerPath); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void undeploy(java.lang.String instanceName) { + + try { + controller.undeploy(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { + org.openecomp.dcae.controller.core.service.HealthTestResponse res = null; + try { + res = controller.test(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public void suspend(java.lang.String instanceName) { + + try { + controller.suspend(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void resume(java.lang.String instanceName) { + + try { + controller.resume(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void pushManagerConfiguration(java.lang.String instanceName) { + + try { + controller.pushManagerConfiguration(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void pollManagerConfiguration(java.lang.String instanceName) { + + try { + controller.pollManagerConfiguration(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { + org.eclipse.emf.ecore.EObject res = null; + try { + res = controller.managerConfiguration(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { + org.json.JSONObject res = null; + try { + res = controller.managerOperation(instanceName,operation,parameters); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + return res; + } + + public void updateConfigurationFromPolicy(java.lang.String instanceName) { + + try { + controller.updateConfigurationFromPolicy(instanceName); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + + public void runHealthTests() { + + try { + controller.runHealthTests(); + } + catch (ManagementServerError e) { + System.err.println("ERROR: " + e.getJson().toString(2)); + } + + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceProviderTemplate.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceProviderTemplate.java new file mode 100644 index 0000000..229bfaa --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceProviderTemplate.java @@ -0,0 +1,65 @@ + +/*- + * ============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.common.docker.servers.service; + + + + + +import java.io.InputStream; + +import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.function.FunctionUtils; + +import org.apache.log4j.Logger; +import org.eclipse.emf.common.util.EList; +import org.json.JSONObject; + + + +import org.openecomp.dcae.controller.service.servers.docker.DcaeDockerServiceProvider; + + +import org.openecomp.dcae.controller.service.common.docker.service.impl.CommonDockerServiceImpl; +import org.openecomp.dcae.controller.service.common.docker.service.CommonDockerService; + + +public class DcaeCommonDockerServiceProviderTemplate extends DcaeDockerServiceProvider { + private static final Logger logger = Logger.getLogger(DcaeCommonDockerServiceProviderTemplate.class); + CommonDockerService o; + + public DcaeCommonDockerServiceProviderTemplate(ISiriusServer controller, CommonDockerService o) { + super(controller, o); + this.o = o; + } + + + + + + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceServer.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceServer.java new file mode 100644 index 0000000..6be777d --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeCommonDockerServiceServer.java @@ -0,0 +1,101 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit but extend this class as needed +package org.openecomp.dcae.controller.service.common.docker.servers.service; + +import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; + +import java.io.IOException; +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.openecomp.ncomp.sirius.manager.Jetty8Server; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; + +import org.openecomp.dcae.controller.service.common.docker.service.CommonDockerService; + + + + + + +public class DcaeCommonDockerServiceServer implements ISiriusServer { + public static final Logger logger = Logger.getLogger(DcaeCommonDockerServiceServer.class); + String serverPath; + ManagementServer server; + DcaeCommonDockerService controller; + String directory = "data"; +// LocationControllerApi api ; + Jetty8Server webServer; + DcaeServiceFactory f = new DcaeServiceFactory(this); + + + + public DcaeCommonDockerServiceServer(String filename) throws IOException { + logger.warn("controller restarting"); + DcaeCommonDockerService.ecoreSetup(); + props = getPropertiesFromClasspath(filename); + serverPath = (String) props.get("server.dir"); + server = new ManagementServer(f, "CommonDockerService", serverPath, filename); + server.addFactory(f); + + server.addFactory(org.openecomp.dcae.controller.service.common.docker.service.ServiceFactory.eINSTANCE); + + + server.addRuntimeFactories(this); + server.start(); + } + public void runWebserver() throws IOException { + controller = (DcaeCommonDockerService) server.find("/").o; + webServer = new Jetty8Server("service.properties"); + webServer.add("/resources",server); + + + + + + logger.info("Joining webserver"); + webServer.join(); + } + static Properties props = null; + public static void main(String []args) throws IOException { + // ALWAYS USE GMT. + TimeZone.setDefault(TimeZone.getTimeZone("GMT")); + + DcaeCommonDockerServiceServer s = new DcaeCommonDockerServiceServer("service.properties"); + s.runWebserver(); + } + public CommonDockerService getController() { + return controller; + } + public ManagementServer getServer() { + return server; + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeServiceFactory.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeServiceFactory.java new file mode 100644 index 0000000..af787ba --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/DcaeServiceFactory.java @@ -0,0 +1,54 @@ + +/*- + * ============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============================================ + */ + +// Autogenerated +// Do not edit. No need to extend this class. +package org.openecomp.dcae.controller.service.common.docker.servers.service; + +import org.eclipse.emf.ecore.EPackage; +import org.apache.log4j.Logger; + +import org.openecomp.ncomp.sirius.manager.ISiriusServer; + +import org.openecomp.dcae.controller.service.common.docker.service.CommonDockerService; +import org.openecomp.dcae.controller.service.common.docker.service.ServicePackage; +import org.openecomp.dcae.controller.service.common.docker.service.impl.ServiceFactoryImpl; + + + + + +public class DcaeServiceFactory extends ServiceFactoryImpl { + public static final Logger logger = Logger.getLogger(DcaeServiceFactory.class); + ISiriusServer server = null; + @Override + public EPackage getEPackage() { return ServicePackage.eINSTANCE; } + public DcaeServiceFactory(ISiriusServer server) { + this.server = server; + } + @Override + public CommonDockerService createCommonDockerService() { + return new DcaeCommonDockerService(server); + } + + + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerService.properties b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerService.properties new file mode 100644 index 0000000..13a57d6 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerService.properties @@ -0,0 +1,138 @@ + +dummy=\ + null|\ + null|\ + null|\ + null + +deploy=\ + deploy-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +undeploy=\ + undeploy-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +test=\ + test-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +suspend=\ + suspend-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +resume=\ + resume-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +pushManagerConfiguration=\ + pushManagerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +pollManagerConfiguration=\ + pollManagerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +managerConfiguration=\ + managerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +managerOperation=\ + managerOperation-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +updateConfigurationFromPolicy=\ + updateConfigurationFromPolicy-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +runHealthTests=\ + runHealthTests-FAILED-5001W|\ + {0}|\ + null|\ + Operation Failed with Exception + +REMOTE_deploy=\ + REMOTE-deploy-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_undeploy=\ + REMOTE-undeploy-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_test=\ + REMOTE-test-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_suspend=\ + REMOTE-suspend-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_resume=\ + REMOTE-resume-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_pushManagerConfiguration=\ + REMOTE-pushManagerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_pollManagerConfiguration=\ + REMOTE-pollManagerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_managerConfiguration=\ + REMOTE-managerConfiguration-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_managerOperation=\ + REMOTE-managerOperation-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_updateConfigurationFromPolicy=\ + REMOTE-updateConfigurationFromPolicy-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception + +REMOTE_runHealthTests=\ + REMOTE-runHealthTests-FAILED-5001W|\ + {0}|\ + null|\ + Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceMessageEnum.java new file mode 100644 index 0000000..4680af8 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceMessageEnum.java @@ -0,0 +1,57 @@ + +/*- + * ============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.common.docker.servers.service.logging; + +import com.att.eelf.i18n.EELFResourceManager; +import org.openecomp.logger.EcompMessageEnum; + +public enum CommonDockerServiceMessageEnum implements EcompMessageEnum { + + dummy, + deploy, + undeploy, + test, + suspend, + resume, + pushManagerConfiguration, + pollManagerConfiguration, + managerConfiguration, + managerOperation, + updateConfigurationFromPolicy, + runHealthTests, + REMOTE_deploy, + REMOTE_undeploy, + REMOTE_test, + REMOTE_suspend, + REMOTE_resume, + REMOTE_pushManagerConfiguration, + REMOTE_pollManagerConfiguration, + REMOTE_managerConfiguration, + REMOTE_managerOperation, + REMOTE_updateConfigurationFromPolicy, + REMOTE_runHealthTests; + + static { + EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.common.docker.servers.service.logging.CommonDockerService"); + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceOperationEnum.java new file mode 100644 index 0000000..a614511 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-common-docker/dcae-controller-service-common-docker-manager/src/main/sirius-gen/org/openecomp/dcae/controller/service/common/docker/servers/service/logging/CommonDockerServiceOperationEnum.java @@ -0,0 +1,51 @@ + +/*- + * ============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.common.docker.servers.service.logging; + +import org.openecomp.entity.EcompOperationEnum; + +public enum CommonDockerServiceOperationEnum implements EcompOperationEnum { + + deploy, + undeploy, + test, + suspend, + resume, + pushManagerConfiguration, + pollManagerConfiguration, + managerConfiguration, + managerOperation, + updateConfigurationFromPolicy, + runHealthTests, + REMOTE_deploy, + REMOTE_undeploy, + REMOTE_test, + REMOTE_suspend, + REMOTE_resume, + REMOTE_pushManagerConfiguration, + REMOTE_pollManagerConfiguration, + REMOTE_managerConfiguration, + REMOTE_managerOperation, + REMOTE_updateConfigurationFromPolicy, + REMOTE_runHealthTests; +} -- cgit 1.2.3-korg