/*- * ============LICENSE_START========================================== * OPENECOMP - DCAE * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END============================================ */ // Autogenerated // Do not edit. No need to extend this class. package org.openecomp.ncomp.servers.docker.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.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.ncomp.servers.docker.gui.logging.GuiClientApiOperationEnum; import org.openecomp.ncomp.servers.docker.gui.logging.GuiClientApiMessageEnum; import org.openecomp.ncomp.sirius.gui.tools.*; import org.openecomp.ncomp.gwt.siriusportal.model.*; import org.openecomp.ncomp.sirius.manager.Subject; import org.openecomp.ncomp.sirius.manager.ManagementServer; import org.openecomp.ncomp.sirius.manager.server.AbstractManagementServer; import org.openecomp.ncomp.gwt.siriusportal.model.impl.GuiClientApiImpl; public class DockerGuiClientApi extends GuiClientApiImpl implements ISiriusProvider { public static final Logger logger = Logger.getLogger(DockerGuiClientApi.class); static final NcompLogger ecomplogger = NcompLogger.getNcompLogger(); public DockerGuiClientApiProvider controller; ISiriusServer server; public DockerGuiClientApi(ISiriusServer server) { this.server = server; this.controller = new DockerGuiClientApiProvider(server,this); } public org.openecomp.ncomp.gwt.siriusportal.model.GuiTree getTree() { org.openecomp.ncomp.gwt.siriusportal.model.GuiTree res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.START, duration_); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTree,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTree,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTree(); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.ERROR, duration_); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getTree", ApiRequestStatus.OKAY, duration_); return res; } public org.openecomp.ncomp.gwt.siriusportal.model.GuiObject getObject(java.lang.String path) { org.openecomp.ncomp.gwt.siriusportal.model.GuiObject res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.START, duration_,path); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getObject,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getObject,"self:" + ManagementServer.object2ref(this)); try { res = controller.getObject(path); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.ERROR, duration_,path); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getObject", ApiRequestStatus.OKAY, duration_,path); return res; } public org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie getTimeSerie(java.lang.String path, java.lang.String start, java.lang.String end, java.lang.String duration) { org.openecomp.ncomp.gwt.siriusportal.model.GuiTimeSerie res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.START, duration_,path,start,end,duration); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTimeSerie,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTimeSerie,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTimeSerie(path,start,end,duration); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.ERROR, duration_,path,start,end,duration); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getTimeSerie", ApiRequestStatus.OKAY, duration_,path,start,end,duration); return res; } public org.openecomp.ncomp.gwt.siriusportal.model.GuiTable getTable(java.lang.String path, java.lang.String start, java.lang.String end) { org.openecomp.ncomp.gwt.siriusportal.model.GuiTable res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.START, duration_,path,start,end); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getTable,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getTable,"self:" + ManagementServer.object2ref(this)); try { res = controller.getTable(path,start,end); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getTable", ApiRequestStatus.OKAY, duration_,path,start,end); return res; } public org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml getHtml(java.lang.String path, java.lang.String start, java.lang.String end) { org.openecomp.ncomp.gwt.siriusportal.model.GuiHtml res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.START, duration_,path,start,end); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getHtml,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getHtml,"self:" + ManagementServer.object2ref(this)); try { res = controller.getHtml(path,start,end); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getHtml", ApiRequestStatus.OKAY, duration_,path,start,end); return res; } public org.openecomp.ncomp.sirius.manager.graph.GuiGraph getGraph(java.lang.String path, java.lang.String start, java.lang.String end) { org.openecomp.ncomp.sirius.manager.graph.GuiGraph res = null; long duration_ = 0; if (server != null) server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.START, duration_,path,start,end); Date now_ = new Date(); ecomplogger.recordAuditEventStartIfNeeded(GuiClientApiOperationEnum.GuiClientApi_getGraph,server,this); ecomplogger.recordMetricEventStart(GuiClientApiOperationEnum.GuiClientApi_getGraph,"self:" + ManagementServer.object2ref(this)); try { res = controller.getGraph(path,start,end); } catch (Exception e) { duration_ = new Date().getTime()-now_.getTime(); if (server != null) server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.ERROR, duration_,path,start,end); System.err.println("ERROR: " + e); 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(); if (server != null) server.getServer().recordApi(null, this, "getGraph", ApiRequestStatus.OKAY, duration_,path,start,end); return res; } public static void ecoreSetup() { DockerGuiClientApiProvider.ecoreSetup(); } public DockerGuiClientApiProvider getSiriusProvider() { return controller; } }