diff options
author | Priyadharshini <priyadharshini.b96@wipro.com> | 2020-03-16 05:55:43 +0000 |
---|---|---|
committer | Priyadharshini <priyadharshini.b96@wipro.com> | 2020-03-23 09:11:55 +0530 |
commit | cfb63b2c5c381434a6fdea794ad0c2e89a2be328 (patch) | |
tree | 586b997a0634198bf0b0ded5dbbde51ff7311b27 /ransim/ransimctrlr/packages/base | |
parent | 44d8e15bda321936078b99f8222175a8ab016bc6 (diff) |
Initial code check-in RANSim Controller and RANSim GUI
Issue-ID: INT-1485
Signed-off-by: Priyadharshini <priyadharshini.b96@wipro.com>
Change-Id: I99fe693065072ff5c9b188f2177488a4cd93237d
Diffstat (limited to 'ransim/ransimctrlr/packages/base')
13 files changed, 790 insertions, 0 deletions
diff --git a/ransim/ransimctrlr/packages/base/pom.xml b/ransim/ransimctrlr/packages/base/pom.xml new file mode 100644 index 0000000..eb5ef69 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/pom.xml @@ -0,0 +1,165 @@ +<!-- + ============LICENSE_START======================================================= + Ransim Controller + ================================================================================ + Copyright (C) 2020 Wipro Limited Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.onap.ransim</groupId> + <artifactId>packages</artifactId> + <version>1.0.0-SNAPSHOT</version> + </parent> + + <artifactId>base</artifactId> + <packaging>pom</packaging> + + <name>Base Package</name> + <description>Ransim Controller Base Packaging</description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-ransim</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/ransim/webapps</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <artifactItems> + <artifactItem> + <groupId>org.onap.ransim</groupId> + <artifactId>RANSIM-CTRLR</artifactId> + <version>${project.version}</version> + <type>war</type> + <destFileName>ransim.war</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + <execution> + <id>copy-ransimui</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/ransim/webapps</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <artifactItems> + <artifactItem> + <groupId>org.onap.ransim</groupId> + <artifactId>RANSIM-GUI</artifactId> + <version>${project.version}</version> + <type>war</type> + <destFileName>ransimui.war</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + <execution> + <id>copy-tomcat-binary</id> + <phase>prepare-package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/install/3rdparty/</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <artifactItems> + <artifactItem> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat</artifactId> + <version>8.0.23</version> + <type>tar.gz</type> + <destFileName>apache-tomcat-8.0.23.tar.gz</destFileName> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>single</goal> + </goals> + <phase>package</phase> + <configuration> + <descriptors> + <descriptor>src/assembly/zip.xml</descriptor> + </descriptors> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>unix_pe_version</id> + <activation> + <os> + <family>!windows</family> + </os> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.5.0</version> + <executions> + <execution> + <id>create-version-file</id> + <goals> + <goal>exec</goal> + </goals> + <phase>prepare-package</phase> + <configuration> + <executable>/bin/bash</executable> + <arguments> + <argument>-c</argument> + <argument>mkdir -p target ; echo -e 'version="${project.version}"\ndescription="Open ONAP Policy Engine"\nbuildTag="'"${BUILD_TAG}"'"\ncommit="'"${GIT_COMMIT}"'"\ntimestamp="${maven.build.timestamp}"' >target/build.info</argument> + </arguments> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> diff --git a/ransim/ransimctrlr/packages/base/src/assembly/zip.xml b/ransim/ransimctrlr/packages/base/src/assembly/zip.xml new file mode 100644 index 0000000..fb13732 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/assembly/zip.xml @@ -0,0 +1,52 @@ +<!-- + ============LICENSE_START======================================================= + Ransim Controller + ================================================================================ + Copyright (C) 2020 Wipro Limited + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<assembly> + <id>base</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>${project.build.directory}</directory> + <outputDirectory>etc</outputDirectory> + <includes><include>build.info</include></includes> + <fileMode>700</fileMode> + <directoryMode>700</directoryMode> + </fileSet> + <fileSet> + <directory>src/files</directory> + <outputDirectory>.</outputDirectory> + <fileMode>700</fileMode> + <directoryMode>700</directoryMode> + </fileSet> + <fileSet> + <directory>${project.build.directory}/install/3rdparty/</directory> + <outputDirectory>install/3rdparty/</outputDirectory> + <fileMode>700</fileMode> + <directoryMode>700</directoryMode> + </fileSet> + <fileSet> + <directory>${project.build.directory}/ransim/webapps</directory> + <outputDirectory>install/servers/ransim/webapps</outputDirectory> + <fileMode>700</fileMode> + <directoryMode>700</directoryMode> + </fileSet> + </fileSets> +</assembly> diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/audit.cron b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/audit.cron new file mode 100644 index 0000000..1e6bbee --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/audit.cron @@ -0,0 +1 @@ +0 0 * * * . ${{POLICY_HOME}}/etc/profile.d/env.sh; elk.sh --audit < /dev/null > /dev/null 2>&1 diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/logrotate.cron b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/logrotate.cron new file mode 100644 index 0000000..aa78eed --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/logrotate.cron @@ -0,0 +1 @@ +5 1 * * * /usr/sbin/logrotate -s ${{POLICY_HOME}}/var/logrotate.status ${{POLICY_HOME}}/etc/logrotate.d/monitor.conf diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/monitor.cron b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/monitor.cron new file mode 100644 index 0000000..4272bf4 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/cron.d/monitor.cron @@ -0,0 +1 @@ +* * * * * . ${{POLICY_HOME}}/etc/profile.d/env.sh; monitor.sh </dev/null > /dev/null 2>&1 diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/monitor/monitor.cfg b/ransim/ransimctrlr/packages/base/src/files/etc/monitor/monitor.cfg new file mode 100644 index 0000000..64ef7d9 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/monitor/monitor.cfg @@ -0,0 +1,9 @@ +# Line Format: component=status where +# component=ransim and +# status=on|off|uninstalled where +# on: component is to be monitored and should started +# off: component is to be monitored and should stopped +# uninstalled: component is NOT to be monitored +# There should be no component duplicate lines + +ransim=uninstalled diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/env.sh b/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/env.sh new file mode 100644 index 0000000..de0dcc0 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/env.sh @@ -0,0 +1,25 @@ +### +# ============LICENSE_START======================================================= +# ONAP Policy Engine +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +export POLICY_HOME=${{POLICY_HOME}} +export POLICY_USER=${{POLICY_USER}} +export POLICY_GROUP=${{POLICY_GROUP}} +export KEYSTORE_PASSWD=${{KEYSTORE_PASSWD}} + +export JAVA_HOME=${{JAVA_HOME}} +export PATH=${PATH}:${{POLICY_HOME}}/bin diff --git a/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/su.cfg b/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/su.cfg new file mode 100644 index 0000000..8ba4edd --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/etc/profile.d/su.cfg @@ -0,0 +1 @@ +#name=value pairs for su purposes diff --git a/ransim/ransimctrlr/packages/base/src/files/install/mysql/data/181010_upgrade_script.sql b/ransim/ransimctrlr/packages/base/src/files/install/mysql/data/181010_upgrade_script.sql new file mode 100644 index 0000000..5f0548a --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/install/mysql/data/181010_upgrade_script.sql @@ -0,0 +1,33 @@ +/*- +* ============LICENSE_START======================================================= +* Ransim Controller DB +* ================================================================================ +* Copyright (C) 2020 Wipro Limited Intellectual Property. All rights reserved. +* ================================================================================ +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============LICENSE_END========================================================= +*/ + +CREATE DATABASE IF NOT EXISTS `ransim_db`; + +USE `ransim_db`; +set foreign_key_checks=0; + +-- +-- Increasing the Database variable timeouts +-- + +set wait_timeout=2147483; +set interactive_timeout=2147483; + +-- drop table if exists `constrainttype`; diff --git a/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/conf/server.xml b/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/conf/server.xml new file mode 100644 index 0000000..4738420 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/conf/server.xml @@ -0,0 +1,128 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + ============LICENSE_START======================================================= + Ransim Controller + ================================================================================ + Copyright (C) 2020 Wipro Limited Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<!-- + 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. +--> +<!-- Note: A "Server" is not itself a "Container", so you may not + define subcomponents such as "Valves" at this level. + Documentation at /docs/config/server.html + --> +<Server port="${{TOMCAT_SHUTDOWN_PORT}}" shutdown="SHUTDOWN"> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> + <!-- Security listener. Documentation at /docs/config/listeners.html + <Listener className="org.apache.catalina.security.SecurityListener" /> + --> + <!--APR library loader. Documentation at /docs/apr.html --> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> + <!-- Prevent memory leaks due to use of particular java/javax APIs--> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> + + <!-- Global JNDI resources + Documentation at /docs/jndi-resources-howto.html + --> + <GlobalNamingResources> + <!-- Editable user database that can also be used by + UserDatabaseRealm to authenticate users + --> + <Resource name="UserDatabase" auth="Container" + type="org.apache.catalina.UserDatabase" + description="User database that can be updated and saved" + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" + pathname="conf/tomcat-users.xml" /> + </GlobalNamingResources> + + <!-- A "Service" is a collection of one or more "Connectors" that share + a single "Container" Note: A "Service" is not itself a "Container", + so you may not define subcomponents such as "Valves" at this level. + Documentation at /docs/config/service.html + --> + <Service name="Catalina"> + + <Connector port="${{SSL_HTTP_CONNECTOR_PORT}}" protocol="org.apache.coyote.http11.Http11NioProtocol" + maxThreads="150" /> + + <!-- Define an AJP 1.3 Connector on port 8009 --> + <Connector port="${{SSL_AJP_CONNECTOR_PORT}}" protocol="AJP/1.3" redirectPort="${{SSL_AJP_CONNECTOR_REDIRECT_PORT}}" /> + + + <!-- An Engine represents the entry point (within Catalina) that processes + every request. The Engine implementation for Tomcat stand alone + analyzes the HTTP headers included with the request, and passes them + on to the appropriate Host (virtual host). + Documentation at /docs/config/engine.html --> + + <!-- You should set jvmRoute to support load-balancing via AJP ie : + <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> + --> + <Engine name="Catalina" defaultHost="localhost"> + + <!--For clustering, please take a look at documentation at: + /docs/cluster-howto.html (simple how to) + /docs/config/cluster.html (reference documentation) --> + <!-- + <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> + --> + + <!-- Use the LockOutRealm to prevent attempts to guess user passwords + via a brute-force attack --> + <Realm className="org.apache.catalina.realm.LockOutRealm"> + <!-- This Realm uses the UserDatabase configured in the global JNDI + resources under the key "UserDatabase". Any edits + that are performed against this UserDatabase are immediately + available for use by the Realm. --> + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" + resourceName="UserDatabase"/> + </Realm> + + <Host name="localhost" appBase="webapps" + unpackWARs="true" autoDeploy="true"> + + <!-- SingleSignOn valve, share authentication between web applications + Documentation at: /docs/config/valve.html --> + <!-- + <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> + --> + + <!-- Access log processes all example. + Documentation at: /docs/config/valve.html + Note: The pattern used is equivalent to using pattern="common" --> + <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" + prefix="localhost_access_log" suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" /> + + </Host> + </Engine> + </Service> +</Server> diff --git a/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/init.d/tomcatd b/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/init.d/tomcatd new file mode 100644 index 0000000..df20485 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/install/servers/common/tomcat/init.d/tomcatd @@ -0,0 +1,91 @@ +#!/bin/bash + +function update_monitor() { + COMPONENT=$1 + STATUS=$2 + if [[ -f ${POLICY_HOME}/etc/monitor/monitor.cfg ]]; then + /bin/sed -i.bak \ + -e "s/^${COMPONENT}=.*/${COMPONENT}=${STATUS}/g" \ + ${POLICY_HOME}/etc/monitor/monitor.cfg + fi +} + +# unmonitored stop, does not change monitor status (immutable) +function um_stop() { + cd ${TOMCAT_BASE}/bin/ + ${TOMCAT_BASE}/bin/catalina.sh stop -force + + # make sure .. + pid=$(pgrep -f -u ${POLICY_USER} "${TOMCAT_RUNNING}" 2> /dev/null) + RETVAL=$? + if [[ ${RETVAL} == 0 ]]; then + pkill -u ${POLICY_USER} -f "${TOMCAT_RUNNING}" -KILL + RETVAL=$? + fi +} + +function stop() { + um_stop + update_monitor ${{COMPONENT_TYPE}} off +} + +# unmonitored start, does not change monitor status (immutable) +function um_start() { + cd ${TOMCAT_BASE}/bin/ + ${TOMCAT_BASE}/bin/catalina.sh start + RETVAL=$? +} + +function start() { + um_start + if [[ ${RETVAL} != 0 ]]; then + update_monitor ${{COMPONENT_TYPE}} off + else + update_monitor ${{COMPONENT_TYPE}} on + fi +} + +TOMCAT_BASE=${POLICY_HOME}/servers/${{COMPONENT_TYPE}} +TOMCAT_RUNNING="^$JAVA_HOME/bin/java .* -Dcatalina.base=${TOMCAT_BASE} .* start$" + +PWD_ENTER=${PWD} +RETVAL=0 + +. ${POLICY_HOME}/etc/profile.d/env.sh + +case "$1" in + status) + pid=$(pgrep -f -u ${POLICY_USER} "${TOMCAT_RUNNING}" 2> /dev/null) + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo "running with pid ${pid}" + else + echo "stopped" + fi + ;; + restart) + stop + sleep 2 + start + ;; + start) + start + ;; + umstart) + um_start + ;; + stop) + stop + ;; + umstop) + um_stop + ;; + *) + cd ${TOMCAT_BASE}/bin/ + ${TOMCAT_BASE}/bin/catalina.sh "$@" + RETVAL=$? + ;; +esac + +cd ${PWD_ENTER} +exit ${RETVAL} diff --git a/ransim/ransimctrlr/packages/base/src/files/install/servers/configs/conf/server.xml b/ransim/ransimctrlr/packages/base/src/files/install/servers/configs/conf/server.xml new file mode 100644 index 0000000..7f45094 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/install/servers/configs/conf/server.xml @@ -0,0 +1,167 @@ +<?xml version='1.0' encoding='utf-8'?> +<!-- + ============LICENSE_START======================================================= + Ransim Controller + ================================================================================ + Copyright (C) 2020 Wipro Limited + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<!-- + 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. +--> +<!-- Note: A "Server" is not itself a "Container", so you may not + define subcomponents such as "Valves" at this level. + Documentation at /docs/config/server.html + --> +<Server port="${{TOMCAT_SHUTDOWN_PORT}}" shutdown="SHUTDOWN"> + <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> + <!-- Security listener. Documentation at /docs/config/listeners.html + <Listener className="org.apache.catalina.security.SecurityListener" /> + --> + <!--APR library loader. Documentation at /docs/apr.html --> + <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> + <!-- Prevent memory leaks due to use of particular java/javax APIs--> + <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> + <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> + <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> + + <!-- Global JNDI resources + Documentation at /docs/jndi-resources-howto.html + --> + <GlobalNamingResources> + <!-- Editable user database that can also be used by + UserDatabaseRealm to authenticate users + --> + <Resource name="UserDatabase" auth="Container" + type="org.apache.catalina.UserDatabase" + description="User database that can be updated and saved" + factory="org.apache.catalina.users.MemoryUserDatabaseFactory" + pathname="conf/tomcat-users.xml" /> + </GlobalNamingResources> + + <!-- A "Service" is a collection of one or more "Connectors" that share + a single "Container" Note: A "Service" is not itself a "Container", + so you may not define subcomponents such as "Valves" at this level. + Documentation at /docs/config/service.html + --> + <Service name="Catalina"> + + <!--The connectors can use a shared executor, you can define one or more named thread pools--> + <!-- + <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" + maxThreads="150" minSpareThreads="4"/> + --> + + + <!-- A "Connector" represents an endpoint by which requests are received + and responses are returned. Documentation at : + Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) + Java AJP Connector: /docs/config/ajp.html + APR (HTTP/AJP) Connector: /docs/apr.html + Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 + --> + + <Connector port="${{SSL_HTTP_CONNECTOR_PORT}}" protocol="HTTP/1.1" + connectionTimeout="20000" + redirectPort="${{SSL_HTTP_CONNECTOR_REDIRECT_PORT}}" /> + + <!-- A "Connector" using the shared thread pool--> + <!-- + <Connector executor="tomcatThreadPool" + port="8080" protocol="HTTP/1.1" + connectionTimeout="20000" + redirectPort="8443" /> + --> + <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 + This connector uses the NIO implementation that requires the JSSE + style configuration. When using the APR/native implementation, the + OpenSSL style configuration is required as described in the APR/native + documentation --> + + <!-- + <Connector port="${{SSL_HTTP_CONNECTOR_PORT}}" protocol="org.apache.coyote.http11.Http11NioProtocol" + maxThreads="150" SSLEnabled="true" scheme="https" secure="true" + clientAuth="false" sslProtocol="TLS" + keystoreFile="${{POLICY_HOME}}/etc/ssl/policy-keystore" keystorePass="${{KEYSTORE_PASSWD}}"/> + --> + + + <!-- Define an AJP 1.3 Connector on port 8009 --> + <!-- + <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> + --> + + + <!-- An Engine represents the entry point (within Catalina) that processes + every request. The Engine implementation for Tomcat stand alone + analyzes the HTTP headers included with the request, and passes them + on to the appropriate Host (virtual host). + Documentation at /docs/config/engine.html --> + + <!-- You should set jvmRoute to support load-balancing via AJP ie : + <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> + --> + <Engine name="Catalina" defaultHost="localhost"> + + <!--For clustering, please take a look at documentation at: + /docs/cluster-howto.html (simple how to) + /docs/config/cluster.html (reference documentation) --> + <!-- + <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> + --> + + <!-- Use the LockOutRealm to prevent attempts to guess user passwords + via a brute-force attack --> + <Realm className="org.apache.catalina.realm.LockOutRealm"> + <!-- This Realm uses the UserDatabase configured in the global JNDI + resources under the key "UserDatabase". Any edits + that are performed against this UserDatabase are immediately + available for use by the Realm. --> + <Realm className="org.apache.catalina.realm.UserDatabaseRealm" + resourceName="UserDatabase"/> + </Realm> + + <Host name="localhost" appBase="webapps" + unpackWARs="true" autoDeploy="true"> + + <!-- SingleSignOn valve, share authentication between web applications + Documentation at: /docs/config/valve.html --> + <!-- + <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> + --> + + <!-- Access log processes all example. + Documentation at: /docs/config/valve.html + Note: The pattern used is equivalent to using pattern="common" --> + <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" + prefix="localhost_access_log" suffix=".txt" + pattern="%h %l %u %t "%r" %s %b" /> + + </Host> + </Engine> + </Service> +</Server> diff --git a/ransim/ransimctrlr/packages/base/src/files/m2/settings.xml b/ransim/ransimctrlr/packages/base/src/files/m2/settings.xml new file mode 100644 index 0000000..89edce1 --- /dev/null +++ b/ransim/ransimctrlr/packages/base/src/files/m2/settings.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ============LICENSE_START======================================================= + Ransim Controller + ================================================================================ + Copyright (C) 2020 Wipro Limited + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + + +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>ransimapp-profile</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + + <repositories> + <repository> + <id>${{snapshotRepositoryID}}</id> + <url>${{snapshotRepositoryURL}}</url> + <releases> + <enabled>false</enabled> + <updatePolicy>always</updatePolicy> + </releases> + <snapshots> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + </snapshots> + </repository> + <repository> + <id>onap-releases</id> + <name>onap-releases</name> + <url>https://nexus.onap.org/content/repositories/releases/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>onap-staging</id> + <name>onap-staging</name> + <url>https://nexus.onap.org/content/repositories/staging/</url> + <releases> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>onap-snapshots</id> + <name>onap-snapshots</name> + <url>https://nexus.onap.org/content/repositories/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + </snapshots> + </repository> + <repository> + <id>${{releaseRepositoryID}}</id> + <url>${{releaseRepositoryURL}}</url> + <releases> + <enabled>true</enabled> + <updatePolicy>always</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + <updatePolicy>always</updatePolicy> + </snapshots> + </repository> + </repositories> + + </profile> + </profiles> + + <activeProfiles> + <activeProfile>ransimapp-profile</activeProfile> + </activeProfiles> + + <servers> + <server> + <id>${{snapshotRepositoryID}}</id> + <username>${{repositoryUsername}}</username> + <password>${{repositoryPassword}}</password> + </server> + <server> + <id>${{releaseRepositoryID}}</id> + <username>${{repositoryUsername}}</username> + <password>${{repositoryPassword}}</password> + </server> + </servers> + +</settings> |