From fbca92eca2c35f2de13a03243cbb261e0aa03355 Mon Sep 17 00:00:00 2001 From: lizi Date: Tue, 10 Oct 2017 14:54:14 +0800 Subject: remove the integration catalog. Change-Id: I5b6b17b59dc0fb0707f425bb2893c56ba23c3bc4 Issue-ID: AAI-424 Signed-off-by: lizi --- integration/pom.xml | 124 ----------------- .../org/onap/aai/esr/bean/MsbRegisterBean.java | 100 -------------- .../org/onap/aai/esr/bean/ServiceNodeBean.java | 48 ------- .../java/org/onap/aai/esr/system/CommonUtil.java | 27 ---- .../java/org/onap/aai/esr/system/Constants.java | 20 --- .../org/onap/aai/esr/system/RegisterService.java | 147 --------------------- .../org/onap/aai/esr/system/SystemListener.java | 39 ------ integration/src/main/resources/logback.xml | 102 -------------- .../main/resources/portalConfig/msb_register.xml | 36 ----- integration/src/main/webapp/WEB-INF/web.xml | 25 ---- pom.xml | 1 - 11 files changed, 669 deletions(-) delete mode 100644 integration/pom.xml delete mode 100644 integration/src/main/java/org/onap/aai/esr/bean/MsbRegisterBean.java delete mode 100644 integration/src/main/java/org/onap/aai/esr/bean/ServiceNodeBean.java delete mode 100644 integration/src/main/java/org/onap/aai/esr/system/CommonUtil.java delete mode 100644 integration/src/main/java/org/onap/aai/esr/system/Constants.java delete mode 100644 integration/src/main/java/org/onap/aai/esr/system/RegisterService.java delete mode 100644 integration/src/main/java/org/onap/aai/esr/system/SystemListener.java delete mode 100644 integration/src/main/resources/logback.xml delete mode 100644 integration/src/main/resources/portalConfig/msb_register.xml delete mode 100644 integration/src/main/webapp/WEB-INF/web.xml diff --git a/integration/pom.xml b/integration/pom.xml deleted file mode 100644 index 868311c..0000000 --- a/integration/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - org.onap.aai.esr-gui - aai-esr-gui-parent - 1.0.0-SNAPSHOT - - - 4.0.0 - integration - war - esr-gui/integration - - - esr-gui - 1.1.2 - 1.7.6 - linux64 - win64 - target/assembly/${linux64id} - target/assembly/${win64id} - target/version - - - - - ch.qos.logback - logback-core - ${version.logback} - - - ch.qos.logback - logback-classic - ${version.logback} - - - ch.qos.logback - logback-access - ${version.logback} - - - org.slf4j - slf4j-api - ${version.slf4j} - - - javax.servlet - servlet-api - provided - 2.5 - - - dom4j - dom4j - 1.6.1 - - - net.sf.json-lib - json-lib - 2.1 - jdk15 - - - commons-httpclient - commons-httpclient - 3.1 - - - org.apache.httpcomponents - httpclient - 4.3.5 - - - org.onap.aai.esr-gui - common - 1.0.0-SNAPSHOT - war - - - org.onap.aai.esr-gui - portal - 1.0.0-SNAPSHOT - war - - - - - esr-gui - - - org.apache.maven.plugins - maven-war-plugin - - WEB-INF/web.xml - - - org.onap.aai.esr-gui - common - - - org.onap.aai.esr-gui - portal - - - - - - - diff --git a/integration/src/main/java/org/onap/aai/esr/bean/MsbRegisterBean.java b/integration/src/main/java/org/onap/aai/esr/bean/MsbRegisterBean.java deleted file mode 100644 index 4d60b02..0000000 --- a/integration/src/main/java/org/onap/aai/esr/bean/MsbRegisterBean.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.bean; - -import java.util.List; - -public class MsbRegisterBean { - private String serviceName = ""; - - private String version = ""; - - private String lb_policy = ""; - - private String url = ""; - - private String path = ""; - - private String protocol = ""; - - private String visualRange = ""; - - private List nodes; - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getLb_policy() { - return lb_policy; - } - - public void setLb_policy(String lb_policy) { - this.lb_policy = lb_policy; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public String getVisualRange() { - return visualRange; - } - - public void setVisualRange(String visualRange) { - this.visualRange = visualRange; - } - - public List getNodes() { - return nodes; - } - - public void setNodes(List nodes) { - this.nodes = nodes; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } -} diff --git a/integration/src/main/java/org/onap/aai/esr/bean/ServiceNodeBean.java b/integration/src/main/java/org/onap/aai/esr/bean/ServiceNodeBean.java deleted file mode 100644 index ce056ca..0000000 --- a/integration/src/main/java/org/onap/aai/esr/bean/ServiceNodeBean.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.bean; - -public class ServiceNodeBean { - private String ip = ""; - - private String port = ""; - - private int ttl = 0; - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - - public int getTtl() { - return ttl; - } - - public void setTtl(int ttl) { - this.ttl = ttl; - } -} diff --git a/integration/src/main/java/org/onap/aai/esr/system/CommonUtil.java b/integration/src/main/java/org/onap/aai/esr/system/CommonUtil.java deleted file mode 100644 index 2dd9315..0000000 --- a/integration/src/main/java/org/onap/aai/esr/system/CommonUtil.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.system; - -public class CommonUtil { - - public static boolean isEmpty(String str) { - if (null == str || "".equals(str.trim())) { - return true; - } else { - return false; - } - } -} diff --git a/integration/src/main/java/org/onap/aai/esr/system/Constants.java b/integration/src/main/java/org/onap/aai/esr/system/Constants.java deleted file mode 100644 index 720c1f8..0000000 --- a/integration/src/main/java/org/onap/aai/esr/system/Constants.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.system; - -public class Constants { - public final static String MARK_COLON = ":"; -} diff --git a/integration/src/main/java/org/onap/aai/esr/system/RegisterService.java b/integration/src/main/java/org/onap/aai/esr/system/RegisterService.java deleted file mode 100644 index 94d5c42..0000000 --- a/integration/src/main/java/org/onap/aai/esr/system/RegisterService.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.system; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.sf.json.JSONObject; - -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.apache.commons.httpclient.HttpStatus; -import org.dom4j.Document; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.onap.aai.esr.bean.MsbRegisterBean; -import org.onap.aai.esr.bean.ServiceNodeBean; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RegisterService { - - private final static Logger logger = LoggerFactory.getLogger(RegisterService.class); - - public static HashMap msbHostMap = new HashMap(); - public static List> registerList = new ArrayList>(); - - public static void registerMsb(String configPath) { - File inputXml = new File(configPath); - SAXReader saxReader = new SAXReader(); - - try { - Document document = saxReader.read(inputXml); - Element rootNode = document.getRootElement(); - getMsbHostInfo(rootNode); - getRegisterList(rootNode); - - String url = msbHostMap.get("hostIp") + Constants.MARK_COLON + msbHostMap.get("hostPort") + msbHostMap.get("msbApiRootDomain"); - for (int i = 0; i < registerList.size(); i++) { - HashMap registerInfo = registerList.get(i); - - ServiceNodeBean serviceNode = new ServiceNodeBean(); - serviceNode.setIp(registerInfo.get("ip")); - serviceNode.setPort(registerInfo.get("port")); - serviceNode.setTtl(Integer.valueOf(registerInfo.get("ttl"))); - List nodeList = new ArrayList(); - nodeList.add(serviceNode); - - MsbRegisterBean registerBean = new MsbRegisterBean(); - registerBean.setNodes(nodeList); - registerBean.setServiceName(registerInfo.get("serviceName")); - registerBean.setUrl(registerInfo.get("url")); - registerBean.setPath(registerInfo.get("path")); - registerBean.setProtocol(registerInfo.get("protocol")); - registerBean.setVisualRange(registerInfo.get("visualRange")); - registerBean.setLb_policy(registerInfo.get("lb_policy")); - - JSONObject registerObj = JSONObject.fromObject(registerBean); - String registerResponse = registerPortalService(registerBean.getServiceName(), url, registerObj, ""); - } - logger.info("open-o portal register task succeeded."); - } catch (Exception e){ - logger.error("open-o portal register task failed."); - logger.error(e.getMessage()); - } - } - - private static void getMsbHostInfo(Element rootNode) { - Element msbHostNode = rootNode.element("msbHost"); - Iterator iter = msbHostNode.elementIterator(); - - while (iter.hasNext()) { - Element element = (Element) iter.next(); - msbHostMap.put(element.getName(), element.getText()); - } - } - - private static void getRegisterList(Element rootNode) { - Element registerListNode = rootNode.element("registerList"); - Iterator iRegisterList = registerListNode.elementIterator(); - - while (iRegisterList.hasNext()) { - HashMap registerMap = new HashMap(); - Element registerInfo = (Element) iRegisterList.next(); - Iterator iRegisterInfo = registerInfo.elementIterator(); - - while (iRegisterInfo.hasNext()) { - Element element = (Element) iRegisterInfo.next(); - registerMap.put(element.getName(), element.getText()); - } - registerList.add(registerMap); - } - } - - private static String registerPortalService(String serviceName, String url, JSONObject json, String token) { - DefaultHttpClient client = new DefaultHttpClient(); - HttpPost post = new HttpPost(url); - String response = null; - - try { - if (null != json) { - StringEntity s = new StringEntity(json.toString()); - s.setContentEncoding("UTF-8"); - s.setContentType("application/json"); - post.setEntity(s); - } - if (!CommonUtil.isEmpty(token)) { - post.addHeader("X-Auth-Token", token); - } - HttpResponse res = client.execute(post); - if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK - || res.getStatusLine().getStatusCode() == HttpStatus.SC_CREATED) { - String result = EntityUtils.toString(res.getEntity()); - if (!CommonUtil.isEmpty(result)) { - response = result; - } else { - response = null; - } - } - logger.info("register task [" + serviceName + "] completed successfully."); - } catch (Exception e) { - logger.error("register task [" + serviceName + "] failed because of errors."); - logger.error(e.getMessage()); - } - - return response; - } -} diff --git a/integration/src/main/java/org/onap/aai/esr/system/SystemListener.java b/integration/src/main/java/org/onap/aai/esr/system/SystemListener.java deleted file mode 100644 index 9bc220c..0000000 --- a/integration/src/main/java/org/onap/aai/esr/system/SystemListener.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2017 ZTE Corporation. - * - * 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. - */ -package org.onap.aai.esr.system; - -import java.io.File; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SystemListener implements ServletContextListener { - - private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent servletContextEvent) { - logger.info("onap esr gui register task begin."); - String registerFilePath = SystemListener.class.getClassLoader().getResource("").getPath() + "portalConfig" + File.separator + "msb_register.xml"; - RegisterService.registerMsb(registerFilePath); - logger.info("onap esr gui register task ended."); - } -} diff --git a/integration/src/main/resources/logback.xml b/integration/src/main/resources/logback.xml deleted file mode 100644 index 31e6339..0000000 --- a/integration/src/main/resources/logback.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - - ERROR - ACCEPT - DENY - - - ${logDir}/error/error.%d{yyyy-MM}.log - ${maxHistory} - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - - WARN - ACCEPT - DENY - - - ${logDir}/warn/warn.%d{yyyy-MM}.log - ${maxHistory} - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - INFO - ACCEPT - DENY - - - ${logDir}/info/info.%d{yyyy-MM}.log - ${maxHistory} - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - DEBUG - ACCEPT - DENY - - - ${logDir}/debug/debug.%d{yyyy-MM}.log - ${maxHistory} - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - TRACE - ACCEPT - DENY - - - ${logDir}/trace/trace.%d{yyyy-MM}.log - ${maxHistory} - - - %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n - - - - - - - - - - - - - diff --git a/integration/src/main/resources/portalConfig/msb_register.xml b/integration/src/main/resources/portalConfig/msb_register.xml deleted file mode 100644 index df44754..0000000 --- a/integration/src/main/resources/portalConfig/msb_register.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - http://127.0.0.1 - 80 - /api/microservices/v1/services - - - - 127.0.0.1 - 8080 - /esr-gui - /iui/aai-esr-gui - aai-esr-gui - UI - 1 - hash - 0 - - - diff --git a/integration/src/main/webapp/WEB-INF/web.xml b/integration/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index b4ddd68..0000000 --- a/integration/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - ONAP Web Application - - login/index.html - - - org.onap.aai.esr.system.SystemListener - - diff --git a/pom.xml b/pom.xml index 275d273..5affbcd 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,6 @@ common portal - integration distribution -- cgit 1.2.3-korg