diff options
Diffstat (limited to 'dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main')
28 files changed, 913 insertions, 833 deletions
diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/DockerManager2.yaml b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/DockerManager2.yaml new file mode 100644 index 0000000..cc67863 --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/DockerManager2.yaml @@ -0,0 +1,12 @@ +operations: + DOCKER-MANAGER-START-NEW-CRON: {} + DOCKER-MANAGER-START-CRON-RUN: {} +messages: + DOCKER-MANAGER-START-NEW-CRON: + errorCode: 2001I + messageFormat: cmd={0} frequency={1} + description: Defining new cron job + DOCKER-MANAGER-CRON-FAILURE: + errorCode: 4001W + messageFormat: cmd={0} error={1} + description: Cron Operation Failed diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/docker/manager/tools/Generator.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/docker/manager/tools/Generator.java index 49ba09f..e040825 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/docker/manager/tools/Generator.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/docker/manager/tools/Generator.java @@ -19,78 +19,80 @@ * ============LICENSE_END============================================ */ -package org.openecomp.dcae.controller.service.docker.manager.tools;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.openecomp.ncomp.sirius.manager.controllermodel.ControllerModel;
-import org.openecomp.ncomp.sirius.manager.controllermodel.ControllermodelFactory;
-import org.openecomp.ncomp.sirius.manager.generator.ControllerGenerator;
-import org.openecomp.ncomp.gwt.siriusportal.model.*;
-import org.openecomp.ncomp.sirius.manager.server.ServerPackage;
-import org.openecomp.dcae.controller.service.docker.DockerFactory;
-import org.openecomp.dcae.controller.service.dockermanager.DockermanagerFactory;
-import org.openecomp.utils.YamlToJava;
-
-public class Generator {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- @SuppressWarnings("unused")
- ServerPackage f = ServerPackage.eINSTANCE;
- genManager();
- genService();
- }
-
- public static void genManager() {
- EObject o = DockermanagerFactory.eINSTANCE.createDockerManager();
- EPackage p = o.eClass().getEPackage();
- String dir = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix();
- dir = "src/main/sirius-gen/" + dir.replace('.', '/');
- ControllerModel m = ControllermodelFactory.eINSTANCE.createControllerModel();
- m.setTemplateDirectory("../../dcae-org.openecomp.ncomp.sirius.manager/ncomp-sirius-manager-generator/src/main/templates");
- m.setPrefix("Dcae");
- m.setPluginName(p.getNsURI());
- m.setName("ControllerServiceDockerManager");
- m.setTitle("ControllerServiceDockerManager");
- ControllerGenerator g = new ControllerGenerator(o, m);
- g.setEnableIRequestHandler(false);
- g.setEnableISiriusPlugin(false);
- g.addFactory("org.openecomp.ncomp.servers.docker.DockerDockerFactory");
- g.addFactory(DockerFactory.eINSTANCE);
- EObject gui = ModelFactory.eINSTANCE.createGuiClientApi();
- g.addObject("gui", gui, m);
- g.generate(dir);
- g.generateScripts("src/main/server-gen/bin", "controller-service-docker-manager");
- String pName = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".logging";
-// YamlToJava.convert("src/main/resources/DockerAdaptor.yaml", dir + "/logging", pName);
- YamlToJava.convert("src/main/sirius-gen/DockerManager.yaml", dir + "/logging", pName);
- String pName1 = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".gui.logging";
- YamlToJava.convert("src/main/sirius-gen/GuiClientApi.yaml", dir + "/gui/logging", pName1);
- }
-
- public static void genService() {
- EObject o = DockerFactory.eINSTANCE.createDockerService();
- EPackage p = o.eClass().getEPackage();
- String dir = p.getNsURI().replaceAll(p.getNsPrefix()+"$", "") + "servers." + p.getNsPrefix();
- dir = "src/main/sirius-gen/" + dir.replace('.', '/');
- ControllerModel m = ControllermodelFactory.eINSTANCE.createControllerModel();
- m.setTemplateDirectory("../../dcae-org.openecomp.ncomp.sirius.manager/ncomp-sirius-manager-generator/src/main/templates");
- m.setPrefix("Dcae");
- m.setPluginName(p.getNsURI());
- m.setName("ControllerServiceDockerService");
- m.setTitle("ControllerServiceDockerService");
- ControllerGenerator g = new ControllerGenerator(o, m);
- g.setEnableIRequestHandler(false);
- g.setEnableISiriusPlugin(true);
- g.generate(dir);
- String pName = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".logging";
-// YamlToJava.convert("src/main/resources/DcaeServiceDockerHost.yaml", dir + "/logging", pName);
- YamlToJava.convert("src/main/sirius-gen/DockerService.yaml", dir + "/logging", pName);
-
- }
-
-}
+package org.openecomp.dcae.controller.service.docker.manager.tools; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.openecomp.ncomp.sirius.manager.controllermodel.ControllerModel; +import org.openecomp.ncomp.sirius.manager.controllermodel.ControllermodelFactory; +import org.openecomp.ncomp.sirius.manager.generator.ControllerGenerator; +import org.openecomp.ncomp.gwt.siriusportal.model.*; +import org.openecomp.ncomp.sirius.manager.server.ServerPackage; +import org.openecomp.dcae.controller.service.docker.DockerFactory; +import org.openecomp.dcae.controller.service.dockermanager.DockermanagerFactory; +import org.openecomp.utils.YamlToJava; + +public class Generator { + + /** + * @param args + */ + public static void main(String[] args) { + @SuppressWarnings("unused") + ServerPackage f = ServerPackage.eINSTANCE; + genManager(); + genService(); + } + + public static void genManager() { + EObject o = DockermanagerFactory.eINSTANCE.createDockerManager(); + EPackage p = o.eClass().getEPackage(); + String dir = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix(); + dir = "src/main/sirius-gen/" + dir.replace('.', '/'); + ControllerModel m = ControllermodelFactory.eINSTANCE.createControllerModel(); + m.setTemplateDirectory("../../../ncomp.sirius.manager/ncomp-sirius-manager-generator/src/main/templates"); + m.setPrefix("Dcae"); + m.setPluginName(p.getNsURI()); + m.setName("ControllerServiceDockerManager"); + m.setTitle("ControllerServiceDockerManager"); + ControllerGenerator g = new ControllerGenerator(o, m); + g.setVersion("ONAP-R2"); + g.setEnableIRequestHandler(false); + g.setEnableISiriusPlugin(false); + g.addFactory("org.openecomp.ncomp.servers.docker.DockerDockerFactory"); + g.addFactory(DockerFactory.eINSTANCE); + EObject gui = ModelFactory.eINSTANCE.createGuiClientApi(); + g.addObject("gui", gui, m); + g.generate(dir); + g.generateScripts("src/main/server-gen/bin", "controller-service-docker-manager"); + String pName = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".logging"; +// YamlToJava.convert("src/main/resources/DockerAdaptor.yaml", dir + "/logging", pName); + YamlToJava.convert("src/main/sirius-gen/DockerManager.yaml", dir + "/logging", pName); + YamlToJava.convert("src/main/java/DockerManager2.yaml", dir + "/logging", pName); + String pName1 = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".gui.logging"; + YamlToJava.convert("src/main/sirius-gen/GuiClientApi.yaml", dir + "/gui/logging", pName1); + } + + public static void genService() { + EObject o = DockerFactory.eINSTANCE.createDockerService(); + EPackage p = o.eClass().getEPackage(); + String dir = p.getNsURI().replaceAll(p.getNsPrefix()+"$", "") + "servers." + p.getNsPrefix(); + dir = "src/main/sirius-gen/" + dir.replace('.', '/'); + ControllerModel m = ControllermodelFactory.eINSTANCE.createControllerModel(); + m.setTemplateDirectory("../../../ncomp.sirius.manager/ncomp-sirius-manager-generator/src/main/templates"); + m.setPrefix("Dcae"); + m.setPluginName(p.getNsURI()); + m.setName("ControllerServiceDockerService"); + m.setTitle("ControllerServiceDockerService"); + ControllerGenerator g = new ControllerGenerator(o, m); + g.setVersion("ONAP-R2"); + g.setEnableIRequestHandler(false); + g.setEnableISiriusPlugin(true); + g.generate(dir); + String pName = p.getNsURI().replaceAll(p.getNsPrefix()+'$',"") + "servers." + p.getNsPrefix() +".logging"; +// YamlToJava.convert("src/main/resources/DcaeServiceDockerHost.yaml", dir + "/logging", pName); + YamlToJava.convert("src/main/sirius-gen/DockerService.yaml", dir + "/logging", pName); + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java index e653107..cdfc596 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceProvider.java @@ -45,6 +45,7 @@ import org.openecomp.dcae.controller.service.docker.host.servers.service.DcaeDoc import org.openecomp.dcae.controller.service.docker.host.service.DockerHostServiceInstance; import org.openecomp.dcae.controller.service.servers.dockermanager.DcaeDockerManagerConsole; import org.openecomp.dcae.controller.service.servers.vmmanager.DcaeVirtualMachineManagerConsole; +import org.openecomp.dcae.controller.service.vm.VirtualMachineService; import org.openecomp.dcae.controller.service.vm.VirtualMachineServiceInstance; import org.openecomp.ncomp.core.DeploymentStatus; import org.openecomp.ncomp.docker.ContainerOptions; @@ -54,6 +55,7 @@ import org.openecomp.ncomp.docker.DockerFactory; import org.openecomp.ncomp.servers.docker.DockerDockerHostConsole; import org.openecomp.ncomp.sirius.manager.AbstractClient; import org.openecomp.ncomp.sirius.manager.BasicAdaptorProvider; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.ncomp.sirius.manager.JavaHttpClient; import org.openecomp.ncomp.sirius.manager.ManagementServer; @@ -96,8 +98,8 @@ public class DcaeDockerServiceProvider extends BasicAdaptorProvider { } console(instanceName).setupConfiguration(o.getName(), instanceName); consoleHost(i).dockerRunWithOptions("/resources/dockerHost", image(i), opts); - long toolate = System.currentTimeMillis() + 2 * 60 * 1000; - // if has manager wait 2 minutes for container manager + long toolate = System.currentTimeMillis() + 15 * 60 * 1000; + // wait 15 minutes for container manager while (i.getManagerPortNumber() > 0 && System.currentTimeMillis() < toolate) { try { o.pushManagerConfiguration(instanceName); @@ -136,15 +138,15 @@ public class DcaeDockerServiceProvider extends BasicAdaptorProvider { public AbstractClient getClient(DockerServiceInstance i) { DockerHostServiceInstance instance = i.getHostService(); - DcaeDockerHostService service = (DcaeDockerHostService) instance.getService(); - DcaeDockerHostServiceProvider provider = service.getSomfProvider(); + VirtualMachineService service = instance.getService(); + DcaeDockerHostServiceProvider provider = (DcaeDockerHostServiceProvider) ((ISiriusProvider) service).getSiriusProvider(); return provider.getClient(instance); } private DockerDockerHostConsole consoleHost(DockerServiceInstance i) { DockerHostServiceInstance instance = i.getHostService(); - DcaeDockerHostService service = (DcaeDockerHostService) instance.getService(); - DcaeDockerHostServiceProvider provider = service.getSomfProvider(); + VirtualMachineService service = instance.getService(); + DcaeDockerHostServiceProvider provider = (DcaeDockerHostServiceProvider) ((ISiriusProvider) service).getSiriusProvider(); AbstractClient c = provider.getClient(instance); return new DockerDockerHostConsole(c); } @@ -265,11 +267,17 @@ public class DcaeDockerServiceProvider extends BasicAdaptorProvider { } public void runHealthTests() { - System.out.println("DOCKER: runHealthTests" + o.getName()); +// System.out.println("DOCKER: runHealthTests" + o.getName()); for (DockerServiceInstance i : o.getInstances()) { HealthTestResponse s = null; try { - s = o.test(i.getName()); + if (i.getStatus() == DeploymentStatus.DEPLOYED) { + s = test(i.getName()); + } else { + s = ServiceFactory.eINSTANCE.createHealthTestResponse(); + s.setMessageCode("Not deployed"); + s.setStatus(HealthTestStatus.YELLOW); + } } catch (Exception e) { s = ServiceFactory.eINSTANCE.createHealthTestResponse(); s.setMessageCode("Unable to determine health: " + e); diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerProvider.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerProvider.java index a6e70da..13173ac 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerProvider.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/java/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerProvider.java @@ -19,45 +19,36 @@ * ============LICENSE_END============================================ */ - package org.openecomp.dcae.controller.service.servers.dockermanager; - - - - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; import java.io.OutputStreamWriter; import java.util.Date; -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.manager.ManagementServer; -import org.openecomp.ncomp.sirius.manager.ManagementServerUtils; -import org.openecomp.ncomp.sirius.function.FunctionUtils; - import org.apache.log4j.Logger; import org.eclipse.emf.common.util.EList; import org.json.JSONArray; import org.json.JSONObject; - - - -import org.openecomp.ncomp.sirius.manager.BasicAdaptorProvider; -import org.openecomp.ncomp.webservice.utils.FileUtils; import org.openecomp.dcae.controller.core.service.HealthTestResponse; import org.openecomp.dcae.controller.core.service.HealthTestStatus; import org.openecomp.dcae.controller.core.service.ServiceFactory; import org.openecomp.dcae.controller.core.stream.DcaeStream; -import org.openecomp.dcae.controller.service.dockermanager.impl.DockerManagerImpl; import org.openecomp.dcae.controller.service.dockermanager.DockerManager; - +import org.openecomp.dcae.controller.service.servers.dockermanager.logging.DockerManager2MessageEnum; +import org.openecomp.dcae.controller.service.servers.dockermanager.logging.DockerManager2OperationEnum; +import org.openecomp.logger.EcompMessageEnum; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.ncomp.sirius.manager.BasicAdaptorProvider; +import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.ManagementServerUtils; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.ncomp.utils.ShellCmd; +import org.openecomp.ncomp.webservice.utils.FileUtils; public class DcaeDockerManagerProvider extends BasicAdaptorProvider { private static final Logger logger = Logger.getLogger(DcaeDockerManagerProvider.class); + private static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); DockerManager o; private boolean suspended; @@ -102,9 +93,9 @@ public class DcaeDockerManagerProvider extends BasicAdaptorProvider { json.put("dmaapStreamId", s.getName()); a.put(json); } - write2file(a,"/tmp/dmaap.conf2"); - write2file(a,"/etc/dcae/dmaap.conf"); - + write2file(a, "/tmp/dmaap.conf2"); + write2file(a, "/etc/dcae/dmaap.conf"); + } private void write2file(JSONArray a, String fileName) { @@ -124,49 +115,51 @@ public class DcaeDockerManagerProvider extends BasicAdaptorProvider { o.getOutputStreams().clear(); o.getOutputStreams().addAll(outputStreams); } - + public void scheduleCronjob(final String cmd, final long frequency) { - Thread t = new Thread("crontab: " + cmd) { - @Override - public void run() { - while (true) { - try { - Date now = new Date(); - long wait = frequency - (now.getTime() % frequency); - Thread.sleep(wait); - if (suspended) continue; - Runtime runtime = Runtime.getRuntime(); - Process proc; - try { - now = new Date(); - proc = runtime.exec(cmd); - ByteArrayOutputStream o = new ByteArrayOutputStream(); - ByteArrayOutputStream e = new ByteArrayOutputStream(); - FileUtils.copyStream(proc.getInputStream(), o); - FileUtils.copyStream(proc.getErrorStream(), e); - int i = proc.waitFor(); - if (i != 0) - logger.warn("crontab return error: " + cmd + " " + i); - long duration = new Date().getTime()-now.getTime(); - if (duration > frequency) - logger.warn("crontab took too long: " + cmd + " " + duration); - } catch (Exception e) { - e.printStackTrace(); - logger.warn("ERROR: " + e); - } - } catch (Exception e) { - ManagementServerUtils.printStackTrace(e); - logger.fatal("crontab: " + cmd + " " + e); - try { - Thread.sleep(30000); - } catch (InterruptedException e1) { - } - } - } - }; - }; - t.start(); + ecomplogger.setOperation(DockerManager2OperationEnum.DOCKER_MANAGER_START_NEW_CRON); + ecomplogger.newRequestId(); + ecomplogger.setInstanceId(controller, o); + ecomplogger.recordAuditEventStart(); + EcompMessageEnum msg1 = DockerManager2MessageEnum.DOCKER_MANAGER_START_NEW_CRON; + ; + ecomplogger.recordAuditEventEnd(StatusCodeEnum.COMPLETE, msg1, cmd, Long.toString(frequency)); + + Thread t = new Thread("crontab: " + cmd) { + @Override + public void run() { + while (true) { + try { + Date now = new Date(); + long wait = frequency - (now.getTime() % frequency); + Thread.sleep(wait); + if (suspended) + continue; + try { + ecomplogger.setOperation(DockerManager2OperationEnum.DOCKER_MANAGER_START_CRON_RUN); + ecomplogger.newRequestId(); + ecomplogger.setInstanceId(controller, o); + ecomplogger.recordAuditEventStart(); + ShellCmd c = new ShellCmd(cmd); + c.result(frequency); + ecomplogger.recordAuditEventEnd(); + } catch (Exception e) { + e.printStackTrace(); + EcompMessageEnum msg = DockerManager2MessageEnum.DOCKER_MANAGER_CRON_FAILURE; + ecomplogger.recordAuditEventEnd(StatusCodeEnum.ERROR, msg, cmd, e.toString()); + } + } catch (Exception e) { + ManagementServerUtils.printStackTrace(e); + logger.fatal("crontab: " + cmd + " " + e); + try { + Thread.sleep(30000); + } catch (InterruptedException e1) { + } + } + } + }; + }; + t.start(); } - } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/server-gen/bin/controller-service-docker-manager-controller b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/server-gen/bin/controller-service-docker-manager-controller index c774595..16cf560 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/server-gen/bin/controller-service-docker-manager-controller +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/server-gen/bin/controller-service-docker-manager-controller @@ -93,7 +93,7 @@ case $CMD in if [ -e $_DIR/logs/$PNAME.out ]; then mv $_DIR/logs/$PNAME.out $_DIR/logs/$PNAME.out.1; fi if [ -e $_DIR/logs/$PNAME.err ]; then mv $_DIR/logs/$PNAME.err $_DIR/logs/$PNAME.err.1; fi - nohup $JAVA_HOME/bin/java $JVMARGS -cp $_DIR/config:$_DIR/lib:$_DIR/lib/\*:$CP "$@" $CLASS > $_DIR/logs/$PNAME.out 2> $_DIR/logs/$PNAME.err & + nohup $JAVA_HOME/bin/java $JVMARGS -cp $_DIR/config:$_DIR/lib:$_DIR/lib/\*:$CP "$@" $CLASS >> $_DIR/logs/$PNAME.out 2>> $_DIR/logs/$PNAME.err & _PID=$! echo $_PID > $_PIDFILE diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerManager.yaml b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerManager.yaml index 6ab6771..a234cae 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerManager.yaml +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerManager.yaml @@ -1,69 +1,57 @@ 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 + DockerManager@test: {} + DockerManager@suspend: {} + DockerManager@resume: {} + DockerManager@publicKey: {} + DockerManager@configurationChanged: {} + DockerManager@updateStreams: {} messages: dummy: {} - test: - errorCode: test-FAILED-5001W + REQUEST-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - suspend: - errorCode: suspend-FAILED-5001W + REQUEST-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - resume: - errorCode: resume-FAILED-5001W + REQUEST-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - publicKey: - errorCode: publicKey-FAILED-5001W + REQUEST-FAILED-publicKey: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - configurationChanged: - errorCode: configurationChanged-FAILED-5001W + REQUEST-FAILED-configurationChanged: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - updateStreams: - errorCode: updateStreams-FAILED-5001W + REQUEST-FAILED-updateStreams: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - REMOTE_test: - errorCode: REMOTE-test-FAILED-5001W + REMOTE-CALL-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_suspend: - errorCode: REMOTE-suspend-FAILED-5001W + REMOTE-CALL-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_resume: - errorCode: REMOTE-resume-FAILED-5001W + REMOTE-CALL-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_publicKey: - errorCode: REMOTE-publicKey-FAILED-5001W + REMOTE-CALL-FAILED-publicKey: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_configurationChanged: - errorCode: REMOTE-configurationChanged-FAILED-5001W + REMOTE-CALL-FAILED-configurationChanged: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_updateStreams: - errorCode: REMOTE-updateStreams-FAILED-5001W + REMOTE-CALL-FAILED-updateStreams: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerService.yaml b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerService.yaml index c449feb..580d4bd 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerService.yaml +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/DockerService.yaml @@ -1,124 +1,102 @@ 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 + DockerService@deploy: {} + DockerService@undeploy: {} + DockerService@test: {} + DockerService@suspend: {} + DockerService@resume: {} + DockerService@pushManagerConfiguration: {} + DockerService@pollManagerConfiguration: {} + DockerService@managerConfiguration: {} + DockerService@managerOperation: {} + DockerService@updateConfigurationFromPolicy: {} + DockerService@runHealthTests: {} messages: dummy: {} - deploy: - errorCode: deploy-FAILED-5001W + REQUEST-FAILED-deploy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - undeploy: - errorCode: undeploy-FAILED-5001W + REQUEST-FAILED-undeploy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - test: - errorCode: test-FAILED-5001W + REQUEST-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - suspend: - errorCode: suspend-FAILED-5001W + REQUEST-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - resume: - errorCode: resume-FAILED-5001W + REQUEST-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - pushManagerConfiguration: - errorCode: pushManagerConfiguration-FAILED-5001W + REQUEST-FAILED-pushManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - pollManagerConfiguration: - errorCode: pollManagerConfiguration-FAILED-5001W + REQUEST-FAILED-pollManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - managerConfiguration: - errorCode: managerConfiguration-FAILED-5001W + REQUEST-FAILED-managerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - managerOperation: - errorCode: managerOperation-FAILED-5001W + REQUEST-FAILED-managerOperation: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - updateConfigurationFromPolicy: - errorCode: updateConfigurationFromPolicy-FAILED-5001W + REQUEST-FAILED-updateConfigurationFromPolicy: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - runHealthTests: - errorCode: runHealthTests-FAILED-5001W + REQUEST-FAILED-runHealthTests: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - REMOTE_deploy: - errorCode: REMOTE-deploy-FAILED-5001W + REMOTE-CALL-FAILED-deploy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_undeploy: - errorCode: REMOTE-undeploy-FAILED-5001W + REMOTE-CALL-FAILED-undeploy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_test: - errorCode: REMOTE-test-FAILED-5001W + REMOTE-CALL-FAILED-test: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_suspend: - errorCode: REMOTE-suspend-FAILED-5001W + REMOTE-CALL-FAILED-suspend: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_resume: - errorCode: REMOTE-resume-FAILED-5001W + REMOTE-CALL-FAILED-resume: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_pushManagerConfiguration: - errorCode: REMOTE-pushManagerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-pushManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_pollManagerConfiguration: - errorCode: REMOTE-pollManagerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-pollManagerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_managerConfiguration: - errorCode: REMOTE-managerConfiguration-FAILED-5001W + REMOTE-CALL-FAILED-managerConfiguration: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_managerOperation: - errorCode: REMOTE-managerOperation-FAILED-5001W + REMOTE-CALL-FAILED-managerOperation: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_updateConfigurationFromPolicy: - errorCode: REMOTE-updateConfigurationFromPolicy-FAILED-5001W + REMOTE-CALL-FAILED-updateConfigurationFromPolicy: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_runHealthTests: - errorCode: REMOTE-runHealthTests-FAILED-5001W + REMOTE-CALL-FAILED-runHealthTests: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/GuiClientApi.yaml b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/GuiClientApi.yaml index bf3d69d..1489339 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/GuiClientApi.yaml +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/GuiClientApi.yaml @@ -1,69 +1,57 @@ 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 + GuiClientApi@getTree: {} + GuiClientApi@getObject: {} + GuiClientApi@getTimeSerie: {} + GuiClientApi@getTable: {} + GuiClientApi@getHtml: {} + GuiClientApi@getGraph: {} messages: dummy: {} - getTree: - errorCode: getTree-FAILED-5001W + REQUEST-FAILED-getTree: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getObject: - errorCode: getObject-FAILED-5001W + REQUEST-FAILED-getObject: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getTimeSerie: - errorCode: getTimeSerie-FAILED-5001W + REQUEST-FAILED-getTimeSerie: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getTable: - errorCode: getTable-FAILED-5001W + REQUEST-FAILED-getTable: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getHtml: - errorCode: getHtml-FAILED-5001W + REQUEST-FAILED-getHtml: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - getGraph: - errorCode: getGraph-FAILED-5001W + REQUEST-FAILED-getGraph: + errorCode: 4001W messageFormat: '{0}' description: Operation Failed with Exception - REMOTE_getTree: - errorCode: REMOTE-getTree-FAILED-5001W + REMOTE-CALL-FAILED-getTree: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getObject: - errorCode: REMOTE-getObject-FAILED-5001W + REMOTE-CALL-FAILED-getObject: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getTimeSerie: - errorCode: REMOTE-getTimeSerie-FAILED-5001W + REMOTE-CALL-FAILED-getTimeSerie: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getTable: - errorCode: REMOTE-getTable-FAILED-5001W + REMOTE-CALL-FAILED-getTable: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getHtml: - errorCode: REMOTE-getHtml-FAILED-5001W + REMOTE-CALL-FAILED-getHtml: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception - REMOTE_getGraph: - errorCode: REMOTE-getGraph-FAILED-5001W + REMOTE-CALL-FAILED-getGraph: + errorCode: 4001W messageFormat: '{0}' description: Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerService.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerService.java index 886713f..43a5c67 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerService.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerService.java @@ -25,24 +25,34 @@ package org.openecomp.dcae.controller.service.servers.docker; + + import java.io.InputStream; import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.SwaggerUtils; import org.openecomp.ncomp.sirius.function.FunctionUtils; import org.openecomp.ncomp.component.ApiRequestStatus; import org.apache.log4j.Logger; -import org.openecomp.logger.EcompLogger; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.json.JSONObject; import java.util.Date; import org.openecomp.dcae.controller.service.servers.docker.logging.DockerServiceOperationEnum; +import org.openecomp.dcae.controller.service.servers.docker.logging.DockerServiceMessageEnum; @@ -51,9 +61,9 @@ import org.openecomp.dcae.controller.service.docker.impl.DockerServiceImpl; -public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugin { +public class DcaeDockerService extends DockerServiceImpl implements ISiriusProvider, ISiriusPlugin { public static final Logger logger = Logger.getLogger(DcaeDockerService.class); - static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DcaeDockerServiceProvider controller; ISiriusServer server; @@ -68,8 +78,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.START, duration_,instanceName,containerPath); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.deploy); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_deploy,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_deploy,"self:" + ManagementServer.object2ref(this)); try { controller.deploy(instanceName,containerPath); } @@ -78,7 +88,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "deploy", ApiRequestStatus.ERROR, duration_,instanceName,containerPath); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_deploy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_deploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_deploy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -93,8 +106,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.undeploy); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_undeploy,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_undeploy,"self:" + ManagementServer.object2ref(this)); try { controller.undeploy(instanceName); } @@ -103,7 +116,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "undeploy", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_undeploy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_undeploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_undeploy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -118,8 +134,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.test); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_test,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_test,"self:" + ManagementServer.object2ref(this)); try { res = controller.test(instanceName); } @@ -128,7 +144,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_test, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -143,8 +162,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.suspend); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_suspend,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_suspend,"self:" + ManagementServer.object2ref(this)); try { controller.suspend(instanceName); } @@ -153,7 +172,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -168,8 +190,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.resume); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_resume,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_resume,"self:" + ManagementServer.object2ref(this)); try { controller.resume(instanceName); } @@ -178,7 +200,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_resume, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -193,8 +218,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.pushManagerConfiguration); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_pushManagerConfiguration,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_pushManagerConfiguration,"self:" + ManagementServer.object2ref(this)); try { controller.pushManagerConfiguration(instanceName); } @@ -203,7 +228,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "pushManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_pushManagerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -218,8 +246,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.pollManagerConfiguration); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_pollManagerConfiguration,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_pollManagerConfiguration,"self:" + ManagementServer.object2ref(this)); try { controller.pollManagerConfiguration(instanceName); } @@ -228,7 +256,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "pollManagerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_pollManagerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -243,8 +274,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.managerConfiguration); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_managerConfiguration,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_managerConfiguration,"self:" + ManagementServer.object2ref(this)); try { res = controller.managerConfiguration(instanceName); } @@ -253,7 +284,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "managerConfiguration", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_managerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_managerConfiguration, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -268,8 +302,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.START, duration_,instanceName,operation,parameters); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.managerOperation); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_managerOperation,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_managerOperation,"self:" + ManagementServer.object2ref(this)); try { res = controller.managerOperation(instanceName,operation,parameters); } @@ -278,7 +312,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "managerOperation", ApiRequestStatus.ERROR, duration_,instanceName,operation,parameters); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_managerOperation, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_managerOperation,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_managerOperation, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -293,8 +330,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.START, duration_,instanceName); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.updateConfigurationFromPolicy); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_updateConfigurationFromPolicy,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_updateConfigurationFromPolicy,"self:" + ManagementServer.object2ref(this)); try { controller.updateConfigurationFromPolicy(instanceName); } @@ -303,7 +340,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "updateConfigurationFromPolicy", ApiRequestStatus.ERROR, duration_,instanceName); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_updateConfigurationFromPolicy, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -318,8 +358,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.runHealthTests); + ecomplogger.recordAuditEventStartIfNeeded(DockerServiceOperationEnum.DockerService_runHealthTests,server,this); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_runHealthTests,"self:" + ManagementServer.object2ref(this)); try { controller.runHealthTests(); } @@ -328,7 +368,10 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi if (server != null) server.getServer().recordApi(null, this, "runHealthTests", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REQUEST_FAILED_runHealthTests,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerServiceMessageEnum.REQUEST_FAILED_runHealthTests, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -342,6 +385,8 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi + + @Override public void start() { controller.start(); @@ -350,7 +395,7 @@ public class DcaeDockerService extends DockerServiceImpl implements ISiriusPlugi public static void ecoreSetup() { DcaeDockerServiceProvider.ecoreSetup(); } - public DcaeDockerServiceProvider getSomfProvider() { + public DcaeDockerServiceProvider getSiriusProvider() { return controller; } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceClient.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceClient.java index 3e23682..023d957 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceClient.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceClient.java @@ -30,6 +30,8 @@ import org.openecomp.ncomp.sirius.manager.GenericHttpClient; import org.apache.log4j.Logger; import org.openecomp.logger.EcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -54,33 +56,37 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { DcaeDockerService.ecoreSetup(); client = new GenericHttpClient(file,name); client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeDockerServiceClient(String file, String name1, String name2) { HighAvailabilityClient client1 = new HighAvailabilityClient(file,name1,name2); client = client1.all; // requests should be forwarded to all. client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeDockerServiceClient(AbstractClient c) { client = c; client.add("/resources", this); + client.setVersion("ONAP-R2"); } @Override public void deploy(java.lang.String instanceName, java.lang.String containerPath) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_deploy); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_deploy,client.getRemote()); try { client.operationPath("/resources", c, "deploy", null, instanceName,containerPath); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_deploy, e.toString()); - throw new RuntimeException("remote call failed: deploy", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_deploy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_deploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_deploy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -88,16 +94,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void undeploy(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_undeploy); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_undeploy,client.getRemote()); try { client.operationPath("/resources", c, "undeploy", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_undeploy, e.toString()); - throw new RuntimeException("remote call failed: undeploy", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_undeploy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_undeploy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_undeploy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -105,16 +112,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public org.openecomp.dcae.controller.core.service.HealthTestResponse test(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_test); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_test,client.getRemote()); org.openecomp.dcae.controller.core.service.HealthTestResponse res; try { res = (org.openecomp.dcae.controller.core.service.HealthTestResponse) client.operationPath("/resources", c, "test", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_test, e.toString()); - throw new RuntimeException("remote call failed: test", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_test,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -122,16 +130,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void suspend(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_suspend); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_suspend,client.getRemote()); try { client.operationPath("/resources", c, "suspend", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_suspend, e.toString()); - throw new RuntimeException("remote call failed: suspend", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_suspend,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -139,16 +148,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void resume(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_resume); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_resume,client.getRemote()); try { client.operationPath("/resources", c, "resume", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_resume, e.toString()); - throw new RuntimeException("remote call failed: resume", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_resume,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -156,16 +166,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void pushManagerConfiguration(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_pushManagerConfiguration); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_pushManagerConfiguration,client.getRemote()); try { client.operationPath("/resources", c, "pushManagerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_pushManagerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: pushManagerConfiguration", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_pushManagerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -173,16 +184,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void pollManagerConfiguration(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_pollManagerConfiguration); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_pollManagerConfiguration,client.getRemote()); try { client.operationPath("/resources", c, "pollManagerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_pollManagerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: pollManagerConfiguration", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_pollManagerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -190,16 +202,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public org.eclipse.emf.ecore.EObject managerConfiguration(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_managerConfiguration); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_managerConfiguration,client.getRemote()); org.eclipse.emf.ecore.EObject res; try { res = (org.eclipse.emf.ecore.EObject) client.operationPath("/resources", c, "managerConfiguration", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_managerConfiguration, e.toString()); - throw new RuntimeException("remote call failed: managerConfiguration", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerConfiguration,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -207,16 +220,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public org.json.JSONObject managerOperation(java.lang.String instanceName, java.lang.String operation, org.json.JSONObject parameters) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_managerOperation); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_managerOperation,client.getRemote()); org.json.JSONObject res; try { res = (org.json.JSONObject) client.operationPath("/resources", c, "managerOperation", null, instanceName,operation,parameters); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_managerOperation, e.toString()); - throw new RuntimeException("remote call failed: managerOperation", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_managerOperation,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -224,16 +238,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void updateConfigurationFromPolicy(java.lang.String instanceName) { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_updateConfigurationFromPolicy); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_updateConfigurationFromPolicy,client.getRemote()); try { client.operationPath("/resources", c, "updateConfigurationFromPolicy", null, instanceName); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_updateConfigurationFromPolicy, e.toString()); - throw new RuntimeException("remote call failed: updateConfigurationFromPolicy", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_updateConfigurationFromPolicy,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -241,16 +256,17 @@ public class DcaeDockerServiceClient extends DockerServiceImpl { @Override public void runHealthTests() { - EClass c = DockerPackage.eINSTANCE.getDockerService(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerServiceOperationEnum.REMOTE_runHealthTests); + EClass c = DockerPackage.eINSTANCE.getDockerService(); + ecomplogger.recordMetricEventStart(DockerServiceOperationEnum.DockerService_runHealthTests,client.getRemote()); try { client.operationPath("/resources", c, "runHealthTests", null); } catch (Exception e) { - ecomplogger.warn(DockerServiceMessageEnum.REMOTE_runHealthTests, e.toString()); - throw new RuntimeException("remote call failed: runHealthTests", e); + ecomplogger.warn(DockerServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests, e.toString()); + EcompException e1 = EcompException.create(DockerServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerServiceMessageEnum.REMOTE_CALL_FAILED_runHealthTests,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceServer.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceServer.java index 628a90f..c9c422b 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceServer.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/DcaeDockerServiceServer.java @@ -26,17 +26,16 @@ package org.openecomp.dcae.controller.service.servers.docker; import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; import java.io.IOException; +import java.io.InputStream; import java.util.Properties; import java.util.TimeZone; import org.apache.log4j.Logger; import org.eclipse.emf.ecore.EFactory; - -import org.openecomp.entity.EcompComponent; -import org.openecomp.entity.EcompSubComponent; -import org.openecomp.entity.EcompSubComponentInstance; +import org.json.JSONObject; import org.openecomp.ncomp.sirius.manager.Jetty8Server; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.IRequestHandler; import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.dcae.controller.service.docker.DockerService; @@ -46,7 +45,7 @@ import org.openecomp.dcae.controller.service.docker.DockerService; -public class DcaeDockerServiceServer implements ISiriusServer { +public class DcaeDockerServiceServer implements ISiriusServer, IRequestHandler { public static final Logger logger = Logger.getLogger(DcaeDockerServiceServer.class); String serverPath; ManagementServer server; @@ -64,6 +63,7 @@ public class DcaeDockerServiceServer implements ISiriusServer { props = getPropertiesFromClasspath(filename); serverPath = (String) props.get("server.dir"); server = new ManagementServer(f, "DockerService", serverPath, filename); + ManagementServer.setBuildVersion("ONAP-R2"); server.addFactory(f); server.addRuntimeFactories(this); @@ -73,6 +73,7 @@ public class DcaeDockerServiceServer implements ISiriusServer { controller = (DcaeDockerService) server.find("/").o; webServer = new Jetty8Server("docker.properties"); webServer.add("/resources",server); + webServer.add("/api",this); @@ -95,4 +96,17 @@ public class DcaeDockerServiceServer implements ISiriusServer { public ManagementServer getServer() { return server; } + public Object handleJson(String userName, String action, String resourcePath, JSONObject json, JSONObject context, + String clientVersion) { + switch ((String) context.get("path")) { + case "/api/versions": + return server.supportedVersions(); + } + logger.warn("Unknown request action=" + action + " path=" + resourcePath + " context=" + context.toString(2)); + throw new RuntimeException("Unknown request"); + } + public Object handleBinary(String userName, String action, String resourcePath, InputStream in) { + return null; + } + } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerService.properties b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerService.properties index 13a57d6..f3a3955 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerService.properties +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerService.properties @@ -1,138 +1,138 @@ dummy=\ - null|\ + dummy-null|\ null|\ null|\ null -deploy=\ - deploy-FAILED-5001W|\ +REQUEST_FAILED_deploy=\ + REQUEST-FAILED-deploy-4001W|\ {0}|\ null|\ Operation Failed with Exception -undeploy=\ - undeploy-FAILED-5001W|\ +REQUEST_FAILED_undeploy=\ + REQUEST-FAILED-undeploy-4001W|\ {0}|\ null|\ Operation Failed with Exception -test=\ - test-FAILED-5001W|\ +REQUEST_FAILED_test=\ + REQUEST-FAILED-test-4001W|\ {0}|\ null|\ Operation Failed with Exception -suspend=\ - suspend-FAILED-5001W|\ +REQUEST_FAILED_suspend=\ + REQUEST-FAILED-suspend-4001W|\ {0}|\ null|\ Operation Failed with Exception -resume=\ - resume-FAILED-5001W|\ +REQUEST_FAILED_resume=\ + REQUEST-FAILED-resume-4001W|\ {0}|\ null|\ Operation Failed with Exception -pushManagerConfiguration=\ - pushManagerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_pushManagerConfiguration=\ + REQUEST-FAILED-pushManagerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -pollManagerConfiguration=\ - pollManagerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_pollManagerConfiguration=\ + REQUEST-FAILED-pollManagerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -managerConfiguration=\ - managerConfiguration-FAILED-5001W|\ +REQUEST_FAILED_managerConfiguration=\ + REQUEST-FAILED-managerConfiguration-4001W|\ {0}|\ null|\ Operation Failed with Exception -managerOperation=\ - managerOperation-FAILED-5001W|\ +REQUEST_FAILED_managerOperation=\ + REQUEST-FAILED-managerOperation-4001W|\ {0}|\ null|\ Operation Failed with Exception -updateConfigurationFromPolicy=\ - updateConfigurationFromPolicy-FAILED-5001W|\ +REQUEST_FAILED_updateConfigurationFromPolicy=\ + REQUEST-FAILED-updateConfigurationFromPolicy-4001W|\ {0}|\ null|\ Operation Failed with Exception -runHealthTests=\ - runHealthTests-FAILED-5001W|\ +REQUEST_FAILED_runHealthTests=\ + REQUEST-FAILED-runHealthTests-4001W|\ {0}|\ null|\ Operation Failed with Exception -REMOTE_deploy=\ - REMOTE-deploy-FAILED-5001W|\ +REMOTE_CALL_FAILED_deploy=\ + REMOTE-CALL-FAILED-deploy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_undeploy=\ - REMOTE-undeploy-FAILED-5001W|\ +REMOTE_CALL_FAILED_undeploy=\ + REMOTE-CALL-FAILED-undeploy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_test=\ - REMOTE-test-FAILED-5001W|\ +REMOTE_CALL_FAILED_test=\ + REMOTE-CALL-FAILED-test-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_suspend=\ - REMOTE-suspend-FAILED-5001W|\ +REMOTE_CALL_FAILED_suspend=\ + REMOTE-CALL-FAILED-suspend-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_resume=\ - REMOTE-resume-FAILED-5001W|\ +REMOTE_CALL_FAILED_resume=\ + REMOTE-CALL-FAILED-resume-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_pushManagerConfiguration=\ - REMOTE-pushManagerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_pushManagerConfiguration=\ + REMOTE-CALL-FAILED-pushManagerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_pollManagerConfiguration=\ - REMOTE-pollManagerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_pollManagerConfiguration=\ + REMOTE-CALL-FAILED-pollManagerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_managerConfiguration=\ - REMOTE-managerConfiguration-FAILED-5001W|\ +REMOTE_CALL_FAILED_managerConfiguration=\ + REMOTE-CALL-FAILED-managerConfiguration-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_managerOperation=\ - REMOTE-managerOperation-FAILED-5001W|\ +REMOTE_CALL_FAILED_managerOperation=\ + REMOTE-CALL-FAILED-managerOperation-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_updateConfigurationFromPolicy=\ - REMOTE-updateConfigurationFromPolicy-FAILED-5001W|\ +REMOTE_CALL_FAILED_updateConfigurationFromPolicy=\ + REMOTE-CALL-FAILED-updateConfigurationFromPolicy-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_runHealthTests=\ - REMOTE-runHealthTests-FAILED-5001W|\ +REMOTE_CALL_FAILED_runHealthTests=\ + REMOTE-CALL-FAILED-runHealthTests-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceMessageEnum.java index 314b50c..fd3d6ba 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceMessageEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceMessageEnum.java @@ -1,25 +1,4 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.docker.logging; import com.att.eelf.i18n.EELFResourceManager; @@ -28,30 +7,30 @@ import org.openecomp.logger.EcompMessageEnum; public enum DockerServiceMessageEnum 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; + REQUEST_FAILED_deploy, + REQUEST_FAILED_undeploy, + REQUEST_FAILED_test, + REQUEST_FAILED_suspend, + REQUEST_FAILED_resume, + REQUEST_FAILED_pushManagerConfiguration, + REQUEST_FAILED_pollManagerConfiguration, + REQUEST_FAILED_managerConfiguration, + REQUEST_FAILED_managerOperation, + REQUEST_FAILED_updateConfigurationFromPolicy, + REQUEST_FAILED_runHealthTests, + REMOTE_CALL_FAILED_deploy, + REMOTE_CALL_FAILED_undeploy, + REMOTE_CALL_FAILED_test, + REMOTE_CALL_FAILED_suspend, + REMOTE_CALL_FAILED_resume, + REMOTE_CALL_FAILED_pushManagerConfiguration, + REMOTE_CALL_FAILED_pollManagerConfiguration, + REMOTE_CALL_FAILED_managerConfiguration, + REMOTE_CALL_FAILED_managerOperation, + REMOTE_CALL_FAILED_updateConfigurationFromPolicy, + REMOTE_CALL_FAILED_runHealthTests; static { - EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.servers.docker.logging.DockerService"); + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/docker/logging/DockerService"); } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceOperationEnum.java index b72aabb..8747331 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceOperationEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/docker/logging/DockerServiceOperationEnum.java @@ -1,51 +1,32 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.docker.logging; import org.openecomp.entity.EcompOperationEnum; public enum DockerServiceOperationEnum 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; + DockerService_deploy("DockerService@deploy"), + DockerService_undeploy("DockerService@undeploy"), + DockerService_test("DockerService@test"), + DockerService_suspend("DockerService@suspend"), + DockerService_resume("DockerService@resume"), + DockerService_pushManagerConfiguration("DockerService@pushManagerConfiguration"), + DockerService_pollManagerConfiguration("DockerService@pollManagerConfiguration"), + DockerService_managerConfiguration("DockerService@managerConfiguration"), + DockerService_managerOperation("DockerService@managerOperation"), + DockerService_updateConfigurationFromPolicy("DockerService@updateConfigurationFromPolicy"), + DockerService_runHealthTests("DockerService@runHealthTests") ; + + + private String n; + + private DockerServiceOperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManager.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManager.java index 44682ed..5fa0758 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManager.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManager.java @@ -25,24 +25,34 @@ package org.openecomp.dcae.controller.service.servers.dockermanager; + + import java.io.InputStream; import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.SwaggerUtils; import org.openecomp.ncomp.sirius.function.FunctionUtils; import org.openecomp.ncomp.component.ApiRequestStatus; import org.apache.log4j.Logger; -import org.openecomp.logger.EcompLogger; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.json.JSONObject; import java.util.Date; import org.openecomp.dcae.controller.service.servers.dockermanager.logging.DockerManagerOperationEnum; +import org.openecomp.dcae.controller.service.servers.dockermanager.logging.DockerManagerMessageEnum; @@ -51,9 +61,9 @@ import org.openecomp.dcae.controller.service.dockermanager.impl.DockerManagerImp -public class DcaeDockerManager extends DockerManagerImpl { +public class DcaeDockerManager extends DockerManagerImpl implements ISiriusProvider { public static final Logger logger = Logger.getLogger(DcaeDockerManager.class); - static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DcaeDockerManagerProvider controller; ISiriusServer server; @@ -68,8 +78,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.test); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_test,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_test,"self:" + ManagementServer.object2ref(this)); try { res = controller.test(); } @@ -78,7 +88,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "test", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_test, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -93,8 +106,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.suspend); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_suspend,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_suspend,"self:" + ManagementServer.object2ref(this)); try { controller.suspend(); } @@ -103,7 +116,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "suspend", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_suspend, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -118,8 +134,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.resume); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_resume,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_resume,"self:" + ManagementServer.object2ref(this)); try { controller.resume(); } @@ -128,7 +144,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "resume", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_resume, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -143,8 +162,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.publicKey); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_publicKey,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_publicKey,"self:" + ManagementServer.object2ref(this)); try { res = controller.publicKey(); } @@ -153,7 +172,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "publicKey", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_publicKey, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_publicKey,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_publicKey, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -168,8 +190,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.configurationChanged); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_configurationChanged,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_configurationChanged,"self:" + ManagementServer.object2ref(this)); try { controller.configurationChanged(); } @@ -178,7 +200,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "configurationChanged", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_configurationChanged, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_configurationChanged,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_configurationChanged, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -193,8 +218,8 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.START, duration_,inputStreams,outputStreams); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.updateStreams); + ecomplogger.recordAuditEventStartIfNeeded(DockerManagerOperationEnum.DockerManager_updateStreams,server,this); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_updateStreams,"self:" + ManagementServer.object2ref(this)); try { controller.updateStreams(inputStreams,outputStreams); } @@ -203,7 +228,10 @@ public class DcaeDockerManager extends DockerManagerImpl { if (server != null) server.getServer().recordApi(null, this, "updateStreams", ApiRequestStatus.ERROR, duration_,inputStreams,outputStreams); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(DockerManagerMessageEnum.REQUEST_FAILED_updateStreams, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REQUEST_FAILED_updateStreams,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, DockerManagerMessageEnum.REQUEST_FAILED_updateStreams, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -217,10 +245,12 @@ public class DcaeDockerManager extends DockerManagerImpl { + + public static void ecoreSetup() { DcaeDockerManagerProvider.ecoreSetup(); } - public DcaeDockerManagerProvider getSomfProvider() { + public DcaeDockerManagerProvider getSiriusProvider() { return controller; } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerClient.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerClient.java index ef7b4f6..c463b7f 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerClient.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerClient.java @@ -30,6 +30,8 @@ import org.openecomp.ncomp.sirius.manager.GenericHttpClient; import org.apache.log4j.Logger; import org.openecomp.logger.EcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -54,33 +56,37 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { DcaeDockerManager.ecoreSetup(); client = new GenericHttpClient(file,name); client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeDockerManagerClient(String file, String name1, String name2) { HighAvailabilityClient client1 = new HighAvailabilityClient(file,name1,name2); client = client1.all; // requests should be forwarded to all. client.add("/resources", this); + client.setVersion("ONAP-R2"); } public DcaeDockerManagerClient(AbstractClient c) { client = c; client.add("/resources", this); + client.setVersion("ONAP-R2"); } @Override public org.openecomp.dcae.controller.core.service.HealthTestResponse test() { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_test); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_test,client.getRemote()); org.openecomp.dcae.controller.core.service.HealthTestResponse res; try { res = (org.openecomp.dcae.controller.core.service.HealthTestResponse) client.operationPath("/resources", c, "test", null); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_test, e.toString()); - throw new RuntimeException("remote call failed: test", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_test, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_test,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_test,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -88,16 +94,17 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { @Override public void suspend() { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_suspend); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_suspend,client.getRemote()); try { client.operationPath("/resources", c, "suspend", null); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_suspend, e.toString()); - throw new RuntimeException("remote call failed: suspend", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_suspend, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_suspend,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_suspend,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -105,16 +112,17 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { @Override public void resume() { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_resume); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_resume,client.getRemote()); try { client.operationPath("/resources", c, "resume", null); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_resume, e.toString()); - throw new RuntimeException("remote call failed: resume", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_resume, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_resume,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_resume,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -122,16 +130,17 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { @Override public java.lang.String publicKey() { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_publicKey); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_publicKey,client.getRemote()); java.lang.String res; try { res = (java.lang.String) client.operationPath("/resources", c, "publicKey", null); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_publicKey, e.toString()); - throw new RuntimeException("remote call failed: publicKey", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_publicKey, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_publicKey,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_publicKey,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -139,16 +148,17 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { @Override public void configurationChanged() { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_configurationChanged); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_configurationChanged,client.getRemote()); try { client.operationPath("/resources", c, "configurationChanged", null); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_configurationChanged, e.toString()); - throw new RuntimeException("remote call failed: configurationChanged", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_configurationChanged,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); @@ -156,16 +166,17 @@ public class DcaeDockerManagerClient extends DockerManagerImpl { @Override public void updateStreams(EList<org.openecomp.dcae.controller.core.stream.DcaeStream> inputStreams, EList<org.openecomp.dcae.controller.core.stream.DcaeStream> outputStreams) { - EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(DockerManagerOperationEnum.REMOTE_updateStreams); + EClass c = DockermanagerPackage.eINSTANCE.getDockerManager(); + ecomplogger.recordMetricEventStart(DockerManagerOperationEnum.DockerManager_updateStreams,client.getRemote()); try { client.operationPath("/resources", c, "updateStreams", null, inputStreams,outputStreams); } catch (Exception e) { - ecomplogger.warn(DockerManagerMessageEnum.REMOTE_updateStreams, e.toString()); - throw new RuntimeException("remote call failed: updateStreams", e); + ecomplogger.warn(DockerManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams, e.toString()); + EcompException e1 = EcompException.create(DockerManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,DockerManagerMessageEnum.REMOTE_CALL_FAILED_updateStreams,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerServer.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerServer.java index d121f93..bda0fa3 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerServer.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/DcaeDockerManagerServer.java @@ -26,17 +26,16 @@ package org.openecomp.dcae.controller.service.servers.dockermanager; import static org.openecomp.ncomp.utils.PropertyUtil.getPropertiesFromClasspath; import java.io.IOException; +import java.io.InputStream; import java.util.Properties; import java.util.TimeZone; import org.apache.log4j.Logger; import org.eclipse.emf.ecore.EFactory; - -import org.openecomp.entity.EcompComponent; -import org.openecomp.entity.EcompSubComponent; -import org.openecomp.entity.EcompSubComponentInstance; +import org.json.JSONObject; import org.openecomp.ncomp.sirius.manager.Jetty8Server; import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.IRequestHandler; import org.openecomp.ncomp.sirius.manager.ISiriusServer; import org.openecomp.dcae.controller.service.dockermanager.DockerManager; @@ -48,7 +47,7 @@ import org.openecomp.dcae.controller.service.servers.dockermanager.gui.DcaeModel -public class DcaeDockerManagerServer implements ISiriusServer { +public class DcaeDockerManagerServer implements ISiriusServer, IRequestHandler { public static final Logger logger = Logger.getLogger(DcaeDockerManagerServer.class); String serverPath; ManagementServer server; @@ -69,6 +68,7 @@ public class DcaeDockerManagerServer implements ISiriusServer { props = getPropertiesFromClasspath(filename); serverPath = (String) props.get("server.dir"); server = new ManagementServer(f, "DockerManager", serverPath, filename); + ManagementServer.setBuildVersion("ONAP-R2"); server.addFactory(f); server.addFactory(new org.openecomp.ncomp.servers.docker.DockerDockerFactory(this)); @@ -84,6 +84,7 @@ public class DcaeDockerManagerServer implements ISiriusServer { controller = (DcaeDockerManager) server.find("/").o; webServer = new Jetty8Server("dockermanager.properties"); webServer.add("/resources",server); + webServer.add("/api",this); @@ -112,4 +113,17 @@ public class DcaeDockerManagerServer implements ISiriusServer { public ManagementServer getServer() { return server; } + public Object handleJson(String userName, String action, String resourcePath, JSONObject json, JSONObject context, + String clientVersion) { + switch ((String) context.get("path")) { + case "/api/versions": + return server.supportedVersions(); + } + logger.warn("Unknown request action=" + action + " path=" + resourcePath + " context=" + context.toString(2)); + throw new RuntimeException("Unknown request"); + } + public Object handleBinary(String userName, String action, String resourcePath, InputStream in) { + return null; + } + } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApi.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApi.java index 27b1d24..fbb3769 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApi.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApi.java @@ -25,24 +25,34 @@ package org.openecomp.dcae.controller.service.servers.dockermanager.gui; + + import java.io.InputStream; import org.openecomp.ncomp.sirius.manager.IRequestHandler; +import org.openecomp.ncomp.sirius.manager.ISwaggerHandler; import org.openecomp.ncomp.sirius.manager.ISiriusPlugin; import org.openecomp.ncomp.sirius.manager.ISiriusServer; +import org.openecomp.ncomp.sirius.manager.ISiriusProvider; +import org.openecomp.ncomp.sirius.manager.ManagementServer; +import org.openecomp.ncomp.sirius.manager.SwaggerUtils; import org.openecomp.ncomp.sirius.function.FunctionUtils; import org.openecomp.ncomp.component.ApiRequestStatus; import org.apache.log4j.Logger; -import org.openecomp.logger.EcompLogger; +import org.openecomp.ncomp.sirius.manager.logging.NcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.json.JSONObject; import java.util.Date; import org.openecomp.dcae.controller.service.servers.dockermanager.gui.logging.GuiClientApiOperationEnum; +import org.openecomp.dcae.controller.service.servers.dockermanager.gui.logging.GuiClientApiMessageEnum; @@ -81,9 +91,9 @@ import org.openecomp.ncomp.gwt.siriusportal.model.impl.GuiClientApiImpl; -public class DcaeGuiClientApi extends GuiClientApiImpl { +public class DcaeGuiClientApi extends GuiClientApiImpl implements ISiriusProvider { public static final Logger logger = Logger.getLogger(DcaeGuiClientApi.class); - static final EcompLogger ecomplogger = EcompLogger.getEcompLogger(); + static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DcaeGuiClientApiProvider controller; ISiriusServer server; @@ -98,8 +108,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.START, duration_); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(GuiClientApiOperationEnum.getTree); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTree,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTree,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTree(); } @@ -108,7 +118,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getTree, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getTree,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getTree, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -123,8 +136,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.START, duration_,path); Date now_ = new Date(); - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(GuiClientApiOperationEnum.getObject); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getObject,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getObject,"self:" + ManagementServer.object2ref(this)); try { res = controller.getObject(path); } @@ -133,7 +146,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.ERROR, duration_,path); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getObject, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getObject,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getObject, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -148,8 +164,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { 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); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTimeSerie,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTimeSerie,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTimeSerie(path,start,end,duration); } @@ -158,7 +174,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.ERROR, duration_,path,start,end,duration); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getTimeSerie, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getTimeSerie,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getTimeSerie, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -173,8 +192,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { 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); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTable,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTable,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTable(path,start,end); } @@ -183,7 +202,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getTable, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getTable,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getTable, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -198,8 +220,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { 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); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getHtml,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getHtml,"self:" + ManagementServer.object2ref(this)); try { res = controller.getHtml(path,start,end); } @@ -208,7 +230,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getHtml, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getHtml,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getHtml, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -223,8 +248,8 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { 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); + ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getGraph,server,this); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getGraph,"self:" + ManagementServer.object2ref(this)); try { res = controller.getGraph(path,start,end); } @@ -233,7 +258,10 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { if (server != null) server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); - throw e; + ecomplogger.warn(GuiClientApiMessageEnum.REQUEST_FAILED_getGraph, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REQUEST_FAILED_getGraph,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR, GuiClientApiMessageEnum.REQUEST_FAILED_getGraph, e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); duration_ = new Date().getTime()-now_.getTime(); @@ -247,10 +275,12 @@ public class DcaeGuiClientApi extends GuiClientApiImpl { + + public static void ecoreSetup() { DcaeGuiClientApiProvider.ecoreSetup(); } - public DcaeGuiClientApiProvider getSomfProvider() { + public DcaeGuiClientApiProvider getSiriusProvider() { return controller; } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApiClient.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApiClient.java index 8ecfe4a..37816a0 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApiClient.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/DcaeGuiClientApiClient.java @@ -30,6 +30,8 @@ import org.openecomp.ncomp.sirius.manager.GenericHttpClient; import org.apache.log4j.Logger; import org.openecomp.logger.EcompLogger; +import org.openecomp.logger.StatusCodeEnum; +import org.openecomp.logger.EcompException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -55,33 +57,37 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { DcaeDockerManager.ecoreSetup(); client = new GenericHttpClient(file,name); client.add("/gui", this); + client.setVersion("ONAP-R2"); } 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); + client.setVersion("ONAP-R2"); } public DcaeGuiClientApiClient(AbstractClient c) { client = c; client.add("/resources", this); + client.setVersion("ONAP-R2"); } @Override public org.openecomp.ncomp.gwt.siriusportal.model.GuiTree getTree() { - EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); //foo - ecomplogger.recordMetricEventStart(); - ecomplogger.setOperation(GuiClientApiOperationEnum.REMOTE_getTree); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTree,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTree, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTree,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTree,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -89,16 +95,17 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { @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); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getObject,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getObject, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getObject,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getObject,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -106,16 +113,17 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { @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); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTimeSerie,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTimeSerie, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTimeSerie,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTimeSerie,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -123,16 +131,17 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { @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); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTable,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTable, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTable,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getTable,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -140,16 +149,17 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { @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); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getHtml,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getHtml, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getHtml,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getHtml,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; @@ -157,16 +167,17 @@ public class DcaeGuiClientApiClient extends GuiClientApiImpl { @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); + EClass c = ModelPackage.eINSTANCE.getGuiClientApi(); + ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getGraph,client.getRemote()); 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.warn(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getGraph, e.toString()); + EcompException e1 = EcompException.create(GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getGraph,e,e.getMessage()); + ecomplogger.recordMetricEventEnd(StatusCodeEnum.ERROR,GuiClientApiMessageEnum.REMOTE_CALL_FAILED_getGraph,e.getMessage()); + throw e1; } ecomplogger.recordMetricEventEnd(); return res; diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApi.properties b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApi.properties index 8705ab8..3822d29 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApi.properties +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApi.properties @@ -1,78 +1,78 @@ dummy=\ - null|\ + dummy-null|\ null|\ null|\ null -getTree=\ - getTree-FAILED-5001W|\ +REQUEST_FAILED_getTree=\ + REQUEST-FAILED-getTree-4001W|\ {0}|\ null|\ Operation Failed with Exception -getObject=\ - getObject-FAILED-5001W|\ +REQUEST_FAILED_getObject=\ + REQUEST-FAILED-getObject-4001W|\ {0}|\ null|\ Operation Failed with Exception -getTimeSerie=\ - getTimeSerie-FAILED-5001W|\ +REQUEST_FAILED_getTimeSerie=\ + REQUEST-FAILED-getTimeSerie-4001W|\ {0}|\ null|\ Operation Failed with Exception -getTable=\ - getTable-FAILED-5001W|\ +REQUEST_FAILED_getTable=\ + REQUEST-FAILED-getTable-4001W|\ {0}|\ null|\ Operation Failed with Exception -getHtml=\ - getHtml-FAILED-5001W|\ +REQUEST_FAILED_getHtml=\ + REQUEST-FAILED-getHtml-4001W|\ {0}|\ null|\ Operation Failed with Exception -getGraph=\ - getGraph-FAILED-5001W|\ +REQUEST_FAILED_getGraph=\ + REQUEST-FAILED-getGraph-4001W|\ {0}|\ null|\ Operation Failed with Exception -REMOTE_getTree=\ - REMOTE-getTree-FAILED-5001W|\ +REMOTE_CALL_FAILED_getTree=\ + REMOTE-CALL-FAILED-getTree-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getObject=\ - REMOTE-getObject-FAILED-5001W|\ +REMOTE_CALL_FAILED_getObject=\ + REMOTE-CALL-FAILED-getObject-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getTimeSerie=\ - REMOTE-getTimeSerie-FAILED-5001W|\ +REMOTE_CALL_FAILED_getTimeSerie=\ + REMOTE-CALL-FAILED-getTimeSerie-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getTable=\ - REMOTE-getTable-FAILED-5001W|\ +REMOTE_CALL_FAILED_getTable=\ + REMOTE-CALL-FAILED-getTable-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getHtml=\ - REMOTE-getHtml-FAILED-5001W|\ +REMOTE_CALL_FAILED_getHtml=\ + REMOTE-CALL-FAILED-getHtml-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_getGraph=\ - REMOTE-getGraph-FAILED-5001W|\ +REMOTE_CALL_FAILED_getGraph=\ + REMOTE-CALL-FAILED-getGraph-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiMessageEnum.java index 09155d6..a0b0926 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiMessageEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiMessageEnum.java @@ -1,25 +1,4 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.dockermanager.gui.logging; import com.att.eelf.i18n.EELFResourceManager; @@ -28,20 +7,20 @@ 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; + REQUEST_FAILED_getTree, + REQUEST_FAILED_getObject, + REQUEST_FAILED_getTimeSerie, + REQUEST_FAILED_getTable, + REQUEST_FAILED_getHtml, + REQUEST_FAILED_getGraph, + REMOTE_CALL_FAILED_getTree, + REMOTE_CALL_FAILED_getObject, + REMOTE_CALL_FAILED_getTimeSerie, + REMOTE_CALL_FAILED_getTable, + REMOTE_CALL_FAILED_getHtml, + REMOTE_CALL_FAILED_getGraph; static { - EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.servers.dockermanager.gui.logging.GuiClientApi"); + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApi"); } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiOperationEnum.java index 63edff6..f3df875 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiOperationEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/gui/logging/GuiClientApiOperationEnum.java @@ -1,41 +1,27 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.dockermanager.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; + GuiClientApi_getTree("GuiClientApi@getTree"), + GuiClientApi_getObject("GuiClientApi@getObject"), + GuiClientApi_getTimeSerie("GuiClientApi@getTimeSerie"), + GuiClientApi_getTable("GuiClientApi@getTable"), + GuiClientApi_getHtml("GuiClientApi@getHtml"), + GuiClientApi_getGraph("GuiClientApi@getGraph") ; + + + private String n; + + private GuiClientApiOperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager.properties b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager.properties index ef19f9b..4580ed4 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager.properties +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager.properties @@ -1,78 +1,78 @@ dummy=\ - null|\ + dummy-null|\ null|\ null|\ null -test=\ - test-FAILED-5001W|\ +REQUEST_FAILED_test=\ + REQUEST-FAILED-test-4001W|\ {0}|\ null|\ Operation Failed with Exception -suspend=\ - suspend-FAILED-5001W|\ +REQUEST_FAILED_suspend=\ + REQUEST-FAILED-suspend-4001W|\ {0}|\ null|\ Operation Failed with Exception -resume=\ - resume-FAILED-5001W|\ +REQUEST_FAILED_resume=\ + REQUEST-FAILED-resume-4001W|\ {0}|\ null|\ Operation Failed with Exception -publicKey=\ - publicKey-FAILED-5001W|\ +REQUEST_FAILED_publicKey=\ + REQUEST-FAILED-publicKey-4001W|\ {0}|\ null|\ Operation Failed with Exception -configurationChanged=\ - configurationChanged-FAILED-5001W|\ +REQUEST_FAILED_configurationChanged=\ + REQUEST-FAILED-configurationChanged-4001W|\ {0}|\ null|\ Operation Failed with Exception -updateStreams=\ - updateStreams-FAILED-5001W|\ +REQUEST_FAILED_updateStreams=\ + REQUEST-FAILED-updateStreams-4001W|\ {0}|\ null|\ Operation Failed with Exception -REMOTE_test=\ - REMOTE-test-FAILED-5001W|\ +REMOTE_CALL_FAILED_test=\ + REMOTE-CALL-FAILED-test-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_suspend=\ - REMOTE-suspend-FAILED-5001W|\ +REMOTE_CALL_FAILED_suspend=\ + REMOTE-CALL-FAILED-suspend-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_resume=\ - REMOTE-resume-FAILED-5001W|\ +REMOTE_CALL_FAILED_resume=\ + REMOTE-CALL-FAILED-resume-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_publicKey=\ - REMOTE-publicKey-FAILED-5001W|\ +REMOTE_CALL_FAILED_publicKey=\ + REMOTE-CALL-FAILED-publicKey-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_configurationChanged=\ - REMOTE-configurationChanged-FAILED-5001W|\ +REMOTE_CALL_FAILED_configurationChanged=\ + REMOTE-CALL-FAILED-configurationChanged-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception -REMOTE_updateStreams=\ - REMOTE-updateStreams-FAILED-5001W|\ +REMOTE_CALL_FAILED_updateStreams=\ + REMOTE-CALL-FAILED-updateStreams-4001W|\ {0}|\ null|\ Remote Operation Failed with Exception diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2.properties b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2.properties new file mode 100644 index 0000000..50c681f --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2.properties @@ -0,0 +1,12 @@ + +DOCKER_MANAGER_START_NEW_CRON=\ + DOCKER-MANAGER-START-NEW-CRON-2001I|\ + cmd={0} frequency={1}|\ + null|\ + Defining new cron job + +DOCKER_MANAGER_CRON_FAILURE=\ + DOCKER-MANAGER-CRON-FAILURE-4001W|\ + cmd={0} error={1}|\ + null|\ + Cron Operation Failed diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2MessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2MessageEnum.java new file mode 100644 index 0000000..165a11a --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2MessageEnum.java @@ -0,0 +1,15 @@ + +package org.openecomp.dcae.controller.service.servers.dockermanager.logging; + +import com.att.eelf.i18n.EELFResourceManager; +import org.openecomp.logger.EcompMessageEnum; + +public enum DockerManager2MessageEnum implements EcompMessageEnum { + + DOCKER_MANAGER_START_NEW_CRON, + DOCKER_MANAGER_CRON_FAILURE; + + static { + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2"); + } +} diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2OperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2OperationEnum.java new file mode 100644 index 0000000..8fc309a --- /dev/null +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager2OperationEnum.java @@ -0,0 +1,23 @@ + +package org.openecomp.dcae.controller.service.servers.dockermanager.logging; + +import org.openecomp.entity.EcompOperationEnum; + +public enum DockerManager2OperationEnum implements EcompOperationEnum { + + DOCKER_MANAGER_START_NEW_CRON("DOCKER-MANAGER-START-NEW-CRON"), + DOCKER_MANAGER_START_CRON_RUN("DOCKER-MANAGER-START-CRON-RUN") ; + + + private String n; + + private DockerManager2OperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + +} diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerMessageEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerMessageEnum.java index cc1ee62..6001677 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerMessageEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerMessageEnum.java @@ -1,25 +1,4 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.dockermanager.logging; import com.att.eelf.i18n.EELFResourceManager; @@ -28,20 +7,20 @@ import org.openecomp.logger.EcompMessageEnum; public enum DockerManagerMessageEnum implements EcompMessageEnum { dummy, - test, - suspend, - resume, - publicKey, - configurationChanged, - updateStreams, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_publicKey, - REMOTE_configurationChanged, - REMOTE_updateStreams; + REQUEST_FAILED_test, + REQUEST_FAILED_suspend, + REQUEST_FAILED_resume, + REQUEST_FAILED_publicKey, + REQUEST_FAILED_configurationChanged, + REQUEST_FAILED_updateStreams, + REMOTE_CALL_FAILED_test, + REMOTE_CALL_FAILED_suspend, + REMOTE_CALL_FAILED_resume, + REMOTE_CALL_FAILED_publicKey, + REMOTE_CALL_FAILED_configurationChanged, + REMOTE_CALL_FAILED_updateStreams; static { - EELFResourceManager.loadMessageBundle("org.openecomp.dcae.controller.service.servers.dockermanager.logging.DockerManager"); + EELFResourceManager.loadMessageBundle("org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManager"); } } diff --git a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerOperationEnum.java b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerOperationEnum.java index 835e2c6..bcb1120 100644 --- a/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerOperationEnum.java +++ b/dcae-controller-service-docker/dcae-controller-service-docker-adaptor/src/main/sirius-gen/org/openecomp/dcae/controller/service/servers/dockermanager/logging/DockerManagerOperationEnum.java @@ -1,41 +1,27 @@ -/*- - * ============LICENSE_START========================================== - * OPENECOMP - DCAE - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - */ - - package org.openecomp.dcae.controller.service.servers.dockermanager.logging; import org.openecomp.entity.EcompOperationEnum; public enum DockerManagerOperationEnum implements EcompOperationEnum { - test, - suspend, - resume, - publicKey, - configurationChanged, - updateStreams, - REMOTE_test, - REMOTE_suspend, - REMOTE_resume, - REMOTE_publicKey, - REMOTE_configurationChanged, - REMOTE_updateStreams; + DockerManager_test("DockerManager@test"), + DockerManager_suspend("DockerManager@suspend"), + DockerManager_resume("DockerManager@resume"), + DockerManager_publicKey("DockerManager@publicKey"), + DockerManager_configurationChanged("DockerManager@configurationChanged"), + DockerManager_updateStreams("DockerManager@updateStreams") ; + + + private String n; + + private DockerManagerOperationEnum(String n) { + this.n = n; + } + + @Override + public String toString() { + return n; + } + } |