From d089cf2631c2d647b97977bff905a2bdbff93986 Mon Sep 17 00:00:00 2001 From: j180240 Date: Wed, 14 Sep 2016 15:00:54 +0800 Subject: upload the servicegateway code . Change-Id: I3fa83416412e9ef282bd03f45e011133965367c5 Signed-off-by: jiaxiangli --- servicegateway/deployment/pom.xml | 24 + .../deployment/src/main/release/bin/start.sh | 52 + .../deployment/src/main/release/bin/stop.sh | 15 + .../src/main/release/conf/catalina.policy | 248 ++ .../src/main/release/conf/catalina.properties | 133 + .../deployment/src/main/release/conf/context.xml | 21 + .../deployment/src/main/release/conf/server.xml | 92 + .../deployment/src/main/release/conf/web.xml | 4519 ++++++++++++++++++++ .../src/main/release/etc/conf/restclient.json | 11 + .../main/release/etc/framework/tracker.properties | 1 + .../main/release/etc/log4j/log4j-app.properties | 50 + .../src/main/release/etc/platformversion.xml | 5 + .../src/main/release/etc/register/service.json | 14 + .../src/main/release/init/post_install.sh | 20 + .../src/main/release/pub/app_define.json | 97 + .../release/pub/i18n/en_US/app_define.properties | 80 + .../release/pub/i18n/zh_CN/app_define.properties | 83 + .../main/release/pub/release_version.properties | 1 + .../deployment/src/main/release/upgrade/check.sh | 3 + .../deployment/src/main/release/upgrade/init.sh | 34 + servicegateway/pom.xml | 276 ++ servicegateway/service/pom.xml | 162 + .../gui/servicegateway/activator/Activator.java | 83 + .../gso/gui/servicegateway/constant/Constant.java | 139 + .../gui/servicegateway/exception/ErrorCode.java | 60 + .../gso/gui/servicegateway/exception/HttpCode.java | 86 + .../roa/impl/ServiceGatewayRoaModuleImpl.java | 93 + .../roa/inf/IServiceGatewayRoaModule.java | 73 + .../service/impl/ServiceGatewayImpl.java | 71 + .../service/inf/IServiceGateway.java | 55 + .../gso/gui/servicegateway/util/http/HttpUtil.java | 138 + .../servicegateway/util/http/ResponseUtils.java | 158 + .../gso/gui/servicegateway/util/json/JsonUtil.java | 133 + .../src/main/resources/META-INF/auth.properties | 18 + .../main/resources/service-configure.properties | 17 + .../service/src/main/resources/spring/service.xml | 96 + .../service/src/main/webapp/WEB-INF/web.xml | 33 + .../servicegateway/exception/ErrorCodeTest.java | 39 + .../gui/servicegateway/exception/HttpCodeTest.java | 47 + .../roa/impl/ServiceGatewayRoaModuleImplTest.java | 109 + .../service/impl/ServiceGatewayImplTest.java | 73 + 41 files changed, 7462 insertions(+) create mode 100644 servicegateway/deployment/pom.xml create mode 100644 servicegateway/deployment/src/main/release/bin/start.sh create mode 100644 servicegateway/deployment/src/main/release/bin/stop.sh create mode 100644 servicegateway/deployment/src/main/release/conf/catalina.policy create mode 100644 servicegateway/deployment/src/main/release/conf/catalina.properties create mode 100644 servicegateway/deployment/src/main/release/conf/context.xml create mode 100644 servicegateway/deployment/src/main/release/conf/server.xml create mode 100644 servicegateway/deployment/src/main/release/conf/web.xml create mode 100644 servicegateway/deployment/src/main/release/etc/conf/restclient.json create mode 100644 servicegateway/deployment/src/main/release/etc/framework/tracker.properties create mode 100644 servicegateway/deployment/src/main/release/etc/log4j/log4j-app.properties create mode 100644 servicegateway/deployment/src/main/release/etc/platformversion.xml create mode 100644 servicegateway/deployment/src/main/release/etc/register/service.json create mode 100644 servicegateway/deployment/src/main/release/init/post_install.sh create mode 100644 servicegateway/deployment/src/main/release/pub/app_define.json create mode 100644 servicegateway/deployment/src/main/release/pub/i18n/en_US/app_define.properties create mode 100644 servicegateway/deployment/src/main/release/pub/i18n/zh_CN/app_define.properties create mode 100644 servicegateway/deployment/src/main/release/pub/release_version.properties create mode 100644 servicegateway/deployment/src/main/release/upgrade/check.sh create mode 100644 servicegateway/deployment/src/main/release/upgrade/init.sh create mode 100644 servicegateway/pom.xml create mode 100644 servicegateway/service/pom.xml create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/activator/Activator.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/constant/Constant.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/ErrorCode.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/HttpCode.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/HttpUtil.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/ResponseUtils.java create mode 100644 servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/json/JsonUtil.java create mode 100644 servicegateway/service/src/main/resources/META-INF/auth.properties create mode 100644 servicegateway/service/src/main/resources/service-configure.properties create mode 100644 servicegateway/service/src/main/resources/spring/service.xml create mode 100644 servicegateway/service/src/main/webapp/WEB-INF/web.xml create mode 100644 servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/ErrorCodeTest.java create mode 100644 servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/HttpCodeTest.java create mode 100644 servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImplTest.java create mode 100644 servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java (limited to 'servicegateway') diff --git a/servicegateway/deployment/pom.xml b/servicegateway/deployment/pom.xml new file mode 100644 index 00000000..01a1af51 --- /dev/null +++ b/servicegateway/deployment/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + org.openo.gso.gui + servicegateway + 1.0.0-SNAPSHOT + + + deployment + deployment + jar + + + UTF-8 + + + + org.openo.common-services.common-utilities + commonlib-cbb + 1.0.1-SNAPSHOT + + + diff --git a/servicegateway/deployment/src/main/release/bin/start.sh b/servicegateway/deployment/src/main/release/bin/start.sh new file mode 100644 index 00000000..ffb45280 --- /dev/null +++ b/servicegateway/deployment/src/main/release/bin/start.sh @@ -0,0 +1,52 @@ +#!/bin/bash +#check user +CUR_PATH=$(cd `dirname $0`;pwd) +SCRIPT_PATH=$0 +IPMC_USER="`stat -c '%U' ${SCRIPT_PATH}`" +export IPMC_USER +CURRENT_USER="`/usr/bin/id -u -n`" +if [ "${IPMC_USER}" != "${CURRENT_USER}" ] +then + echo "only ${IPMC_USER} can execute this script." + exit 1 +fi + +umask 027 + +if [ -z "$JAVA_HOME" ] +then + echo "There is no JAVA_HOME" + exit 1 +fi + +if [ -z "$CATALINA_HOME" ] +then + echo "There is no CATALINA_HOME" + exit 1 +fi + +if [ -z "$APP_ROOT" ] +then + echo "There is no APP_ROOT" + exit 1 +fi + + + +export CATALINA_BASE=$APP_ROOT +export COMPLETE_PROCESS_NAME=$PROCESS_NAME-$NODE_ID-$PROCESS_SLOT +LOG_PATH=$_APP_LOG_DIR/$COMPLETE_PROCESS_NAME + +JAVA_OPTS="-Dfile.encoding=UTF-8" +JAVA_OPTS="$JAVA_OPTS -Dlog.dir=$LOG_PATH" +export TOMCAT_LOG_DIR=$_APP_LOG_DIR/$COMPLETE_PROCESS_NAME/tomcatlog +mkdir -p $TOMCAT_LOG_DIR +export TOMCAT_WORK_DIR=$_APP_SHARE_DIR/$COMPLETE_PROCESS_NAME/tomcatwork +export CATALINA_OUT=$TOMCAT_LOG_DIR/catalina.out +JAVA_OPTS="$JAVA_OPTS -DTOMCAT_LOG_DIR=$TOMCAT_LOG_DIR -DTOMCAT_WORK_DIR=$TOMCAT_WORK_DIR -DNFW=$COMPLETE_PROCESS_NAME -Dprocname=$COMPLETE_PROCESS_NAME " +export JAVA_OPTS="$JAVA_OPTS -server -Xms32m -Xmx256m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=64m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=62 -XX:-UseLargePages -XX:+UseFastAccessorMethods -XX:+CMSClassUnloadingEnabled -Dbsp.app.datasource=ServiceGatewaydb" +export LOGGING_CONFIG="-DNFW=$COMPLETE_PROCESS_NAME -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties" + +$CATALINA_HOME/bin/catalina.sh start + +result=0;$CUR_PATH/../../../../manager/agent/tools/shscript/syslogutils.sh "$(basename $0)" "$result" "Execute($#):$CUR_PATH/$0 $@";exit $result diff --git a/servicegateway/deployment/src/main/release/bin/stop.sh b/servicegateway/deployment/src/main/release/bin/stop.sh new file mode 100644 index 00000000..9ac855f0 --- /dev/null +++ b/servicegateway/deployment/src/main/release/bin/stop.sh @@ -0,0 +1,15 @@ +#!/bin/bash +#check user +CUR_PATH=$(cd `dirname $0`;pwd) +SCRIPT_PATH=$0 +IPMC_USER="`stat -c '%U' ${SCRIPT_PATH}`" +export IPMC_USER +CURRENT_USER="`/usr/bin/id -u -n`" +if [ "${IPMC_USER}" != "${CURRENT_USER}" ] +then + echo "only ${IPMC_USER} can execute this script." + exit 1 +fi +kill -9 $PID + +result=0;$CUR_PATH/../../../../manager/agent/tools/shscript/syslogutils.sh "$(basename $0)" "$result" "Execute($#):$CUR_PATH/$0 $@";exit $result diff --git a/servicegateway/deployment/src/main/release/conf/catalina.policy b/servicegateway/deployment/src/main/release/conf/catalina.policy new file mode 100644 index 00000000..244334e7 --- /dev/null +++ b/servicegateway/deployment/src/main/release/conf/catalina.policy @@ -0,0 +1,248 @@ +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You 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. + +// ============================================================================ +// catalina.policy - Security Policy Permissions for Tomcat 7 +// +// This file contains a default set of security policies to be enforced (by the +// JVM) when Catalina is executed with the "-security" option. In addition +// to the permissions granted here, the following additional permissions are +// granted to each web application: +// +// * Read access to the web application's document root directory +// * Read, write and delete access to the web application's working directory +// ============================================================================ + + +// ========== SYSTEM CODE PERMISSIONS ========================================= + + +// These permissions apply to javac +grant codeBase "file:${java.home}/lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions +grant codeBase "file:${java.home}/jre/lib/ext/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to javac when ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/../lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions when +// ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/lib/ext/-" { + permission java.security.AllPermission; +}; + + +// ========== CATALINA CODE PERMISSIONS ======================================= + + +// These permissions apply to the daemon code +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the logging API +// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home}, +// update this section accordingly. +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + permission java.io.FilePermission + "${java.home}${file.separator}lib${file.separator}logging.properties", "read"; + + permission java.io.FilePermission + "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs", "read, write"; + permission java.io.FilePermission + "${catalina.base}${file.separator}logs${file.separator}*", "read, write"; + + permission java.lang.RuntimePermission "shutdownHooks"; + permission java.lang.RuntimePermission "getClassLoader"; + permission java.lang.RuntimePermission "setContextClassLoader"; + + permission java.util.logging.LoggingPermission "control"; + + permission java.util.PropertyPermission "java.util.logging.config.class", "read"; + permission java.util.PropertyPermission "java.util.logging.config.file", "read"; + permission java.util.PropertyPermission "org.apache.juli.ClassLoaderLogManager.debug", "read"; + permission java.util.PropertyPermission "catalina.base", "read"; + + // Note: To enable per context logging configuration, permit read access to + // the appropriate file. Be sure that the logging configuration is + // secure before enabling such access. + // E.g. for the examples web application (uncomment and unwrap + // the following to be on a single line): + // permission java.io.FilePermission "${catalina.base}${file.separator} + // webapps${file.separator}examples${file.separator}WEB-INF + // ${file.separator}classes${file.separator}logging.properties", "read"; +}; + +// These permissions apply to the server startup code +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the servlet API classes +// and those that are shared across all class loaders +// located in the "lib" directory +grant codeBase "file:${catalina.home}/lib/-" { + permission java.security.AllPermission; +}; + + +// If using a per instance lib directory, i.e. ${catalina.base}/lib, +// then the following permission will need to be uncommented +// grant codeBase "file:${catalina.base}/lib/-" { +// permission java.security.AllPermission; +// }; + + +// ========== WEB APPLICATION PERMISSIONS ===================================== + + +// These permissions are granted by default to all web applications +// In addition, a web application will be given a read FilePermission +// and JndiPermission for all files and directories in its document root. +grant { + // Required for JNDI lookup of named JDBC DataSource's and + // javamail named MimePart DataSource used to send mail + permission java.util.PropertyPermission "java.home", "read"; + permission java.util.PropertyPermission "java.naming.*", "read"; + permission java.util.PropertyPermission "javax.sql.*", "read"; + + // OS Specific properties to allow read access + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + // JVM properties to allow read access + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + // Required for OpenJMX + permission java.lang.RuntimePermission "getAttribute"; + + // Allow read of JAXP compliant XML parser debug + permission java.util.PropertyPermission "jaxp.debug", "read"; + + // All JSPs need to be able to read this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat"; + + // Precompiled JSPs need access to these packages. + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; + permission java.lang.RuntimePermission + "accessClassInPackage.org.apache.jasper.runtime.*"; + + // Precompiled JSPs need access to these system properties. + permission java.util.PropertyPermission + "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read"; + permission java.util.PropertyPermission + "org.apache.el.parser.COERCE_TO_ZERO", "read"; + + // The cookie code needs these. + permission java.util.PropertyPermission + "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read"; + permission java.util.PropertyPermission + "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read"; + permission java.util.PropertyPermission + "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read"; + + // Applications using Comet need to be able to access this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.comet"; + + // Applications using the legacy WebSocket implementation need to be able to access this package + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.websocket"; + + // Applications using the JSR-356 WebSocket implementation need to be able to access these packages + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.websocket.server"; +}; + + +// The Manager application needs access to the following packages to support the +// session display functionality. These settings support the following +// configurations: +// - default CATALINA_HOME == CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME +grant codeBase "file:${catalina.base}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; +}; +grant codeBase "file:${catalina.home}/webapps/manager/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util"; +}; + +// You can assign additional permissions to particular web applications by +// adding additional "grant" entries here, based on the code base for that +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. +// +// Different permissions can be granted to JSP pages, classes loaded from +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ +// directory, or even to individual jar files in the /WEB-INF/lib/ directory. +// +// For instance, assume that the standard "examples" application +// included a JDBC driver that needed to establish a network connection to the +// corresponding database and used the scrape taglib to get the weather from +// the NOAA web server. You might create a "grant" entries like this: +// +// The permissions granted to the context root directory apply to JSP pages. +// grant codeBase "file:${catalina.base}/webapps/examples/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; +// +// The permissions granted to the context WEB-INF/classes directory +// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { +// }; +// +// The permission granted to your JDBC driver +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// }; +// The permission granted to the scrape taglib +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; + diff --git a/servicegateway/deployment/src/main/release/conf/catalina.properties b/servicegateway/deployment/src/main/release/conf/catalina.properties new file mode 100644 index 00000000..ef375e1d --- /dev/null +++ b/servicegateway/deployment/src/main/release/conf/catalina.properties @@ -0,0 +1,133 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,\ +org.apache.naming.resources.,org.apache.tomcat. +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, no packages are restricted for definition, and none of +# the class loaders supplied with the JDK call checkPackageDefinition. +# +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,\ +org.apache.jasper.,org.apache.naming.,org.apache.tomcat. + +# +# +# List of comma-separated paths defining the contents of the "common" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank,the JVM system loader will be used as Catalina's "common" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar + +# +# List of comma-separated paths defining the contents of the "server" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank, the "common" loader will be used as Catalina's "server" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +server.loader= + +# +# List of comma-separated paths defining the contents of the "shared" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, +# the "common" loader will be used as Catalina's "shared" loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# Please note that for single jars, e.g. bar.jar, you need the URL form +# starting with file:. +shared.loader= + +# List of JAR files that should not be scanned using the JarScanner +# functionality. This is typically used to scan JARs for configuration +# information. JARs that do not contain such information may be excluded from +# the scan to speed up the scanning process. This is the default list. JARs on +# this list are excluded from all scans. Scan specific lists (to exclude JARs +# from individual scans) follow this. The list must be a comma separated list of +# JAR file names. +# The JARs listed below include: +# - Tomcat Bootstrap JARs +# - Tomcat API JARs +# - Catalina JARs +# - Jasper JARs +# - Tomcat JARs +# - Common non-Tomcat JARs +# - Test JARs (JUnit, Cobertura and dependencies) +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\ +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\ +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,websocket-api.jar,\ +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\ +jasper.jar,jasper-el.jar,ecj-*.jar,\ +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\ +tomcat-jni.jar,tomcat-spdy.jar,\ +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\ +tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,\ +tomcat-jdbc.jar,\ +tools.jar,\ +commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,\ +commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,\ +commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,\ +commons-math*.jar,commons-pool*.jar,\ +jstl.jar,\ +geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\ +ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\ +jmx-tools.jar,jta*.jar,log4j.jar,log4j-1*.jar,mail*.jar,slf4j*.jar,\ +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\ +junit.jar,junit-*.jar,hamcrest*.jar,org.hamcrest*.jar,ant-launcher.jar,\ +cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar,\ +jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,\ +xom-*.jar + +# Additional JARs (over and above the default JARs listed above) to skip when +# scanning for Servlet 3.0 pluggability features. These features include web +# fragments, annotations, SCIs and classes that match @HandlesTypes. The list +# must be a comma separated list of JAR file names. +org.apache.catalina.startup.ContextConfig.jarsToSkip= + +# Additional JARs (over and above the default JARs listed above) to skip when +# scanning for TLDs. The list must be a comma separated list of JAR file names. +org.apache.catalina.startup.TldConfig.jarsToSkip=tomcat7-websocket.jar + +# +# String cache configuration. +tomcat.util.buf.StringCache.byte.enabled=true +#tomcat.util.buf.StringCache.char.enabled=true +#tomcat.util.buf.StringCache.trainThreshold=500000 +#tomcat.util.buf.StringCache.cacheSize=5000 diff --git a/servicegateway/deployment/src/main/release/conf/context.xml b/servicegateway/deployment/src/main/release/conf/context.xml new file mode 100644 index 00000000..79ad60d5 --- /dev/null +++ b/servicegateway/deployment/src/main/release/conf/context.xml @@ -0,0 +1,21 @@ + + + + + + + WEB-INF/web.xml + + + + + + + + \ No newline at end of file diff --git a/servicegateway/deployment/src/main/release/conf/server.xml b/servicegateway/deployment/src/main/release/conf/server.xml new file mode 100644 index 00000000..ffd05e81 --- /dev/null +++ b/servicegateway/deployment/src/main/release/conf/server.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/servicegateway/deployment/src/main/release/conf/web.xml b/servicegateway/deployment/src/main/release/conf/web.xml new file mode 100644 index 00000000..c7636006 --- /dev/null +++ b/servicegateway/deployment/src/main/release/conf/web.xml @@ -0,0 +1,4519 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + org.apache.catalina.servlets.DefaultServlet + + debug + 0 + + + listings + false + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + / + + + + + jsp + *.jsp + *.jspx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + + + 123 + application/vnd.lotus-1-2-3 + + + 3dml + text/vnd.in3d.3dml + + + 3ds + image/x-3ds + + + 3g2 + video/3gpp2 + + + 3gp + video/3gpp + + + 7z + application/x-7z-compressed + + + aab + application/x-authorware-bin + + + aac + audio/x-aac + + + aam + application/x-authorware-map + + + aas + application/x-authorware-seg + + + abs + audio/x-mpeg + + + abw + application/x-abiword + + + ac + application/pkix-attr-cert + + + acc + application/vnd.americandynamics.acc + + + ace + application/x-ace-compressed + + + acu + application/vnd.acucobol + + + acutc + application/vnd.acucorp + + + adp + audio/adpcm + + + aep + application/vnd.audiograph + + + afm + application/x-font-type1 + + + afp + application/vnd.ibm.modcap + + + ahead + application/vnd.ahead.space + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + air + application/vnd.adobe.air-application-installer-package+zip + + + ait + application/vnd.dvb.ait + + + ami + application/vnd.amiga.ami + + + anx + application/annodex + + + apk + application/vnd.android.package-archive + + + appcache + text/cache-manifest + + + application + application/x-ms-application + + + apr + application/vnd.lotus-approach + + + arc + application/x-freearc + + + art + image/x-jg + + + asc + application/pgp-signature + + + asf + video/x-ms-asf + + + asm + text/x-asm + + + aso + application/vnd.accpac.simply.aso + + + asx + video/x-ms-asf + + + atc + application/vnd.acucorp + + + atom + application/atom+xml + + + atomcat + application/atomcat+xml + + + atomsvc + application/atomsvc+xml + + + atx + application/vnd.antix.game-component + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + aw + application/applixware + + + axa + audio/annodex + + + axv + video/annodex + + + azf + application/vnd.airzip.filesecure.azf + + + azs + application/vnd.airzip.filesecure.azs + + + azw + application/vnd.amazon.ebook + + + bat + application/x-msdownload + + + bcpio + application/x-bcpio + + + bdf + application/x-font-bdf + + + bdm + application/vnd.syncml.dm+wbxml + + + bed + application/vnd.realvnc.bed + + + bh2 + application/vnd.fujitsu.oasysprs + + + bin + application/octet-stream + + + blb + application/x-blorb + + + blorb + application/x-blorb + + + bmi + application/vnd.bmi + + + bmp + image/bmp + + + body + text/html + + + book + application/vnd.framemaker + + + box + application/vnd.previewsystems.box + + + boz + application/x-bzip2 + + + bpk + application/octet-stream + + + btif + image/prs.btif + + + bz + application/x-bzip + + + bz2 + application/x-bzip2 + + + c + text/x-c + + + c11amc + application/vnd.cluetrust.cartomobile-config + + + c11amz + application/vnd.cluetrust.cartomobile-config-pkg + + + c4d + application/vnd.clonk.c4group + + + c4f + application/vnd.clonk.c4group + + + c4g + application/vnd.clonk.c4group + + + c4p + application/vnd.clonk.c4group + + + c4u + application/vnd.clonk.c4group + + + cab + application/vnd.ms-cab-compressed + + + caf + audio/x-caf + + + cap + application/vnd.tcpdump.pcap + + + car + application/vnd.curl.car + + + cat + application/vnd.ms-pki.seccat + + + cb7 + application/x-cbr + + + cba + application/x-cbr + + + cbr + application/x-cbr + + + cbt + application/x-cbr + + + cbz + application/x-cbr + + + cc + text/x-c + + + cct + application/x-director + + + ccxml + application/ccxml+xml + + + cdbcmsg + application/vnd.contact.cmsg + + + cdf + application/x-cdf + + + cdkey + application/vnd.mediastation.cdkey + + + cdmia + application/cdmi-capability + + + cdmic + application/cdmi-container + + + cdmid + application/cdmi-domain + + + cdmio + application/cdmi-object + + + cdmiq + application/cdmi-queue + + + cdx + chemical/x-cdx + + + cdxml + application/vnd.chemdraw+xml + + + cdy + application/vnd.cinderella + + + cer + application/pkix-cert + + + cfs + application/x-cfs-compressed + + + cgm + image/cgm + + + chat + application/x-chat + + + chm + application/vnd.ms-htmlhelp + + + chrt + application/vnd.kde.kchart + + + cif + chemical/x-cif + + + cii + application/vnd.anser-web-certificate-issue-initiation + + + cil + application/vnd.ms-artgalry + + + cla + application/vnd.claymore + + + class + application/java + + + clkk + application/vnd.crick.clicker.keyboard + + + clkp + application/vnd.crick.clicker.palette + + + clkt + application/vnd.crick.clicker.template + + + clkw + application/vnd.crick.clicker.wordbank + + + clkx + application/vnd.crick.clicker + + + clp + application/x-msclip + + + cmc + application/vnd.cosmocaller + + + cmdf + chemical/x-cmdf + + + cml + chemical/x-cml + + + cmp + application/vnd.yellowriver-custom-menu + + + cmx + image/x-cmx + + + cod + application/vnd.rim.cod + + + com + application/x-msdownload + + + conf + text/plain + + + cpio + application/x-cpio + + + cpp + text/x-c + + + cpt + application/mac-compactpro + + + crd + application/x-mscardfile + + + crl + application/pkix-crl + + + crt + application/x-x509-ca-cert + + + cryptonote + application/vnd.rig.cryptonote + + + csh + application/x-csh + + + csml + chemical/x-csml + + + csp + application/vnd.commonspace + + + css + text/css + + + cst + application/x-director + + + csv + text/csv + + + cu + application/cu-seeme + + + curl + text/vnd.curl + + + cww + application/prs.cww + + + cxt + application/x-director + + + cxx + text/x-c + + + dae + model/vnd.collada+xml + + + daf + application/vnd.mobius.daf + + + dart + application/vnd.dart + + + dataless + application/vnd.fdsn.seed + + + davmount + application/davmount+xml + + + dbk + application/docbook+xml + + + dcr + application/x-director + + + dcurl + text/vnd.curl.dcurl + + + dd2 + application/vnd.oma.dd2+xml + + + ddd + application/vnd.fujixerox.ddd + + + deb + application/x-debian-package + + + def + text/plain + + + deploy + application/octet-stream + + + der + application/x-x509-ca-cert + + + dfac + application/vnd.dreamfactory + + + dgc + application/x-dgc-compressed + + + dib + image/bmp + + + dic + text/x-c + + + dir + application/x-director + + + dis + application/vnd.mobius.dis + + + dist + application/octet-stream + + + distz + application/octet-stream + + + djv + image/vnd.djvu + + + djvu + image/vnd.djvu + + + dll + application/x-msdownload + + + dmg + application/x-apple-diskimage + + + dmp + application/vnd.tcpdump.pcap + + + dms + application/octet-stream + + + dna + application/vnd.dna + + + doc + application/msword + + + docm + application/vnd.ms-word.document.macroenabled.12 + + + docx + application/vnd.openxmlformats-officedocument.wordprocessingml.document + + + dot + application/msword + + + dotm + application/vnd.ms-word.template.macroenabled.12 + + + dotx + application/vnd.openxmlformats-officedocument.wordprocessingml.template + + + dp + application/vnd.osgi.dp + + + dpg + application/vnd.dpgraph + + + dra + audio/vnd.dra + + + dsc + text/prs.lines.tag + + + dssc + application/dssc+der + + + dtb + application/x-dtbook+xml + + + dtd + application/xml-dtd + + + dts + audio/vnd.dts + + + dtshd + audio/vnd.dts.hd + + + dump + application/octet-stream + + + dv + video/x-dv + + + dvb + video/vnd.dvb.file + + + dvi + application/x-dvi + + + dwf + model/vnd.dwf + + + dwg + image/vnd.dwg + + + dxf + image/vnd.dxf + + + dxp + application/vnd.spotfire.dxp + + + dxr + application/x-director + + + ecelp4800 + audio/vnd.nuera.ecelp4800 + + + ecelp7470 + audio/vnd.nuera.ecelp7470 + + + ecelp9600 + audio/vnd.nuera.ecelp9600 + + + ecma + application/ecmascript + + + edm + application/vnd.novadigm.edm + + + edx + application/vnd.novadigm.edx + + + efif + application/vnd.picsel + + + ei6 + application/vnd.pg.osasli + + + elc + application/octet-stream + + + emf + application/x-msmetafile + + + eml + message/rfc822 + + + emma + application/emma+xml + + + emz + application/x-msmetafile + + + eol + audio/vnd.digital-winds + + + eot + application/vnd.ms-fontobject + + + eps + application/postscript + + + epub + application/epub+zip + + + es3 + application/vnd.eszigno3+xml + + + esa + application/vnd.osgi.subsystem + + + esf + application/vnd.epson.esf + + + et3 + application/vnd.eszigno3+xml + + + etx + text/x-setext + + + eva + application/x-eva + + + evy + application/x-envoy + + + exe + application/octet-stream + + + exi + application/exi + + + ext + application/vnd.novadigm.ext + + + ez + application/andrew-inset + + + ez2 + application/vnd.ezpix-album + + + ez3 + application/vnd.ezpix-package + + + f + text/x-fortran + + + f4v + video/x-f4v + + + f77 + text/x-fortran + + + f90 + text/x-fortran + + + fbs + image/vnd.fastbidsheet + + + fcdt + application/vnd.adobe.formscentral.fcdt + + + fcs + application/vnd.isac.fcs + + + fdf + application/vnd.fdf + + + fe_launch + application/vnd.denovo.fcselayout-link + + + fg5 + application/vnd.fujitsu.oasysgp + + + fgd + application/x-director + + + fh + image/x-freehand + + + fh4 + image/x-freehand + + + fh5 + image/x-freehand + + + fh7 + image/x-freehand + + + fhc + image/x-freehand + + + fig + application/x-xfig + + + flac + audio/flac + + + fli + video/x-fli + + + flo + application/vnd.micrografx.flo + + + flv + video/x-flv + + + flw + application/vnd.kde.kivio + + + flx + text/vnd.fmi.flexstor + + + fly + text/vnd.fly + + + fm + application/vnd.framemaker + + + fnc + application/vnd.frogans.fnc + + + for + text/x-fortran + + + fpx + image/vnd.fpx + + + frame + application/vnd.framemaker + + + fsc + application/vnd.fsc.weblaunch + + + fst + image/vnd.fst + + + ftc + application/vnd.fluxtime.clip + + + fti + application/vnd.anser-web-funds-transfer-initiation + + + fvt + video/vnd.fvt + + + fxp + application/vnd.adobe.fxp + + + fxpl + application/vnd.adobe.fxp + + + fzs + application/vnd.fuzzysheet + + + g2w + application/vnd.geoplan + + + g3 + image/g3fax + + + g3w + application/vnd.geospace + + + gac + application/vnd.groove-account + + + gam + application/x-tads + + + gbr + application/rpki-ghostbusters + + + gca + application/x-gca-compressed + + + gdl + model/vnd.gdl + + + geo + application/vnd.dynageo + + + gex + application/vnd.geometry-explorer + + + ggb + application/vnd.geogebra.file + + + ggt + application/vnd.geogebra.tool + + + ghf + application/vnd.groove-help + + + gif + image/gif + + + gim + application/vnd.groove-identity-message + + + gml + application/gml+xml + + + gmx + application/vnd.gmx + + + gnumeric + application/x-gnumeric + + + gph + application/vnd.flographit + + + gpx + application/gpx+xml + + + gqf + application/vnd.grafeq + + + gqs + application/vnd.grafeq + + + gram + application/srgs + + + gramps + application/x-gramps-xml + + + gre + application/vnd.geometry-explorer + + + grv + application/vnd.groove-injector + + + grxml + application/srgs+xml + + + gsf + application/x-font-ghostscript + + + gtar + application/x-gtar + + + gtm + application/vnd.groove-tool-message + + + gtw + model/vnd.gtw + + + gv + text/vnd.graphviz + + + gxf + application/gxf + + + gxt + application/vnd.geonext + + + gz + application/x-gzip + + + h + text/x-c + + + h261 + video/h261 + + + h263 + video/h263 + + + h264 + video/h264 + + + hal + application/vnd.hal+xml + + + hbci + application/vnd.hbci + + + hdf + application/x-hdf + + + hh + text/x-c + + + hlp + application/winhlp + + + hpgl + application/vnd.hp-hpgl + + + hpid + application/vnd.hp-hpid + + + hps + application/vnd.hp-hps + + + hqx + application/mac-binhex40 + + + htc + text/x-component + + + htke + application/vnd.kenameaapp + + + htm + text/html + + + html + text/html + + + hvd + application/vnd.yamaha.hv-dic + + + hvp + application/vnd.yamaha.hv-voice + + + hvs + application/vnd.yamaha.hv-script + + + i2g + application/vnd.intergeo + + + icc + application/vnd.iccprofile + + + ice + x-conference/x-cooltalk + + + icm + application/vnd.iccprofile + + + ico + image/x-icon + + + ics + text/calendar + + + ief + image/ief + + + ifb + text/calendar + + + ifm + application/vnd.shana.informed.formdata + + + iges + model/iges + + + igl + application/vnd.igloader + + + igm + application/vnd.insors.igm + + + igs + model/iges + + + igx + application/vnd.micrografx.igx + + + iif + application/vnd.shana.informed.interchange + + + imp + application/vnd.accpac.simply.imp + + + ims + application/vnd.ms-ims + + + in + text/plain + + + ink + application/inkml+xml + + + inkml + application/inkml+xml + + + install + application/x-install-instructions + + + iota + application/vnd.astraea-software.iota + + + ipfix + application/ipfix + + + ipk + application/vnd.shana.informed.package + + + irm + application/vnd.ibm.rights-management + + + irp + application/vnd.irepository.package+xml + + + iso + application/x-iso9660-image + + + itp + application/vnd.shana.informed.formtemplate + + + ivp + application/vnd.immervision-ivp + + + ivu + application/vnd.immervision-ivu + + + jad + text/vnd.sun.j2me.app-descriptor + + + jam + application/vnd.jam + + + jar + application/java-archive + + + java + text/x-java-source + + + jisp + application/vnd.jisp + + + jlt + application/vnd.hp-jlyt + + + jnlp + application/x-java-jnlp-file + + + joda + application/vnd.joost.joda-archive + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + jpgm + video/jpm + + + jpgv + video/jpeg + + + jpm + video/jpm + + + js + application/javascript + + + jsf + text/plain + + + json + application/json + + + jsonml + application/jsonml+json + + + jspf + text/plain + + + kar + audio/midi + + + karbon + application/vnd.kde.karbon + + + kfo + application/vnd.kde.kformula + + + kia + application/vnd.kidspiration + + + kml + application/vnd.google-earth.kml+xml + + + kmz + application/vnd.google-earth.kmz + + + kne + application/vnd.kinar + + + knp + application/vnd.kinar + + + kon + application/vnd.kde.kontour + + + kpr + application/vnd.kde.kpresenter + + + kpt + application/vnd.kde.kpresenter + + + kpxx + application/vnd.ds-keypoint + + + ksp + application/vnd.kde.kspread + + + ktr + application/vnd.kahootz + + + ktx + image/ktx + + + ktz + application/vnd.kahootz + + + kwd + application/vnd.kde.kword + + + kwt + application/vnd.kde.kword + + + lasxml + application/vnd.las.las+xml + + + latex + application/x-latex + + + lbd + application/vnd.llamagraphics.life-balance.desktop + + + lbe + application/vnd.llamagraphics.life-balance.exchange+xml + + + les + application/vnd.hhe.lesson-player + + + lha + application/x-lzh-compressed + + + link66 + application/vnd.route66.link66+xml + + + list + text/plain + + + list3820 + application/vnd.ibm.modcap + + + listafp + application/vnd.ibm.modcap + + + lnk + application/x-ms-shortcut + + + log + text/plain + + + lostxml + application/lost+xml + + + lrf + application/octet-stream + + + lrm + application/vnd.ms-lrm + + + ltf + application/vnd.frogans.ltf + + + lvp + audio/vnd.lucent.voice + + + lwp + application/vnd.lotus-wordpro + + + lzh + application/x-lzh-compressed + + + m13 + application/x-msmediaview + + + m14 + application/x-msmediaview + + + m1v + video/mpeg + + + m21 + application/mp21 + + + m2a + audio/mpeg + + + m2v + video/mpeg + + + m3a + audio/mpeg + + + m3u + audio/x-mpegurl + + + m3u8 + application/vnd.apple.mpegurl + + + m4a + audio/mp4 + + + m4b + audio/mp4 + + + m4r + audio/mp4 + + + m4u + video/vnd.mpegurl + + + m4v + video/mp4 + + + ma + application/mathematica + + + mac + image/x-macpaint + + + mads + application/mads+xml + + + mag + application/vnd.ecowin.chart + + + maker + application/vnd.framemaker + + + man + text/troff + + + mar + application/octet-stream + + + mathml + application/mathml+xml + + + mb + application/mathematica + + + mbk + application/vnd.mobius.mbk + + + mbox + application/mbox + + + mc1 + application/vnd.medcalcdata + + + mcd + application/vnd.mcd + + + mcurl + text/vnd.curl.mcurl + + + mdb + application/x-msaccess + + + mdi + image/vnd.ms-modi + + + me + text/troff + + + mesh + model/mesh + + + meta4 + application/metalink4+xml + + + metalink + application/metalink+xml + + + mets + application/mets+xml + + + mfm + application/vnd.mfmp + + + mft + application/rpki-manifest + + + mgp + application/vnd.osgeo.mapguide.package + + + mgz + application/vnd.proteus.magazine + + + mid + audio/midi + + + midi + audio/midi + + + mie + application/x-mie + + + mif + application/x-mif + + + mime + message/rfc822 + + + mj2 + video/mj2 + + + mjp2 + video/mj2 + + + mk3d + video/x-matroska + + + mka + audio/x-matroska + + + mks + video/x-matroska + + + mkv + video/x-matroska + + + mlp + application/vnd.dolby.mlp + + + mmd + application/vnd.chipnuts.karaoke-mmd + + + mmf + application/vnd.smaf + + + mmr + image/vnd.fujixerox.edmics-mmr + + + mng + video/x-mng + + + mny + application/x-msmoney + + + mobi + application/x-mobipocket-ebook + + + mods + application/mods+xml + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/mpeg + + + mp2 + audio/mpeg + + + mp21 + application/mp21 + + + mp2a + audio/mpeg + + + mp3 + audio/mpeg + + + mp4 + video/mp4 + + + mp4a + audio/mp4 + + + mp4s + application/mp4 + + + mp4v + video/mp4 + + + mpa + audio/mpeg + + + mpc + application/vnd.mophun.certificate + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpg4 + video/mp4 + + + mpga + audio/mpeg + + + mpkg + application/vnd.apple.installer+xml + + + mpm + application/vnd.blueice.multipass + + + mpn + application/vnd.mophun.application + + + mpp + application/vnd.ms-project + + + mpt + application/vnd.ms-project + + + mpv2 + video/mpeg2 + + + mpy + application/vnd.ibm.minipay + + + mqy + application/vnd.mobius.mqy + + + mrc + application/marc + + + mrcx + application/marcxml+xml + + + ms + text/troff + + + mscml + application/mediaservercontrol+xml + + + mseed + application/vnd.fdsn.mseed + + + mseq + application/vnd.mseq + + + msf + application/vnd.epson.msf + + + msh + model/mesh + + + msi + application/x-msdownload + + + msl + application/vnd.mobius.msl + + + msty + application/vnd.muvee.style + + + mts + model/vnd.mts + + + mus + application/vnd.musician + + + musicxml + application/vnd.recordare.musicxml+xml + + + mvb + application/x-msmediaview + + + mwf + application/vnd.mfer + + + mxf + application/mxf + + + mxl + application/vnd.recordare.musicxml + + + mxml + application/xv+xml + + + mxs + application/vnd.triscape.mxs + + + mxu + video/vnd.mpegurl + + + n-gage + application/vnd.nokia.n-gage.symbian.install + + + n3 + text/n3 + + + nb + application/mathematica + + + nbp + application/vnd.wolfram.player + + + nc + application/x-netcdf + + + ncx + application/x-dtbncx+xml + + + nfo + text/x-nfo + + + ngdat + application/vnd.nokia.n-gage.data + + + nitf + application/vnd.nitf + + + nlu + application/vnd.neurolanguage.nlu + + + nml + application/vnd.enliven + + + nnd + application/vnd.noblenet-directory + + + nns + application/vnd.noblenet-sealer + + + nnw + application/vnd.noblenet-web + + + npx + image/vnd.net-fpx + + + nsc + application/x-conference + + + nsf + application/vnd.lotus-notes + + + ntf + application/vnd.nitf + + + nzb + application/x-nzb + + + oa2 + application/vnd.fujitsu.oasys2 + + + oa3 + application/vnd.fujitsu.oasys3 + + + oas + application/vnd.fujitsu.oasys + + + obd + application/x-msbinder + + + obj + application/x-tgif + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + odft + application/vnd.oasis.opendocument.formula-template + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + oga + audio/ogg + + + ogg + audio/ogg + + + ogv + video/ogg + + + + ogx + application/ogg + + + omdoc + application/omdoc+xml + + + onepkg + application/onenote + + + onetmp + application/onenote + + + onetoc + application/onenote + + + onetoc2 + application/onenote + + + opf + application/oebps-package+xml + + + opml + text/x-opml + + + oprc + application/vnd.palm + + + org + application/vnd.lotus-organizer + + + osf + application/vnd.yamaha.openscoreformat + + + osfpvg + application/vnd.yamaha.openscoreformat.osfpvg+xml + + + otc + application/vnd.oasis.opendocument.chart-template + + + otf + application/x-font-otf + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + oti + application/vnd.oasis.opendocument.image-template + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + oxps + application/oxps + + + oxt + application/vnd.openofficeorg.extension + + + p + text/x-pascal + + + p10 + application/pkcs10 + + + p12 + application/x-pkcs12 + + + p7b + application/x-pkcs7-certificates + + + p7c + application/pkcs7-mime + + + p7m + application/pkcs7-mime + + + p7r + application/x-pkcs7-certreqresp + + + p7s + application/pkcs7-signature + + + p8 + application/pkcs8 + + + pas + text/x-pascal + + + paw + application/vnd.pawaafile + + + pbd + application/vnd.powerbuilder6 + + + pbm + image/x-portable-bitmap + + + pcap + application/vnd.tcpdump.pcap + + + pcf + application/x-font-pcf + + + pcl + application/vnd.hp-pcl + + + pclxl + application/vnd.hp-pclxl + + + pct + image/pict + + + pcurl + application/vnd.curl.pcurl + + + pcx + image/x-pcx + + + pdb + application/vnd.palm + + + pdf + application/pdf + + + pfa + application/x-font-type1 + + + pfb + application/x-font-type1 + + + pfm + application/x-font-type1 + + + pfr + application/font-tdpfr + + + pfx + application/x-pkcs12 + + + pgm + image/x-portable-graymap + + + pgn + application/x-chess-pgn + + + pgp + application/pgp-encrypted + + + pic + image/pict + + + pict + image/pict + + + pkg + application/octet-stream + + + pki + application/pkixcmp + + + pkipath + application/pkix-pkipath + + + plb + application/vnd.3gpp.pic-bw-large + + + plc + application/vnd.mobius.plc + + + plf + application/vnd.pocketlearn + + + pls + audio/x-scpls + + + pml + application/vnd.ctc-posml + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + portpkg + application/vnd.macports.portpkg + + + pot + application/vnd.ms-powerpoint + + + potm + application/vnd.ms-powerpoint.template.macroenabled.12 + + + potx + application/vnd.openxmlformats-officedocument.presentationml.template + + + ppam + application/vnd.ms-powerpoint.addin.macroenabled.12 + + + ppd + application/vnd.cups-ppd + + + ppm + image/x-portable-pixmap + + + pps + application/vnd.ms-powerpoint + + + ppsm + application/vnd.ms-powerpoint.slideshow.macroenabled.12 + + + ppsx + application/vnd.openxmlformats-officedocument.presentationml.slideshow + + + ppt + application/vnd.ms-powerpoint + + + pptm + application/vnd.ms-powerpoint.presentation.macroenabled.12 + + + pptx + application/vnd.openxmlformats-officedocument.presentationml.presentation + + + pqa + application/vnd.palm + + + prc + application/x-mobipocket-ebook + + + pre + application/vnd.lotus-freelance + + + prf + application/pics-rules + + + ps + application/postscript + + + psb + application/vnd.3gpp.pic-bw-small + + + psd + image/vnd.adobe.photoshop + + + psf + application/x-font-linux-psf + + + pskcxml + application/pskc+xml + + + ptid + application/vnd.pvi.ptid1 + + + pub + application/x-mspublisher + + + pvb + application/vnd.3gpp.pic-bw-var + + + pwn + application/vnd.3m.post-it-notes + + + pya + audio/vnd.ms-playready.media.pya + + + pyv + video/vnd.ms-playready.media.pyv + + + qam + application/vnd.epson.quickanime + + + qbo + application/vnd.intu.qbo + + + qfx + application/vnd.intu.qfx + + + qps + application/vnd.publishare-delta-tree + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + qwd + application/vnd.quark.quarkxpress + + + qwt + application/vnd.quark.quarkxpress + + + qxb + application/vnd.quark.quarkxpress + + + qxd + application/vnd.quark.quarkxpress + + + qxl + application/vnd.quark.quarkxpress + + + qxt + application/vnd.quark.quarkxpress + + + ra + audio/x-pn-realaudio + + + ram + audio/x-pn-realaudio + + + rar + application/x-rar-compressed + + + ras + image/x-cmu-raster + + + rcprofile + application/vnd.ipunplugged.rcprofile + + + rdf + application/rdf+xml + + + rdz + application/vnd.data-vision.rdz + + + rep + application/vnd.businessobjects + + + res + application/x-dtbresource+xml + + + rgb + image/x-rgb + + + rif + application/reginfo+xml + + + rip + audio/vnd.rip + + + ris + application/x-research-info-systems + + + rl + application/resource-lists+xml + + + rlc + image/vnd.fujixerox.edmics-rlc + + + rld + application/resource-lists-diff+xml + + + rm + application/vnd.rn-realmedia + + + rmi + audio/midi + + + rmp + audio/x-pn-realaudio-plugin + + + rms + application/vnd.jcp.javame.midlet-rms + + + rmvb + application/vnd.rn-realmedia-vbr + + + rnc + application/relax-ng-compact-syntax + + + roa + application/rpki-roa + + + roff + text/troff + + + rp9 + application/vnd.cloanto.rp9 + + + rpss + application/vnd.nokia.radio-presets + + + rpst + application/vnd.nokia.radio-preset + + + rq + application/sparql-query + + + rs + application/rls-services+xml + + + rsd + application/rsd+xml + + + rss + application/rss+xml + + + rtf + application/rtf + + + rtx + text/richtext + + + s + text/x-asm + + + s3m + audio/s3m + + + saf + application/vnd.yamaha.smaf-audio + + + sbml + application/sbml+xml + + + sc + application/vnd.ibm.secure-container + + + scd + application/x-msschedule + + + scm + application/vnd.lotus-screencam + + + scq + application/scvp-cv-request + + + scs + application/scvp-cv-response + + + scurl + text/vnd.curl.scurl + + + sda + application/vnd.stardivision.draw + + + sdc + application/vnd.stardivision.calc + + + sdd + application/vnd.stardivision.impress + + + sdkd + application/vnd.solent.sdkm+xml + + + sdkm + application/vnd.solent.sdkm+xml + + + sdp + application/sdp + + + sdw + application/vnd.stardivision.writer + + + see + application/vnd.seemail + + + seed + application/vnd.fdsn.seed + + + sema + application/vnd.sema + + + semd + application/vnd.semd + + + semf + application/vnd.semf + + + ser + application/java-serialized-object + + + setpay + application/set-payment-initiation + + + setreg + application/set-registration-initiation + + + sfd-hdstx + application/vnd.hydrostatix.sof-data + + + sfs + application/vnd.spotfire.sfs + + + sfv + text/x-sfv + + + sgi + image/sgi + + + sgl + application/vnd.stardivision.writer-global + + + sgm + text/sgml + + + sgml + text/sgml + + + sh + application/x-sh + + + shar + application/x-shar + + + shf + application/shf+xml + + + + sid + image/x-mrsid-image + + + sig + application/pgp-signature + + + sil + audio/silk + + + silo + model/mesh + + + sis + application/vnd.symbian.install + + + sisx + application/vnd.symbian.install + + + sit + application/x-stuffit + + + sitx + application/x-stuffitx + + + skd + application/vnd.koan + + + skm + application/vnd.koan + + + skp + application/vnd.koan + + + skt + application/vnd.koan + + + sldm + application/vnd.ms-powerpoint.slide.macroenabled.12 + + + sldx + application/vnd.openxmlformats-officedocument.presentationml.slide + + + slt + application/vnd.epson.salt + + + sm + application/vnd.stepmania.stepchart + + + smf + application/vnd.stardivision.math + + + smi + application/smil+xml + + + smil + application/smil+xml + + + smv + video/x-smv + + + smzip + application/vnd.stepmania.package + + + snd + audio/basic + + + snf + application/x-font-snf + + + so + application/octet-stream + + + spc + application/x-pkcs7-certificates + + + spf + application/vnd.yamaha.smaf-phrase + + + spl + application/x-futuresplash + + + spot + text/vnd.in3d.spot + + + spp + application/scvp-vp-response + + + spq + application/scvp-vp-request + + + spx + audio/ogg + + + sql + application/x-sql + + + src + application/x-wais-source + + + srt + application/x-subrip + + + sru + application/sru+xml + + + srx + application/sparql-results+xml + + + ssdl + application/ssdl+xml + + + sse + application/vnd.kodak-descriptor + + + ssf + application/vnd.epson.ssf + + + ssml + application/ssml+xml + + + st + application/vnd.sailingtracker.track + + + stc + application/vnd.sun.xml.calc.template + + + std + application/vnd.sun.xml.draw.template + + + stf + application/vnd.wt.stf + + + sti + application/vnd.sun.xml.impress.template + + + stk + application/hyperstudio + + + stl + application/vnd.ms-pki.stl + + + str + application/vnd.pg.format + + + stw + application/vnd.sun.xml.writer.template + + + sub + text/vnd.dvb.subtitle + + + sus + application/vnd.sus-calendar + + + susp + application/vnd.sus-calendar + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svc + application/vnd.dvb.service + + + svd + application/vnd.svd + + + svg + image/svg+xml + + + svgz + image/svg+xml + + + swa + application/x-director + + + swf + application/x-shockwave-flash + + + swi + application/vnd.aristanetworks.swi + + + sxc + application/vnd.sun.xml.calc + + + sxd + application/vnd.sun.xml.draw + + + sxg + application/vnd.sun.xml.writer.global + + + sxi + application/vnd.sun.xml.impress + + + sxm + application/vnd.sun.xml.math + + + sxw + application/vnd.sun.xml.writer + + + t + text/troff + + + t3 + application/x-t3vm-image + + + taglet + application/vnd.mynfc + + + tao + application/vnd.tao.intent-module-archive + + + tar + application/x-tar + + + tcap + application/vnd.3gpp2.tcap + + + tcl + application/x-tcl + + + teacher + application/vnd.smart.teacher + + + tei + application/tei+xml + + + teicorpus + application/tei+xml + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + text + text/plain + + + tfi + application/thraud+xml + + + tfm + application/x-tex-tfm + + + tga + image/x-tga + + + thmx + application/vnd.ms-officetheme + + + tif + image/tiff + + + tiff + image/tiff + + + tmo + application/vnd.tmobile-livetv + + + torrent + application/x-bittorrent + + + tpl + application/vnd.groove-tool-template + + + tpt + application/vnd.trid.tpt + + + tr + text/troff + + + tra + application/vnd.trueapp + + + trm + application/x-msterminal + + + tsd + application/timestamped-data + + + tsv + text/tab-separated-values + + + ttc + application/x-font-ttf + + + ttf + application/x-font-ttf + + + ttl + text/turtle + + + twd + application/vnd.simtech-mindmapper + + + twds + application/vnd.simtech-mindmapper + + + txd + application/vnd.genomatix.tuxedo + + + txf + application/vnd.mobius.txf + + + txt + text/plain + + + u32 + application/x-authorware-bin + + + udeb + application/x-debian-package + + + ufd + application/vnd.ufdl + + + ufdl + application/vnd.ufdl + + + ulw + audio/basic + + + ulx + application/x-glulx + + + umj + application/vnd.umajin + + + unityweb + application/vnd.unity + + + uoml + application/vnd.uoml+xml + + + uri + text/uri-list + + + uris + text/uri-list + + + urls + text/uri-list + + + ustar + application/x-ustar + + + utz + application/vnd.uiq.theme + + + uu + text/x-uuencode + + + uva + audio/vnd.dece.audio + + + uvd + application/vnd.dece.data + + + uvf + application/vnd.dece.data + + + uvg + image/vnd.dece.graphic + + + uvh + video/vnd.dece.hd + + + uvi + image/vnd.dece.graphic + + + uvm + video/vnd.dece.mobile + + + uvp + video/vnd.dece.pd + + + uvs + video/vnd.dece.sd + + + uvt + application/vnd.dece.ttml+xml + + + uvu + video/vnd.uvvu.mp4 + + + uvv + video/vnd.dece.video + + + uvva + audio/vnd.dece.audio + + + uvvd + application/vnd.dece.data + + + uvvf + application/vnd.dece.data + + + uvvg + image/vnd.dece.graphic + + + uvvh + video/vnd.dece.hd + + + uvvi + image/vnd.dece.graphic + + + uvvm + video/vnd.dece.mobile + + + uvvp + video/vnd.dece.pd + + + uvvs + video/vnd.dece.sd + + + uvvt + application/vnd.dece.ttml+xml + + + uvvu + video/vnd.uvvu.mp4 + + + uvvv + video/vnd.dece.video + + + uvvx + application/vnd.dece.unspecified + + + uvvz + application/vnd.dece.zip + + + uvx + application/vnd.dece.unspecified + + + uvz + application/vnd.dece.zip + + + vcard + text/vcard + + + vcd + application/x-cdlink + + + vcf + text/x-vcard + + + vcg + application/vnd.groove-vcard + + + vcs + text/x-vcalendar + + + vcx + application/vnd.vcx + + + vis + application/vnd.visionary + + + viv + video/vnd.vivo + + + vob + video/x-ms-vob + + + vor + application/vnd.stardivision.writer + + + vox + application/x-authorware-bin + + + vrml + model/vrml + + + vsd + application/vnd.visio + + + vsf + application/vnd.vsf + + + vss + application/vnd.visio + + + vst + application/vnd.visio + + + vsw + application/vnd.visio + + + vtu + model/vnd.vtu + + + vxml + application/voicexml+xml + + + w3d + application/x-director + + + wad + application/x-doom + + + wav + audio/x-wav + + + wax + audio/x-ms-wax + + + + wbmp + image/vnd.wap.wbmp + + + wbs + application/vnd.criticaltools.wbs+xml + + + wbxml + application/vnd.wap.wbxml + + + wcm + application/vnd.ms-works + + + wdb + application/vnd.ms-works + + + wdp + image/vnd.ms-photo + + + weba + audio/webm + + + webm + video/webm + + + webp + image/webp + + + wg + application/vnd.pmi.widget + + + wgt + application/widget + + + wks + application/vnd.ms-works + + + wm + video/x-ms-wm + + + wma + audio/x-ms-wma + + + wmd + application/x-ms-wmd + + + wmf + application/x-msmetafile + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlsc + application/vnd.wap.wmlscriptc + + + wmv + video/x-ms-wmv + + + wmx + video/x-ms-wmx + + + wmz + application/x-msmetafile + + + woff + application/x-font-woff + + + wpd + application/vnd.wordperfect + + + wpl + application/vnd.ms-wpl + + + wps + application/vnd.ms-works + + + wqd + application/vnd.wqd + + + wri + application/x-mswrite + + + wrl + model/vrml + + + wsdl + application/wsdl+xml + + + wspolicy + application/wspolicy+xml + + + wtb + application/vnd.webturbo + + + wvx + video/x-ms-wvx + + + x32 + application/x-authorware-bin + + + x3d + model/x3d+xml + + + x3db + model/x3d+binary + + + x3dbz + model/x3d+binary + + + x3dv + model/x3d+vrml + + + x3dvz + model/x3d+vrml + + + x3dz + model/x3d+xml + + + xaml + application/xaml+xml + + + xap + application/x-silverlight-app + + + xar + application/vnd.xara + + + xbap + application/x-ms-xbap + + + xbd + application/vnd.fujixerox.docuworks.binder + + + xbm + image/x-xbitmap + + + xdf + application/xcap-diff+xml + + + xdm + application/vnd.syncml.dm+xml + + + xdp + application/vnd.adobe.xdp+xml + + + xdssc + application/dssc+xml + + + xdw + application/vnd.fujixerox.docuworks + + + xenc + application/xenc+xml + + + xer + application/patch-ops-error+xml + + + xfdf + application/vnd.adobe.xfdf + + + xfdl + application/vnd.xfdl + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xhvml + application/xv+xml + + + xif + image/vnd.xiff + + + xla + application/vnd.ms-excel + + + xlam + application/vnd.ms-excel.addin.macroenabled.12 + + + xlc + application/vnd.ms-excel + + + xlf + application/x-xliff+xml + + + xlm + application/vnd.ms-excel + + + xls + application/vnd.ms-excel + + + xlsb + application/vnd.ms-excel.sheet.binary.macroenabled.12 + + + xlsm + application/vnd.ms-excel.sheet.macroenabled.12 + + + xlsx + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + xlt + application/vnd.ms-excel + + + xltm + application/vnd.ms-excel.template.macroenabled.12 + + + xltx + application/vnd.openxmlformats-officedocument.spreadsheetml.template + + + xlw + application/vnd.ms-excel + + + xm + audio/xm + + + xml + application/xml + + + xo + application/vnd.olpc-sugar + + + xop + application/xop+xml + + + xpi + application/x-xpinstall + + + xpl + application/xproc+xml + + + xpm + image/x-xpixmap + + + xpr + application/vnd.is-xpr + + + xps + application/vnd.ms-xpsdocument + + + xpw + application/vnd.intercon.formnet + + + xpx + application/vnd.intercon.formnet + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xsm + application/vnd.syncml+xml + + + xspf + application/xspf+xml + + + xul + application/vnd.mozilla.xul+xml + + + xvm + application/xv+xml + + + xvml + application/xv+xml + + + xwd + image/x-xwindowdump + + + xyz + chemical/x-xyz + + + xz + application/x-xz + + + yang + application/yang + + + yin + application/yin+xml + + + z + application/x-compress + + + Z + application/x-compress + + + z1 + application/x-zmachine + + + z2 + application/x-zmachine + + + z3 + application/x-zmachine + + + z4 + application/x-zmachine + + + z5 + application/x-zmachine + + + z6 + application/x-zmachine + + + z7 + application/x-zmachine + + + z8 + application/x-zmachine + + + zaz + application/vnd.zzazz.deck+xml + + + zip + application/zip + + + zir + application/vnd.zul + + + zirz + application/vnd.zul + + + zmm + application/vnd.handheld-entertainment+xml + + + + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + + + /* + OPTIONS + HEAD + TRACE + + + + + + diff --git a/servicegateway/deployment/src/main/release/etc/conf/restclient.json b/servicegateway/deployment/src/main/release/etc/conf/restclient.json new file mode 100644 index 00000000..304e2137 --- /dev/null +++ b/servicegateway/deployment/src/main/release/etc/conf/restclient.json @@ -0,0 +1,11 @@ +{ + "defaultServer": + { + "host":"msb.openo.org", + "port":80 + }, + "ConnectTimeout":"1000", + "thread":"10", + "idletimeout":"500000", + "timeout":"10000" +} \ No newline at end of file diff --git a/servicegateway/deployment/src/main/release/etc/framework/tracker.properties b/servicegateway/deployment/src/main/release/etc/framework/tracker.properties new file mode 100644 index 00000000..68eddf2f --- /dev/null +++ b/servicegateway/deployment/src/main/release/etc/framework/tracker.properties @@ -0,0 +1 @@ +roa.tracker.class=org.openo.gso.commonsvc.servicegateway.talc.impl.TrackerManagerImpl diff --git a/servicegateway/deployment/src/main/release/etc/log4j/log4j-app.properties b/servicegateway/deployment/src/main/release/etc/log4j/log4j-app.properties new file mode 100644 index 00000000..1653372a --- /dev/null +++ b/servicegateway/deployment/src/main/release/etc/log4j/log4j-app.properties @@ -0,0 +1,50 @@ +log4j.rootLogger=WARN,root +log4j.logger.access=WARN,access +log4j.logger.org.openo.baseservice.log4operation.System=info,log4operation +log4j.logger.org.openo.baseservice.base.launcher=info,apploader +log4j.logger.org.openo.baseservice.framework.appmgr=info,apploader +log4j.logger.org.openo.baseservice.framework.apploader=info,apploader +log4j.logger.org.openo.baseservice.framework.appmgrimpl=info,apploader + +log4j.additivity.access=true +log4j.additivity.org.openo.baseservice.log4operation.System=false +log4j.additivity.org.openo.baseservice.base.launcher=false +log4j.additivity.org.openo.baseservice.framework.appmgr=false +log4j.additivity.org.openo.baseservice.framework.apploader=false +log4j.additivity.org.openo.baseservice.framework.appmgrimpl=false + +log4j.appender.access.Append=true +log4j.appender.access.File=log/access +log4j.appender.access.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n +log4j.appender.access.layout=org.apache.log4j.PatternLayout +log4j.appender.access.MaxBackupIndex=50 +log4j.appender.access.MaxFileSize=20MB +log4j.appender.access=org.openo.baseservice.log4j.extend.OssRollingFileAppender + + +log4j.appender.root.Append=true +log4j.appender.root.File=log/root +log4j.appender.root.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n +log4j.appender.root.layout=org.apache.log4j.PatternLayout +log4j.appender.root.MaxBackupIndex=50 +log4j.appender.root.MaxFileSize=20MB +log4j.appender.root=org.openo.baseservice.log4j.extend.OssRollingFileAppender + + +log4j.appender.log4operation=org.openo.baseservice.log4j.extend.OssRollingFileAppender +log4j.appender.log4operation.useNewThread4Zip=false +log4j.appender.log4operation.File=operation/log4operation-System +log4j.appender.log4operation.MaxFileSize=10MB +log4j.appender.log4operation.MaxBackupIndex=10 +log4j.appender.log4operation.layout=org.apache.log4j.PatternLayout +log4j.appender.log4operation.layout.ConversionPattern=%d %p [%c] - %m%n +log4j.appender.log4operation.permission=600 + +log4j.appender.apploader=org.openo.baseservice.log4j.extend.OssRollingFileAppender +log4j.appender.apploader.File=log/apploader +log4j.appender.apploader.MaxFileSize=50MB +log4j.appender.apploader.MaxBackupIndex=30 +log4j.appender.apploader.Append=true +log4j.appender.apploader.layout=org.apache.log4j.PatternLayout +log4j.appender.apploader.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n +log4j.appender.apploader.moduleID=Apploader diff --git a/servicegateway/deployment/src/main/release/etc/platformversion.xml b/servicegateway/deployment/src/main/release/etc/platformversion.xml new file mode 100644 index 00000000..add9ab01 --- /dev/null +++ b/servicegateway/deployment/src/main/release/etc/platformversion.xml @@ -0,0 +1,5 @@ + + + CloudSOP @{PLATFORM_VERSION} + @{VERSION_TIME} + diff --git a/servicegateway/deployment/src/main/release/etc/register/service.json b/servicegateway/deployment/src/main/release/etc/register/service.json new file mode 100644 index 00000000..5d32dd06 --- /dev/null +++ b/servicegateway/deployment/src/main/release/etc/register/service.json @@ -0,0 +1,14 @@ +{ + "serviceName" : "servicegateway", + "version" : "v1", + "url" : "openoapi/servicegateway/v1", + "protocol" : "REST", + "visualRange" : ["1"], + "nodes" : [ + { + "ip" : "getInputIP", + "port" : "8301", + "ttl" : 0 + } + ] +} \ No newline at end of file diff --git a/servicegateway/deployment/src/main/release/init/post_install.sh b/servicegateway/deployment/src/main/release/init/post_install.sh new file mode 100644 index 00000000..959acc51 --- /dev/null +++ b/servicegateway/deployment/src/main/release/init/post_install.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#check user +if [ "root" = "`/usr/bin/id -u -n`" ];then + echo "root has been forbidden to execute the shell." + exit 1 +fi + +if [[ -z ${APP_ROOT} ]];then + echo "APP_ROOT is empty." + exit 1 +fi + +if [[ -z ${_APP_LOG_DIR} ]];then + echo "_APP_LOG_DIR is empty." + exit 1 +fi + +#HORNETQ_CONF=$APP_ROOT/etc + +#chmod 400 $HORNETQ_CONF/engine.json diff --git a/servicegateway/deployment/src/main/release/pub/app_define.json b/servicegateway/deployment/src/main/release/pub/app_define.json new file mode 100644 index 00000000..83f9f9d2 --- /dev/null +++ b/servicegateway/deployment/src/main/release/pub/app_define.json @@ -0,0 +1,97 @@ +{ + "fileVersion": "1", + "name": "ServiceGateway", + "description": "ServiceGateway", + "requireDiskSize": 50, + "rtspSoftLink": true, + "upgrade": { + "use": { + "jre": "~1.3" + }, + "postInstall": { + "command": [ + "${APP_ROOT}/init/post_install.sh" + ], + "timeout": 300 + }, + "check": { + "command": [ + "${APP_ROOT}/upgrade/check.sh" + ], + "timeout": 30 + }, + "upgrade": { + "command": [ + "${APP_ROOT}/upgrade/init.sh" + ], + "timeout": 300 + } + }, + "processes": { + "ServiceGateway": { + "use": { + "jre": "~1.3", + "tomcat": "~9.0" + }, + "subscribes": [ + { + "name": "iamcacheproxy", + "srv_ctx": {}, + "ins_ctx": {} + }, + { + "name": "iamcore", + "srv_ctx": {}, + "ins_ctx": {} + } + ], + "mode": "cluster", + "cpu": 0.5, + "memory": 1024, + "memoryLimit": 4096, + "patterns": [ + "!/rest/ServiceGateway/v1", + "/rest/ServiceGateway_portal/v1" + ], + "useAdditionalEnv": [ + "_APP_LOG_DIR", + "_APP_TMP_DIR", + "_APP_SHARE_DIR" + ], + "protocols": { + "IR": "http" + }, + "commands": { + "start": [ + "${APP_ROOT}/bin/start.sh" + ], + "stop": [ + "${APP_ROOT}/bin/stop.sh" + ] + } + } + }, + "databases": { + "ServiceGatewaydb": { + "type": [ + "mysql" + ], + "serviceName": "ServiceGatewaydb", + "dataSize": 4096, + "logSize": 128, + "sharding": false, + "defaultShardingNumber": 1 + } + }, + "redis": { + "ServiceGatewayrdb": { + "serviceName": "ServiceGatewayrdb", + "type": "cache", + "memory": 1024, + "dataSize": 1024, + "sharding": false, + "defaultShardingNumber": 1, + "protected": true + } + } +} diff --git a/servicegateway/deployment/src/main/release/pub/i18n/en_US/app_define.properties b/servicegateway/deployment/src/main/release/pub/i18n/en_US/app_define.properties new file mode 100644 index 00000000..6918a8bf --- /dev/null +++ b/servicegateway/deployment/src/main/release/pub/i18n/en_US/app_define.properties @@ -0,0 +1,80 @@ +servicemgr.bad_param_desc=Invalid Param +servicemgr.bad_param_detail=Invalid Param. +servicemgr.bad_param_reason=Invalid Param +servicemgr.bad_param_advice=Invalid Param +servicemgr.service.status_inprogress_desc=The service status is in process, can not operate it. +servicemgr.service.status_inprogress_detail=The service status is in process, can not operate it. +servicemgr.service.status_inprogress_reason=The service status is in process, can not operate it. +servicemgr.service.status_inprogress_advice=Can not operate service when service status is in progress. +servicemgr.service.status_active_desc=The service status is active, activate or delete service is not permitted. +servicemgr.service.status_active_detail=The service status is active, activate or delete service is not permitted. +servicemgr.service.status_active_reason=The service status is active, activate or delete service is not permitted. +servicemgr.service.status_active_advice=Can not activate or delete service when service status is active. +servicemgr.service.status_deactive_desc=The service status is deactive, deactivate service is not permitted. +servicemgr.service.status_deactive_detail=The service status is deactive, deactivate service is not permitted. +servicemgr.service.status_deactive_reason=The service status is deactive, deactivate service is not permitted. +servicemgr.service.status_deactive_advice=Can not deactive service when service status service is deactive. +servicemgr.mysql.oper_mysql_db_error_desc=Operate mysql database error. +servicemgr.mysql.oper_mysql_db_error_detail=Operate mysql database error. +servicemgr.mysql.oper_mysql_db_error_reason=Operate mysql database error. +servicemgr.mysql.oper_mysql_db_error_advice=Operate mysql database error. +servicemgr.redis.oper_redis_db_error_desc=Operate redis error. +servicemgr.redis.oper_redis_db_error_reason=Operate redis error. +servicemgr.redis.oper_redis_db_error_detail=Operate redis error. +servicemgr.redis.oper_redis_db_error_advice=Operate redis error. +servicemgr.db.oper_db_error_desc=Operate database error. +servicemgr.db.oper_db_error_detail=Operate database error. +servicemgr.db.oper_db_error_reason=Operate database error. +servicemgr.db.oper_db_error_advice=Operate database error. +servicemgr.service.not_exist_desc=Service is not exist, can not operate it. +servicemgr.service.not_exist_detail=Service is not exist, can not operate it. +servicemgr.service.not_exist_reason=Service is not exist, can not operate it. +servicemgr.service.not_exist_advice=Service is not exist, can not operate it. +servicemgr.service.status_param_error_desc=The parameter of service status is error, can not operate it. +servicemgr.service.status_param_error_detail=The parameter of service status is error, can not operate it. +servicemgr.service.status_param_error_reason=The parameter of service status is error, can not operate it. +servicemgr.service.status_param_error_advice=The parameter of service status is error, can not operate it. +servicemgr.service.service_package_status_inactive_desc=The service package status is offline. +servicemgr.service.service_package_status_inactive_detail=The service package status is offline. +servicemgr.service.service_package_status_inactive_reason=The service package status is offline. +servicemgr.service.service_package_status_inactive_advice=Online the service package firstly. +servicemgr.service.service_package_status_delete_depending_desc=The Service Package is delete pending, can't do the action. +servicemgr.service.service_package_status_delete_depending_detail=The Service Package is delete pending, can't do the action. +servicemgr.service.service_package_status_delete_depending_reason=The Service Package is delete pending, can't do the action. +servicemgr.service.service_package_status_delete_depending_advice=The Service Package is delete pending, can't do the action. +servicemgr.servicePackage.not_activation_desc=The service package status is incorrect. +servicemgr.servicePackage.not_activation_detail=The service package status is incorrect. +servicemgr.servicePackage.not_activation_reason=The service package status is incorrect. +servicemgr.servicePackage.not_activation_advice=The service package status is incorrect, can not operate it. +servicemgr.servicePageExtend.not_exist_desc=The service_page_extend is not exist, can not operate it. +servicemgr.servicePageExtend.not_exist_detail=The service_page_extend is not exist, can not operate it. +servicemgr.servicePageExtend.not_exist_reason=The service_page_extend is not exist, can not operate it. +servicemgr.servicePageExtend.not_exist_advice=The service_page_extend is not exist, can not operate it. +servicemgr.service.create_failed_desc=Service create failed, only deleting operation is permitted. +servicemgr.service.create_failed_detail=Service create failed, only deleting operation is permitted. +servicemgr.service.create_failed_reason=Service create failed, only deleting operation is permitted. +servicemgr.service.create_failed_advice=Service create failed, only deleting operation is permitted. +servicemgr.service.parameter.validate_error_desc=Service parameter validate failed. +servicemgr.service.parameter.validate_error_detail=Service parameter validate failed. +servicemgr.service.parameter.validate_error_reason=Service parameter validate failed. +servicemgr.service.parameter.validate_error_advice=Service parameter validate failed. +servicemgr.service.template.parse_error_desc=Template parse error. +servicemgr.service.template.parse_error_detail=Template parse error. +servicemgr.service.template.parse_error_reason=Template parse error. +servicemgr.service.template.parse_error_advice=Template parse error. +servicemgr.permission_denied_desc=Incorrect password. +servicemgr.permission_denied_detail=Incorrect password. +servicemgr.permission_denied_reason=Incorrect password. +servicemgr.permission_denied_advice=Incorrect password. +servicemgr.template.not_exist_desc=The template does not exist. +servicemgr.template.not_exist_detail=The template does not exist. +servicemgr.template.not_exist_reason=The template does not exist. +servicemgr.template.not_exist_advice=The template does not exist. +servicemgr.service.exist_desc=Service is exist. +servicemgr.service.exist_detail=Service is exist. +servicemgr.service.exist_reason=Service is exist. +servicemgr.service.exist_advice=Service is exist. +servicemgr.template.parameter.not_exist_desc=The parameters of template does not exist. +servicemgr.template.parameter.not_exis_detail=The parameters of template does not exist. +servicemgr.template.parameter.not_exis_reason=The parameters of template does not exist. +servicemgr.template.parameter.not_exis_advice=The parameters of template does not exist. diff --git a/servicegateway/deployment/src/main/release/pub/i18n/zh_CN/app_define.properties b/servicegateway/deployment/src/main/release/pub/i18n/zh_CN/app_define.properties new file mode 100644 index 00000000..b6ab626b --- /dev/null +++ b/servicegateway/deployment/src/main/release/pub/i18n/zh_CN/app_define.properties @@ -0,0 +1,83 @@ +name=ServiceGateway +description=\u63d0\u4f9b\u8054\u673a\u5e2e\u52a9\u3002 +servicemgr.bad_param_desc=\u53c2\u6570\u9519\u8bef +servicemgr.bad_param_detail=\u53c2\u6570\u9519\u8bef\u3002 +servicemgr.bad_param_reason=\u53c2\u6570\u9519\u8bef +servicemgr.bad_param_advice=\u53c2\u6570\u9519\u8bef +servicemgr.service.status_inprogress_desc=\u5f53\u524d\u4e1a\u52a1\u6b63\u5728\u5904\u7406\u4e2d\u65f6\uff0c\u4e0d\u80fd\u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.status_inprogress_detail=\u5f53\u524d\u4e1a\u52a1\u6b63\u5728\u5904\u7406\u4e2d\u65f6\uff0c\u4e0d\u80fd\u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.status_inprogress_reason=\u5f53\u524d\u4e1a\u52a1\u6b63\u5728\u5904\u7406\u4e2d\u65f6\uff0c\u4e0d\u80fd\u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.status_inprogress_advice=\u5f53\u524d\u4e1a\u52a1\u6b63\u5728\u5904\u7406\u4e2d\u65f6\uff0c\u4e0d\u80fd\u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.status_active_desc=\u4e1a\u52a1\u4e3a\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u6fc0\u6d3b\u6216\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.status_active_detail=\u4e1a\u52a1\u4e3a\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u6fc0\u6d3b\u6216\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.status_active_reason=\u4e1a\u52a1\u4e3a\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u6fc0\u6d3b\u6216\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.status_active_advice=\u4e1a\u52a1\u4e3a\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u6fc0\u6d3b\u6216\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.status_deactive_desc=\u4e1a\u52a1\u4e3a\u53bb\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u53bb\u6fc0\u6d3b\u64cd\u4f5c\u3002 +servicemgr.service.status_deactive_detail=\u4e1a\u52a1\u4e3a\u53bb\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u53bb\u6fc0\u6d3b\u64cd\u4f5c\u3002 +servicemgr.service.status_deactive_reason=\u4e1a\u52a1\u4e3a\u53bb\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u53bb\u6fc0\u6d3b\u64cd\u4f5c\u3002 +servicemgr.service.status_deactive_advice=\u4e1a\u52a1\u4e3a\u53bb\u6fc0\u6d3b\u72b6\u6001\uff0c\u4e0d\u652f\u6301\u53bb\u6fc0\u6d3b\u64cd\u4f5c\u3002 +servicemgr.mysql.oper_mysql_db_error_desc=\u64cd\u4f5c\u5173\u7cfb\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.mysql.oper_mysql_db_error_detail=\u64cd\u4f5c\u5173\u7cfb\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.mysql.oper_mysql_db_error_reason=\u64cd\u4f5c\u5173\u7cfb\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.mysql.oper_mysql_db_error_advice=\u64cd\u4f5c\u5173\u7cfb\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.redis.oper_redis_db_error_desc=\u64cd\u4f5c\u7f13\u5b58\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.redis.oper_redis_db_error_reason=\u64cd\u4f5c\u7f13\u5b58\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.redis.oper_redis_db_error_detail=\u64cd\u4f5c\u7f13\u5b58\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.redis.oper_redis_db_error_advice=\u64cd\u4f5c\u7f13\u5b58\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.db.oper_db_error_desc=\u64cd\u4f5c\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.db.oper_db_error_detail=\u64cd\u4f5c\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.db.oper_db_error_reason=\u64cd\u4f5c\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.db.oper_db_error_advice=\u64cd\u4f5c\u6570\u636e\u5e93\u5931\u8d25\u3002 +servicemgr.service.not_exist_desc=\u4e1a\u52a1\u4e0d\u5b58\u5728\uff0c\u4e0d\u80fd \u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.not_exist_detail=\u4e1a\u52a1\u4e0d\u5b58\u5728\uff0c\u4e0d\u80fd \u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.not_exist_reason=\u4e1a\u52a1\u4e0d\u5b58\u5728\uff0c\u4e0d\u80fd \u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.not_exist_advice=\u4e1a\u52a1\u4e0d\u5b58\u5728\uff0c\u4e0d\u80fd \u8fdb\u884c\u64cd\u4f5c\u3002 +servicemgr.service.status_param_error_desc=\u4e1a\u52a1\u72b6\u6001\u53c2\u6570\u5f02\u5e38\u3002 +servicemgr.service.status_param_error_detail=\u4e1a\u52a1\u72b6\u6001\u53c2\u6570\u5f02\u5e38\u3002 +servicemgr.service.status_param_error_reason=\u4e1a\u52a1\u72b6\u6001\u53c2\u6570\u5f02\u5e38\u3002 +servicemgr.service.status_param_error_advice=\u4e1a\u52a1\u72b6\u6001\u53c2\u6570\u5f02\u5e38\u3002 +servicemgr.service.service_package_status_inactive_desc=\u5f53\u524d\u4e1a\u52a1\u5305\u4e3a\u4e0b\u7ebf\u72b6\u6001\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.service.service_package_status_inactive_detail=\u5f53\u524d\u4e1a\u52a1\u5305\u4e3a\u4e0b\u7ebf\u72b6\u6001\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.service.service_package_status_inactive_reason=\u5f53\u524d\u4e1a\u52a1\u5305\u4e3a\u4e0b\u7ebf\u6d3b\u72b6\u6001\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.service.service_package_status_inactive_advice=\u5f53\u524d\u4e1a\u52a1\u5305\u4e3a\u4e0b\u7ebf\u6d3b\u72b6\u6001\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.service.service_package_status_delete_depending_desc=\u4e1a\u52a1\u5b9a\u4e49\u7684\u72b6\u6001\u662f\u5f85\u5220\u9664\uff0c\u4e0d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u3002 +servicemgr.service.service_package_status_delete_depending_detail=\u4e1a\u52a1\u5b9a\u4e49\u7684\u72b6\u6001\u662f\u5f85\u5220\u9664\uff0c\u4e0d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u3002 +servicemgr.service.service_package_status_delete_depending_reason=\u4e1a\u52a1\u5b9a\u4e49\u7684\u72b6\u6001\u662f\u5f85\u5220\u9664\uff0c\u4e0d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u3002 +servicemgr.service.service_package_status_delete_depending_advice=\u4e1a\u52a1\u5b9a\u4e49\u7684\u72b6\u6001\u662f\u5f85\u5220\u9664\uff0c\u4e0d\u80fd\u6267\u884c\u64cd\u4f5c\u3002\u3002 +servicemgr.servicePackage.not_activation_desc=\u5f53\u524d\u4e1a\u52a1\u5305\u72b6\u6001\u5f02\u5e38\u3002 +servicemgr.servicePackage.not_activation_detail=\u5f53\u524d\u4e1a\u52a1\u5305\u72b6\u6001\u5f02\u5e38\u3002 +servicemgr.servicePackage.not_activation_reason=\u5f53\u524d\u4e1a\u52a1\u5305\u72b6\u6001\u5f02\u5e38\u3002 +servicemgr.servicePackage.not_activation_advice=\u5f53\u524d\u4e1a\u52a1\u5305\u72b6\u6001\u5f02\u5e38\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.servicePageExtend.not_exist_desc=\u5f53\u524d\u4e1a\u52a1\u6ce8\u518c\u9875\u9762\u4fe1\u606f\u4e0d\u5b58\u5728\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.servicePageExtend.not_exist_detail=\u5f53\u524d\u4e1a\u52a1\u6ce8\u518c\u9875\u9762\u4fe1\u606f\u4e0d\u5b58\u5728\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.servicePageExtend.not_exist_reason=\u5f53\u524d\u4e1a\u52a1\u6ce8\u518c\u9875\u9762\u4fe1\u606f\u4e0d\u5b58\u5728\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.servicePageExtend.not_exist_advice=\u5f53\u524d\u4e1a\u52a1\u6ce8\u518c\u9875\u9762\u4fe1\u606f\u4e0d\u5b58\u5728\uff0c\u4e0d\u5141\u8bb8\u64cd\u4f5c\u3002 +servicemgr.service.create_failed_desc=\u5f53\u524d\u4e1a\u52a1\u521b\u5efa\u5931\u8d25\uff0c\u53ea\u5141\u8bb8\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.create_failed_detail=\u5f53\u524d\u4e1a\u52a1\u521b\u5efa\u5931\u8d25\uff0c\u53ea\u5141\u8bb8\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.create_failed_reason=\u5f53\u524d\u4e1a\u52a1\u521b\u5efa\u5931\u8d25\uff0c\u53ea\u5141\u8bb8\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.create_failed_advice=\u5f53\u524d\u4e1a\u52a1\u521b\u5efa\u5931\u8d25\uff0c\u53ea\u5141\u8bb8\u5220\u9664\u64cd\u4f5c\u3002 +servicemgr.service.parameter.validate_error_desc=\u4e1a\u52a1\u53c2\u6570\u6821\u9a8c\u5931\u8d25\u3002 +servicemgr.service.parameter.validate_error_detail=\u4e1a\u52a1\u53c2\u6570\u6821\u9a8c\u5931\u8d25\u3002 +servicemgr.service.parameter.validate_error_reason=\u4e1a\u52a1\u53c2\u6570\u6821\u9a8c\u5931\u8d25\u3002 +servicemgr.service.parameter.validate_error_advice=\u4e1a\u52a1\u53c2\u6570\u6821\u9a8c\u5931\u8d25\u3002 +servicemgr.service.template.parse_error_desc=\u6a21\u677f\u89e3\u6790\u5931\u8d25\u3002 +servicemgr.service.template.parse_error_detail=\u6a21\u677f\u89e3\u6790\u5931\u8d25\u3002 +servicemgr.service.template.parse_error_reason=\u6a21\u677f\u89e3\u6790\u5931\u8d25\u3002 +servicemgr.service.template.parse_error_advice=\u6a21\u677f\u89e3\u6790\u5931\u8d25\u3002 +servicemgr.permission_denied_desc=\u5bc6\u7801\u9519\u8bef +servicemgr.permission_denied_detail=\u5bc6\u7801\u9519\u8bef +servicemgr.permission_denied_reason=\u5bc6\u7801\u9519\u8bef +servicemgr.permission_denied_advice=\u5bc6\u7801\u9519\u8bef +servicemgr.template.not_exist=\u6a21\u677f\u4e0d\u5b58\u5728 +servicemgr.template.not_exist_desc=\u6a21\u677f\u4e0d\u5b58\u5728 +servicemgr.template.not_exist_detail=\u6a21\u677f\u4e0d\u5b58\u5728 +servicemgr.template.not_exist_reason=\u6a21\u677f\u4e0d\u5b58\u5728 +servicemgr.template.not_exist_advice=\u6a21\u677f\u4e0d\u5b58\u5728 +servicemgr.service.exist_desc=\u4e1a\u52a1\u5df2\u5b58\u5728\u3002 +servicemgr.service.exist_detail=\u4e1a\u52a1\u5df2\u5b58\u5728\u3002 +servicemgr.service.exist_reason=\u4e1a\u52a1\u5df2\u5b58\u5728\u3002 +servicemgr.service.exist_advice=\u4e1a\u52a1\u5df2\u5b58\u5728\u3002 +servicemgr.template.parameter.not_exist_desc=\u6a21\u677f\u53c2\u6570\u4e0d\u5b58\u5728\u3002 +servicemgr.template.parameter.not_exis_detail=\u6a21\u677f\u53c2\u6570\u4e0d\u5b58\u5728\u3002 +servicemgr.template.parameter.not_exis_reason=\u6a21\u677f\u53c2\u6570\u4e0d\u5b58\u5728\u3002 +servicemgr.template.parameter.not_exis_advice=\u6a21\u677f\u53c2\u6570\u4e0d\u5b58\u5728\u3002 \ No newline at end of file diff --git a/servicegateway/deployment/src/main/release/pub/release_version.properties b/servicegateway/deployment/src/main/release/pub/release_version.properties new file mode 100644 index 00000000..b5b354e5 --- /dev/null +++ b/servicegateway/deployment/src/main/release/pub/release_version.properties @@ -0,0 +1 @@ +upload_path=Services/ICTO/public diff --git a/servicegateway/deployment/src/main/release/upgrade/check.sh b/servicegateway/deployment/src/main/release/upgrade/check.sh new file mode 100644 index 00000000..d87f29ee --- /dev/null +++ b/servicegateway/deployment/src/main/release/upgrade/check.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exit 1 diff --git a/servicegateway/deployment/src/main/release/upgrade/init.sh b/servicegateway/deployment/src/main/release/upgrade/init.sh new file mode 100644 index 00000000..799b7e4a --- /dev/null +++ b/servicegateway/deployment/src/main/release/upgrade/init.sh @@ -0,0 +1,34 @@ +#!/bin/bash +#check user +CUR_PATH=$(cd `dirname $0`;pwd) +SCRIPT_PATH=$0 +IPMC_USER="`stat -c '%U' ${SCRIPT_PATH}`" +export IPMC_USER +CURRENT_USER="`/usr/bin/id -u -n`" +if [ "${IPMC_USER}" != "${CURRENT_USER}" ] +then + echo "only ${IPMC_USER} can execute this script." + exit 1 +fi +umask 027 + +cd $APP_ROOT +JAVA=$JAVA_HOME/bin/java + +DB_ID="ServiceGatewaydb" +SCRIPT=$APP_ROOT/init/ServiceGateway_tables_@{dbtype}.sql + +JVM_OPT="$JVM_OPT -Dlog.dir=$_APP_LOG_DIR" +JVM_OPT="$JVM_OPT -Dinit.appconfig=$APP_CONF_FILE" +JVM_OPT="$JVM_OPT -Dinit.approot=$APP_ROOT" +JVM_OPT="$JVM_OPT -Dinit.dataSourceId=$DB_ID" +JVM_OPT="$JVM_OPT -Dinit.script=$SCRIPT" +JVM_OPT="$JVM_OPT -Dinit.connectType=$1" +JVM_OPT="$JVM_OPT -Dinit.class=org.openo.baseservice.biz.init.impl.DBInitializer" + +CLASS_PATH="$APP_ROOT/lib/*:$APP_ROOT/webapps/ROOT/WEB-INF/lib/*:" +JVM_OPT="$JVM_OPT -classpath $CLASS_PATH" + +$JAVA $JVM_OPT org.openo.baseservice.biz.inittool.InitTool +result=$? +$CUR_PATH/../../../../manager/agent/tools/shscript/syslogutils.sh "$(basename $0)" "$result" "Execute($#):$CUR_PATH/$0 $@";exit $result diff --git a/servicegateway/pom.xml b/servicegateway/pom.xml new file mode 100644 index 00000000..660e55d4 --- /dev/null +++ b/servicegateway/pom.xml @@ -0,0 +1,276 @@ + + 4.0.0 + + org.openo.gso.gui + gso-gui + 1.0.0-SNAPSHOT + + servicegateway + servicegateway + pom + + + UTF-8 + + + service + deployment + + + + + + + src/main/release/pub + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/deploydependencis + false + false + true + compile + runtime + + + + + + org.codehaus.gmaven + gmaven-plugin + 1.5 + + + make new jar + package + + execute + + + + private String getWebContextFromManifest(File warFile) { + String context = null; + java.util.jar.JarFile jarFile = null; + try { + jarFile = new java.util.jar.JarFile(warFile); + context = + jarFile.getManifest().getMainAttributes().getValue("WebContext-Name"); + context = context == null ? "ROOT" : context; + context = context.replace("\", "/"); + context = context.replaceAll("[/]{2,}", "/"); + context = context.endsWith("/") ? context.substring(0, context.length() - 1) : context; + context = context.startsWith("/") ? context.substring(1, context.length()) : context; + context = context.replaceAll("/", "#"); + return context; + } catch (Exception e) { + System.out.println("-------------------context eror: ",e); + context = "ROOT"; + } finally { + if (jarFile != null) { + jarFile.close(); + } + } + System.out.println("-------------------context is: " + context); + return context; + } + + System.out.println("------------------------------1") + List contexts=new ArrayList(); + deploydependencisdir = "${project.build.directory}/deploydependencis"; + unzipdir = + "${project.build.directory}/deployunzip"; + outputdir = + "${project.build.directory}/deployoutput"; + resourcesdir = + "${project.basedir}/src/main/release"; + jarsdir = "${unzipdir}/lib"; + toolpath = + "${project.build.directory}/deployoutputjars"; + + System.out.println("------------------------------2") + ant = new AntBuilder() + ant.delete(dir: "${unzipdir}") + ant.mkdir(dir: "${unzipdir}") + ant.mkdir(dir: + toolpath) + ant.delete(dir: "${outputdir}") + ant.mkdir(dir: "${outputdir}") + ant.delete(dir: "${jarsdir}") + ant.mkdir(dir: "${jarsdir}") + outputFileName = + "${project.name}" + + System.out.println("------------------------------3") + if(new + File("${deploydependencisdir}").exists()){ + for (File file : new File("${deploydependencisdir}").listFiles()) + { + String filePath = file.getAbsolutePath(); + fileName = file.getName(); + if (fileName.endsWith(".war")) { + context = getWebContextFromManifest(file) + ant.mkdir(dir: "${unzipdir}/webapps/" + context) + ant.unzip(src: filePath, dest: "${unzipdir}/webapps/" + context) + ant.copy(todir: toolpath) { + fileset(dir: "${unzipdir}/webapps/" + context + "/WEB-INF/lib") { + include(name: "*.jar") + } + } + + } + } + + contexts.add(toolpath) + ant.copy(todir: toolpath) { + fileset(dir: "${deploydependencisdir}") { + include(name: "*.jar") + } + } + } + + + System.out.println("------------------------------4") + ant.copy(todir: toolpath) { + fileset(dir: "${project.build.directory}") { + include(name: "*.jar") + } + } + + ant.copy(todir: "${unzipdir}") { + fileset(dir: "${resourcesdir}") { + include(name: "**") + } + } + + + /* compile python .py files. */ + System.out.println("------------------------------5------------------") + pythonFile = "${project.basedir}/src/main/python"; + if(new + File(pythonFile).exists()) { + try { + ant.exec(dir: "${project.basedir}/src/main/python", executable: "python") { + arg(value: "-m") + arg(value: "compileall") + arg(value: ".") + } + + ant.copy(todir: "${unzipdir}") { + fileset(dir: "${project.basedir}/src/main/python") { + include(name: "**/*.*") + exclude(name: "**/*.py") + } + } + } catch (Exception eee) { + System.out.println("---------------->>>"+eee.toString()) + } + } + + /* copy all dependencies to $APP_ROOT/lib. */ + System.out.println("------------------------------6------------------") + for(String temPath : contexts) + { + if(new File(temPath).exists()) + { + try { + for (File file : new File(temPath).listFiles()) { + fileName = file.getName(); + if (fileName.endsWith(".jar")) { + ant.copy(file: file.getAbsolutePath(), todir: "${jarsdir}") + } + } + } catch (Exception e) { + e.printStackTrace() + } + } + } + + /* deploy the upzip file to ${outputdir}/${outputFileName} */ + System.out.println("------------------------------7------------------") + outputFileName = + outputFileName.endsWith("Deployment")?outputFileName:outputFileName+"Deployment"; + outputFileName = outputFileName.substring(0, outputFileName.length() - + "Deployment".length()); + outputFileName = outputFileName + + "-${project.version}.zip"; + + outputFileName = outputFileName.replace("-SNAPSHOT", + "." + new java.text.SimpleDateFormat("yyyyMMddHHmmss").format( + new Date())); + + ant.delete(dir: "${unzipdir}/webapps/ROOT/WEB-INF/lib"); + ant.mkdir(dir: + "${unzipdir}/webapps/ROOT/WEB-INF/lib"); + ant.copy(todir: + "${unzipdir}/webapps/ROOT/WEB-INF/lib") { + fileset(dir: "${unzipdir}/lib") { + include(name: "org.openo.common-services.common-utilities.commonlib.db-*.jar") + include(name: "org.openo.common-services.common-utilities.commonlib.cbb-*.jar") + } + } + + ant.delete() { + fileset(dir: "${unzipdir}/lib") { + include(name: "org.openo.common-services.common-utilities.commonlib.db-*.jar") + include(name: "org.openo.common-services.common-utilities.commonlib.cbb-*.jar") + } + } + + /* generate dependencies.list in $APP_ROOT/lib. Requirement for install disk size. */ + System.out.println("------------------------------8------------------") + dependenciesPath="${unzipdir}/lib"; + try { + def writer = new File(dependenciesPath+"/dependencies.list").newWriter('UTF-8') + for (String fileName : new File(dependenciesPath).list()) { + if (fileName.endsWith(".jar")) { + writer.writeLine(fileName); + } + } + writer.close() + } catch (Exception e) { + e.printStackTrace() + } + + /* make the archive. */ + System.out.println("------------------------------9------------------") + ant.zip(destfile: + "${outputdir}/${outputFileName}") { + fileset(dir: "${unzipdir}") { + exclude(name: "**/.gitignore") + } + } + + System.out.println("------------------------------done") + + + + + + + + + + diff --git a/servicegateway/service/pom.xml b/servicegateway/service/pom.xml new file mode 100644 index 00000000..ccf02ee2 --- /dev/null +++ b/servicegateway/service/pom.xml @@ -0,0 +1,162 @@ + + + + + 4.0.0 + + org.openo.gso.gui + servicegateway + 1.0.0-SNAPSHOT + + + service + service + war + + + + org.openo.common-services.common-utilities + commonlib-cbb + 1.0.1-SNAPSHOT + + + + org.openo.common-services.common-utilities + commonlib-restclient + 1.0.1-SNAPSHOT + + + org.apache.cxf + cxf-rt-frontend-jaxrs + 3.1.6 + + + commons-httpclient + commons-httpclient + 3.1 + + + + org.openo.gso.commsvc + org.openo.gso.commsvc.common + 2.0-SNAPSHOT + + + org.springframework + spring-beans + 3.1.0.RELEASE + + + org.springframework + spring-context + 3.1.0.RELEASE + + + org.springframework + spring-jdbc + 3.1.0.RELEASE + + + org.springframework + spring-web + 3.1.0.RELEASE + + + org.osgi + org.osgi.core + 4.1.0 + + + org.mybatis + mybatis + 3.2.7 + + + org.mybatis + mybatis-spring + 1.2.0 + jar + compile + + + com.mchange + c3p0 + 0.9.2.1 + jar + compile + + + org.codehaus.jackson + jackson-jaxrs + 1.9.2 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + com.googlecode.jmockit + jmockit + 1.1 + test + + + junit + junit + 4.12 + test + + + org.jmockit + jmockit-coverage + 1.18 + test + + + com.h2database + h2 + 1.4.190 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + -XX:-UseSplitVerifier + true + true + + ${excludesFile} + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + html + xml + + + + org/**/*Test.class + + + + + + + diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/activator/Activator.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/activator/Activator.java new file mode 100644 index 00000000..befe9328 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/activator/Activator.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.activator; + +import java.io.File; + +import org.apache.commons.lang3.StringUtils; +import org.openo.baseservice.util.impl.SystemEnvVariablesFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Service Start
+ * + * @author + * @since GSO 0.5, 2016-8-10 + */ +public class Activator { + + private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class); + + /** + * start operation by spring
+ * + * @param context + * service context + * @author + * @since GSO 0.5, 2016-8-10 + */ + public void start() { + // register restful to M-Bus when starting service + registerService(); + } + + /** + * register the service to M-Bus
+ * + * @author + * @since GSO 0.5, 2016-8-10 + */ + private void registerService() { + // get the jsonString form the service file + String root = SystemEnvVariablesFactory.getInstance().getAppRoot(); +// String serviceFilePath = root + File.separator + Constant.FILE_PATH_ETC + File.separator +// + Constant.FILE_PATH_REGISTER + File.separator + Constant.FILE_PATH_JSON; +// String jsonInfo = RegisterUtil.readFile(serviceFilePath); +// +// // check the jsonInfo +// if(StringUtils.isEmpty(jsonInfo)) { +// LOGGER.error("GSO ReadFile fail: jsonInfo is null. the serviceFilePath=" + serviceFilePath); +// return; +// } + + // register service by the jsonInfo +// RegisterUtil.registerService(jsonInfo); + } + + /** + * stop operation by spring
+ * + * @param context + * service context + * @author + * @since GSO 0.5, 2016-8-10 + */ + public void stop() { + // no operation + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/constant/Constant.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/constant/Constant.java new file mode 100644 index 00000000..c5283fac --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/constant/Constant.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.constant; + +/** + * Constant definition.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/22 + */ +public class Constant { + + /** + * Service instance name. + */ + public static final String SERVICE_NAME = "name"; + + /** + * Service instance description. + */ + public static final String SERVICE_DESCRIPTION = "description"; + + /** + * Service instance ID. + */ + public static final String SERVICE_INSTANCE_ID = "serviceId"; + + /** + * Service package ID. + */ + public static final String SERVICE_DEF_ID = "serviceDefId"; + + /** + * Service template ID. + */ + public static final String SERVICE_TEMPLATE_ID = "templateId"; + + /** + * Service template name. + */ + public static final String SERVICE_TEMPLATE_NAME = "templateName"; + + /** + * service parameters + */ + public static final String SERVICE_PARAMETERS = "parameters"; + + /** + * Create workflow name. + */ + public static final String WORK_FLOW_PLAN_CREATE = "create"; + + /** + * Delete workflow name. + */ + public static final String WORK_FLOW_PLAN_DELETE = "delete"; + + /** + * filed in wso2 body. + */ + public static final String WSO_PROCESSID = "processId"; + + /** + * filed in wso2 body. + */ + public static final String WSO_PARAMS = "params"; + + /** + * Response result; + */ + public static final String RESPONSE_RESULT = "result"; + + /** + * Response status. + */ + public static final String RESPONSE_STATUS = "status"; + + /** + * Response status description. + */ + public static final String RESPONSE_STATUS_DESCRIPTION = "statusDescription"; + + /** + * Error code of response. + */ + public static final String RESPONSE_ERRORCODE = "errorCode"; + + /** + * Operations success. + */ + public static final String RESPONSE_STATUS_SUCCESS = "success"; + + /** + * Operation failed. + */ + public static final String RESPONSE_STATUS_FAIL = "fail"; + + /** + * Identify of csar. + */ + public static final String CSAR_ID = "csarId"; + + /** + * service identify. + */ + public static final String SERVICE_INDENTIFY = "service"; + + /** + * Predefine parameter for service design + */ + public static final String PREDEFINE_GSO_ID = "predefine_gsoId"; + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private Constant() { + + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/ErrorCode.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/ErrorCode.java new file mode 100644 index 00000000..759344e1 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/ErrorCode.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.exception; + +/** + * Constant Class.
+ *

+ * Define constant for recording error. + *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class ErrorCode { + + /** + * Fail to operate database. + */ + public static final String SVCMGR_OPER_MYSQL_DB_ERROR = "servicemgr.mysql.oper_mysql_db_error"; + + /** + * Parameter is wrong. + */ + public static final String SVCMGR_SERVICEMGR_BAD_PARAM = "servicemgr.bad_param"; + + /** + * Operation is failure. + */ + public static final String SVCMGR_SERVICEMGR_FAIL_OPERATION = "servicemgr.fail.operation"; + + /** + * Package is being deleted. + */ + public static final String SVCMGR_PACKAGE_BEING_DELETED = "servicemgr.package.beingDelete"; + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private ErrorCode() { + + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/HttpCode.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/HttpCode.java new file mode 100644 index 00000000..05f5220f --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/exception/HttpCode.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.exception; + +/** + * Constant Class.
+ *

+ * Define constant for http operation. + *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class HttpCode { + + /** + * Fail to request. + */ + public static final int BAD_REQUEST = 400; + + /** + * Inner error + */ + public static final int INTERNAL_SERVER_ERROR = 500; + + /** + * Not accept request. + */ + public static final int NOT_ACCEPTABLE = 406; + + /** + * Not found service. + */ + public static final int NOT_FOUND = 404; + + /** + * Accept request. + */ + public static final int RESPOND_ACCEPTED = 202; + + /** + * Http response is ok. + */ + public static final int RESPOND_OK = 200; + + /** + * Conflict + */ + public static final int RESPOND_CONFLICT = 409; + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private HttpCode() { + + } + + /** + * Whether request is successful.
+ * + * @param httpCode response code + * @return true or false + * @since GSO 0.5 + */ + public static boolean isSucess(int httpCode) { + return httpCode / 100 == 2; + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java new file mode 100644 index 00000000..9b7796f9 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImpl.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.roa.impl; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; + +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.gso.gui.servicegateway.roa.inf.IServiceGatewayRoaModule; +import org.openo.gso.gui.servicegateway.service.inf.IServiceGateway; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implement class for restful interface.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class ServiceGatewayRoaModuleImpl implements IServiceGatewayRoaModule { + + /** + * Log server. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ServiceGatewayRoaModuleImpl.class); + + /** + * Service manager. + */ + private IServiceGateway serviceManager; + + /** + * @return Returns the serviceManager. + */ + public IServiceGateway getServiceGateway() { + return serviceManager; + } + + /** + * @param serviceManager The serviceManager to set. + */ + public void setServicemanager(IServiceGateway serviceManager) { + this.serviceManager = serviceManager; + } + + /** + * Create service instance.
+ * + * @param servletReq http request + * @return response + * @throws ServiceException when operate database or parameter is wrong. + * @since GSO 0.5 + */ + @Override + public Response createService(HttpServletRequest servletReq) { + Map result = null; + + return Response.accepted().entity(result).build(); + } + + /** + * Delete service instance.
+ * + * @param serviceId service instance id + * @param servletReq http request + * @return response + * @throws ServiceException when operate database or parameter is wrong. + * @since GSO 0.5 + */ + @Override + public Response deleteService(String serviceId, HttpServletRequest servletReq) { + + return null; + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java new file mode 100644 index 00000000..929af508 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/roa/inf/IServiceGatewayRoaModule.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.roa.inf; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; + +import org.openo.baseservice.remoteservice.exception.ServiceException; + +/** + * API for restful interface.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +@Path("/servicegateway/v1/services") +@Consumes({"application/json"}) +@Produces({"application/json"}) +public interface IServiceGatewayRoaModule { + + /** + * Create service instance.
+ * + * @param servletReq http request + * @return response + * @throws ServiceException when operate database or parameter is wrong. + * @since GSO 0.5 + */ + @POST + @Produces({"application/json"}) + @Consumes({"application/json"}) + Response createService(@Context HttpServletRequest servletReq) throws ServiceException; + + /** + * Delete service instance.
+ * + * @param serviceId service instance id + * @param servletReq http request + * @return response + * @throws ServiceException when operate database or parameter is wrong. + * @since GSO 0.5 + */ + @DELETE + @Produces({"application/json"}) + @Consumes({"application/json"}) + @Path("/{serviceId}") + Response deleteService(@PathParam("serviceId") String serviceId, @Context HttpServletRequest servletReq) + throws ServiceException; + +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java new file mode 100644 index 00000000..3f2a48a7 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImpl.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.service.impl; + +import javax.servlet.http.HttpServletRequest; + +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.gso.gui.servicegateway.service.inf.IServiceGateway; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ServiceGateway service class.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class ServiceGatewayImpl implements IServiceGateway { + + /** + * Log service. + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ServiceGatewayImpl.class); + + + /** + * Create service instance.
+ * + * @param reqContent content of request + * @param httpRequest http request + * @throws ServiceException when operate DB or parameter is wrong. + * @since GSO 0.5 + */ + @SuppressWarnings("unchecked") + @Override + public Object createService(String reqContent, HttpServletRequest httpRequest) throws ServiceException { + + + return null; + } + + /** + * Delete service instances.
+ * + * @param serviceId service instance ID + * @param httpRequest http request + * @throws ServiceException operate DB or parameter is wrong. + * @since GSO 0.5 + */ + @Override + public void deleteService(String serviceId, HttpServletRequest httpRequest) throws ServiceException { + + } + +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java new file mode 100644 index 00000000..77b27bd7 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/service/inf/IServiceGateway.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.service.inf; + + +import javax.servlet.http.HttpServletRequest; + +import org.openo.baseservice.remoteservice.exception.ServiceException; + +/** + * Interface to operate service.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public interface IServiceGateway { + + /** + * Create service instance.
+ * + * @param reqContent content of request + * @param httpRequest http request + * @return service instance + * @throws ServiceException when operate DB or parameter is wrong. + * @since GSO 0.5 + */ + Object createService(String reqContent, HttpServletRequest httpRequest) throws ServiceException; + + /** + * Delete service instances.
+ * + * @param serviceId service instance ID + * @param httpRequest http request + * @throws ServiceException operate DB or parameter is wrong. + * @since GSO 0.5 + */ + void deleteService(String serviceId, HttpServletRequest httpRequest) throws ServiceException; + +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/HttpUtil.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/HttpUtil.java new file mode 100644 index 00000000..81546493 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/HttpUtil.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.util.http; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.baseservice.roa.util.restclient.RestfulFactory; +import org.openo.baseservice.roa.util.restclient.RestfulParametes; +import org.openo.baseservice.roa.util.restclient.RestfulResponse; +import org.openo.gso.gui.servicegateway.util.json.JsonUtil; + +/** + * Method class that provides interface to do http request.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/9/1 + */ +public class HttpUtil { + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private HttpUtil() { + + } + + /** + * Get operation.
+ * + * @param url request location + * @param httpHeaders request headers + * @param httpRequest http request + * @return response + * @throws ServiceException when request is failure. + * @since GSO 0.5 + */ + public static RestfulResponse get(final String url, final Map httpHeaders, + HttpServletRequest httpRequest) throws ServiceException { + final RestfulParametes restfulParametes = getRestfulParametes(httpRequest); + for(Map.Entry entry : httpHeaders.entrySet()) { + restfulParametes.putHttpContextHeader(entry.getKey(), entry.getValue()); + } + + return RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP).get(url, restfulParametes); + } + + /** + * Post operation.
+ * + * @param url request location + * @param sendObj request body + * @param httpRequest http request + * @return response + * @throws ServiceException when request is failure. + * @since GSO 0.5 + */ + public static RestfulResponse post(final String url, Object sendObj, HttpServletRequest httpRequest) + throws ServiceException { + + final RestfulParametes restfulParametes = getRestfulParametes(httpRequest); + if(sendObj != null) { + String strJsonReq = JsonUtil.marshal(sendObj); + restfulParametes.setRawData(strJsonReq); + } + + return RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP).post(url, restfulParametes); + } + + /** + * Delete operation.
+ * + * @param url request location + * @param httpRequest http request + * @return response + * @throws ServiceException when request is failure. + * @since GSO 0.5 + */ + public static RestfulResponse delete(final String url, HttpServletRequest httpRequest) throws ServiceException { + final RestfulParametes restfulParametes = getRestfulParametes(httpRequest); + return RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP).delete(url, restfulParametes); + } + + /** + * Put operation.
+ * + * @param url request location + * @param httpHeaders request headers + * @param httpRequest http request + * @return response + * @throws ServiceException when request is failure. + * @since GSO 0.5 + */ + public static RestfulResponse put(final String url, final Map httpHeaders, + HttpServletRequest httpRequest) throws ServiceException { + final RestfulParametes restfulParametes = getRestfulParametes(httpRequest); + for(Map.Entry entry : httpHeaders.entrySet()) { + restfulParametes.putHttpContextHeader(entry.getKey(), entry.getValue()); + } + + return RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP).put(url, restfulParametes); + } + + /** + * Fill in request parameters.
+ * + * @param httpRequest http request + * @return rest parameters + * @since GSO 0.5 + */ + public static RestfulParametes getRestfulParametes(HttpServletRequest httpRequest) { + final RestfulParametes restfulParametes = new RestfulParametes(); + restfulParametes.putHttpContextHeader("Content-Type", "application/json;charset=UTF-8"); + return restfulParametes; + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/ResponseUtils.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/ResponseUtils.java new file mode 100644 index 00000000..d0df0781 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/http/ResponseUtils.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.util.http; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.codehaus.jackson.type.TypeReference; +import org.openo.baseservice.remoteservice.exception.ExceptionArgs; +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.baseservice.roa.util.restclient.RestfulResponse; +import org.openo.gso.gui.servicegateway.constant.Constant; +import org.openo.gso.gui.servicegateway.exception.ErrorCode; +import org.openo.gso.gui.servicegateway.exception.HttpCode; +import org.openo.gso.gui.servicegateway.util.json.JsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Interface to deal response result.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/9/1 + */ +public class ResponseUtils { + + /** + * Log server + */ + private static final Logger LOGGER = LoggerFactory.getLogger(ResponseUtils.class); + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private ResponseUtils() { + } + + /** + * Check whether there is exception.
+ *

+ * If fail, throw the exception. + *

+ * + * @param response rest response + * @param function function name + * @throws ServiceException when the result of rest request is failure. + * @since GSO 0.5 + */ + public static void checkResonseAndThrowException(RestfulResponse response, String function) + throws ServiceException { + if(!HttpCode.isSucess(response.getStatus())) { + ServiceException roaExceptionInfo = null; + try { + roaExceptionInfo = JsonUtil.unMarshal(response.getResponseContent(), ServiceException.class); + } catch(ServiceException e) { + LOGGER.error("transfer the response json string has some error: {}", e); + + ExceptionArgs args = new ExceptionArgs(); + args.setDescArgs(new String[] {"Fail to " + function}); + + throw new ServiceException(ServiceException.DEFAULT_ID, response.getStatus(), args); + } + + throw roaExceptionInfo; + } + } + + /** + * Parse data to assigned type model.
+ * + * @param request restful request + * @param key key + * @param type type + * @return model data + * @throws ServiceException when transfer failed + * @since SDNO 0.5 + */ + @SuppressWarnings("unchecked") + public static List getDataModelFromRsp(String request, String key, Class type) throws ServiceException { + //ValidateUtil.assertStringNotNull(request); + Map requestMap = JsonUtil.unMarshal(request, Map.class); + Object data = requestMap.get(key); + List dataModelList = new LinkedList(); + if(data instanceof List) { + for(Object model : (List)data) { + if(!(model instanceof Map)) { + LOGGER.error("The format of response content is wrong! Not Map."); + throw new ServiceException(ErrorCode.SVCMGR_SERVICEMGR_BAD_PARAM, + "The format of response content is wrong."); + } + + dataModelList.add(JsonUtil.unMarshal(JsonUtil.marshal(model), type)); + } + } + + return dataModelList; + } + + /** + * Parse data to assigned type model.
+ * + * @param request restful request + * @param type type + * @return model data + * @throws ServiceException when transfer failed + * @since SDNO 0.5 + */ + public static T getDataModelFromRspList(String request, TypeReference type) throws ServiceException { + //ValidateUtil.assertStringNotNull(request); + return JsonUtil.unMarshal(request, type); + } + + /** + * Set operation result.
+ * + * @param status status fail or success + * @param exception operation exception information + * @param errorCode error code + * @return result in form of map + * @since GSO 0.5 + */ + public static Map setOperateStatus(String status, ServiceException exception, String errorCode) { + Map result = new HashMap(); + result.put(Constant.RESPONSE_STATUS, status); + if(null == exception) { + result.put(Constant.RESPONSE_STATUS_DESCRIPTION, status); + } else { + if((null != exception.getExceptionArgs()) && (null != exception.getExceptionArgs().getDescArgs())) { + result.put(Constant.RESPONSE_STATUS_DESCRIPTION, exception.getExceptionArgs().getDescArgs().toString()); + } + } + result.put(Constant.RESPONSE_ERRORCODE, errorCode); + + return result; + } +} diff --git a/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/json/JsonUtil.java b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/json/JsonUtil.java new file mode 100644 index 00000000..afb3c238 --- /dev/null +++ b/servicegateway/service/src/main/java/org/openo/gso/gui/servicegateway/util/json/JsonUtil.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.util.json; + +import java.io.IOException; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; +import org.codehaus.jackson.type.TypeReference; +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.gso.gui.servicegateway.exception.ErrorCode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import net.sf.json.JSON; + +/** + * Interface for json analyzing.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/9/1 + */ +public class JsonUtil { + + /** + * Log service + */ + private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtil.class); + + /** + * Mapper. + */ + private static final ObjectMapper MAPPER = new ObjectMapper(); + + static { + MAPPER.setDeserializationConfig(MAPPER.getDeserializationConfig() + .without(org.codehaus.jackson.map.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES)); + MAPPER.setSerializationInclusion(Inclusion.NON_NULL); + } + + /** + * Constructor
+ *

+ *

+ * + * @since GSO 0.5 + */ + private JsonUtil() { + + } + + /** + * Parse the string in form of json.
+ * + * @param jsonstr json string. + * @param type that convert json string to + * @return + * @throws ServiceException + * @since GSO 0.5 + */ + public static T unMarshal(String jsonstr, Class type) throws ServiceException { + try { + return MAPPER.readValue(jsonstr, type); + } catch(IOException e) { + LOGGER.error("jsonstr unMarshal failed!", e); + throw new ServiceException(ErrorCode.SVCMGR_SERVICEMGR_BAD_PARAM, "jsonstr unMarshal failed!"); + } + } + + /** + * Parse the string in form of json.
+ * + * @param jsonstr json string. + * @param type that convert json string to + * @return + * @throws ServiceException + * @since GSO 0.5 + */ + public static T unMarshal(String jsonstr, TypeReference type) throws ServiceException { + try { + return MAPPER.readValue(jsonstr, type); + } catch(IOException e) { + LOGGER.error("jsonstr unMarshal failed!", e); + throw new ServiceException(ErrorCode.SVCMGR_SERVICEMGR_BAD_PARAM, "jsonstr unMarshal failed!"); + } + } + + /** + * Convert object to json string.
+ * + * @param srcObj data object + * @return json string + * @throws ServiceException when fail to convert. + * @since GSO 0.5 + */ + public static String marshal(Object srcObj) throws ServiceException { + if(srcObj instanceof JSON) { + return srcObj.toString(); + } + try { + return MAPPER.writeValueAsString(srcObj); + } catch(IOException e) { + LOGGER.error("srcObj marshal failed!", e); + throw new ServiceException(ErrorCode.SVCMGR_SERVICEMGR_BAD_PARAM, "srcObj marshal failed!"); + } + } + + /** + * Get mapper.
+ * + * @return mapper + * @since GSO 0.5 + */ + public static ObjectMapper getMapper() { + return MAPPER; + } +} diff --git a/servicegateway/service/src/main/resources/META-INF/auth.properties b/servicegateway/service/src/main/resources/META-INF/auth.properties new file mode 100644 index 00000000..121f2944 --- /dev/null +++ b/servicegateway/service/src/main/resources/META-INF/auth.properties @@ -0,0 +1,18 @@ +############################################################################### +# /* +# * Copyright (c) 2016, Huawei Technologies Co., Ltd. +# * +# * 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. +# */ +############################################################################### +auth=disable diff --git a/servicegateway/service/src/main/resources/service-configure.properties b/servicegateway/service/src/main/resources/service-configure.properties new file mode 100644 index 00000000..45c2564b --- /dev/null +++ b/servicegateway/service/src/main/resources/service-configure.properties @@ -0,0 +1,17 @@ +############################################################################### +# /* +# * Copyright (c) 2016, Huawei Technologies Co., Ltd. +# * +# * 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. +# */ +############################################################################### diff --git a/servicegateway/service/src/main/resources/spring/service.xml b/servicegateway/service/src/main/resources/spring/service.xml new file mode 100644 index 00000000..c91ed1ca --- /dev/null +++ b/servicegateway/service/src/main/resources/spring/service.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/servicegateway/service/src/main/webapp/WEB-INF/web.xml b/servicegateway/service/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..6f06aed3 --- /dev/null +++ b/servicegateway/service/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,33 @@ + + + + + + + CXFServlet + org.apache.cxf.transport.servlet.CXFServlet + 1 + + + CXFServlet + /openoapi/* + + + + org.springframework.web.context.ContextLoaderListener + + + contextConfigLocation + WEB-INF/classes/spring/*.xml,classpath*:spring/applicationContext.xml,classpath*:spring/service.xml + + + + 10000000 + + diff --git a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/ErrorCodeTest.java b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/ErrorCodeTest.java new file mode 100644 index 00000000..422c5e41 --- /dev/null +++ b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/ErrorCodeTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.exception; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +/** + * Test Constant class.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class ErrorCodeTest { + + @Test + public void test() { + assertEquals("servicemgr.mysql.oper_mysql_db_error", ErrorCode.SVCMGR_OPER_MYSQL_DB_ERROR); + assertEquals("servicemgr.bad_param", ErrorCode.SVCMGR_SERVICEMGR_BAD_PARAM); + } + +} diff --git a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/HttpCodeTest.java b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/HttpCodeTest.java new file mode 100644 index 00000000..cefdb50b --- /dev/null +++ b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/exception/HttpCodeTest.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Test Constant class.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/4 + */ +public class HttpCodeTest { + + @Test + public void test() { + assertEquals(400, HttpCode.BAD_REQUEST); + assertEquals(500, HttpCode.INTERNAL_SERVER_ERROR); + assertEquals(406, HttpCode.NOT_ACCEPTABLE); + assertEquals(404, HttpCode.NOT_FOUND); + assertEquals(202, HttpCode.RESPOND_ACCEPTED); + assertEquals(200, HttpCode.RESPOND_OK); + assertTrue(HttpCode.isSucess(200)); + assertFalse(HttpCode.isSucess(400)); + } + +} diff --git a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImplTest.java b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImplTest.java new file mode 100644 index 00000000..8b5c6c67 --- /dev/null +++ b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/roa/impl/ServiceGatewayRoaModuleImplTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.roa.impl; + +import static org.junit.Assert.assertNotNull; + +import java.io.IOException; +import java.io.Reader; +import java.sql.Connection; +import java.sql.SQLException; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.jdbc.ScriptRunner; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.openo.baseservice.remoteservice.exception.ServiceException; +import org.openo.gso.gui.servicegateway.service.impl.ServiceGatewayImpl; + +/** + * Test ServicemgrRoaModuleImpl class.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/3 + */ +public class ServiceGatewayRoaModuleImplTest { + + /** + * Service ROA. + */ + ServiceGatewayRoaModuleImpl serviceRoa = new ServiceGatewayRoaModuleImpl(); + + /** + * Service manager. + */ + ServiceGatewayImpl serviceManager = new ServiceGatewayImpl(); + + + /** + * Http request. + */ + HttpServletRequest httpRequest; + + /** + * Before executing UT, start sql.
+ * + * @since GSO 0.5 + */ + @Before + public void start() throws IOException, SQLException { + + } + + + + /** + * After executing UT, close session
+ * + * @since GSO 0.5 + */ + @After + public void stop() { + + } + + /** + * Test create service.
+ * + * @throws ServiceException when fail to operate database or parameter is wrong. + * @since GSO 0.5 + */ + @Test + public void testCreateService() throws ServiceException { + + } + + /** + * Test delete service.
+ * + * @throws ServiceException when fail to operate database or parameter is wrong. + * @since GSO 0.5 + */ + @Test + public void testTeleteService() throws ServiceException { + serviceRoa.deleteService("1", httpRequest); + } + +} diff --git a/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java new file mode 100644 index 00000000..734add90 --- /dev/null +++ b/servicegateway/service/src/test/java/org/openo/gso/gui/servicegateway/service/impl/ServiceGatewayImplTest.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * + * 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.openo.gso.gui.servicegateway.service.impl; + + +import javax.servlet.http.HttpServletRequest; + +import org.junit.Before; +import org.junit.Test; +import org.openo.baseservice.remoteservice.exception.ServiceException; + +/** + * Test ServiceGatewayImpl Class.
+ *

+ *

+ * + * @author + * @version GSO 0.5 2016/8/3 + */ +public class ServiceGatewayImplTest { + + /** + * Service manager. + */ + ServiceGatewayImpl serviceManager = new ServiceGatewayImpl(); + + + /** + * Http request. + */ + HttpServletRequest httpRequest; + + @Before + public void start() { + } + + /** + * Invalid parameter.
+ * + * @throws ServiceException when parameter is wrong. + * @since GSO 0.5 + */ + @Test(expected = ServiceException.class) + public void testCreateServiceFail() throws ServiceException { + serviceManager.createService(null, httpRequest); + } + + /** + * Invalid parameter.
+ * + * @throws ServiceException when parameter is wrong. + * @since GSO 0.5 + */ + @Test(expected = ServiceException.class) + public void testDeleteServiceFail() throws ServiceException { + serviceManager.deleteService(null, httpRequest); + } + +} -- cgit 1.2.3-korg