summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@linuxfoundation.org>2020-12-01 11:48:20 -0800
committerJessica Wagantall <jwagantall@linuxfoundation.org>2020-12-01 11:48:20 -0800
commit32fb53c13342d5ad353c839b7ffd0ca85d14bd48 (patch)
treef1b92068cf7b79d29e96243899e12495abb4795a /filters
parent53eacd8519a535f96d8b4231e48925324f1086dd (diff)
Migrate sli-core files
Migrate sli-core repo files into new directory "core". Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
Diffstat (limited to 'filters')
-rwxr-xr-xfilters/.gitignore34
-rwxr-xr-xfilters/.sonar/checkstyle.xml1
-rwxr-xr-xfilters/.sonar/pmd.xml67
-rwxr-xr-xfilters/README14
-rwxr-xr-xfilters/installer/pom.xml126
-rw-r--r--filters/installer/src/assembly/assemble_installer_zip.xml61
-rw-r--r--filters/installer/src/assembly/assemble_mvnrepo_zip.xml49
-rw-r--r--filters/installer/src/main/resources/scripts/install-feature.sh39
-rw-r--r--filters/pom.xml27
-rwxr-xr-xfilters/provider/pom.xml29
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java40
-rw-r--r--filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java7
-rw-r--r--filters/provider/src/test/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilterTest.java23
13 files changed, 0 insertions, 517 deletions
diff --git a/filters/.gitignore b/filters/.gitignore
deleted file mode 100755
index b73caf31e..000000000
--- a/filters/.gitignore
+++ /dev/null
@@ -1,34 +0,0 @@
-#####standard .git ignore entries#####
-
-## IDE Specific Files ##
-org.eclipse.core.resources.prefs
-.classpath
-.project
-.settings
-.idea
-.externalToolBuilders
-maven-eclipse.xml
-workspace
-
-## Compilation Files ##
-*.class
-**/target
-target
-target-ide
-MANIFEST.MF
-
-## Misc Ignores (OS specific etc) ##
-bin/
-dist
-*~
-*.ipr
-*.iml
-*.iws
-classes
-out/
-.DS_STORE
-.metadata
-
-## Folders which contain auto generated source code ##
-yang-gen-config
-yang-gen-sal
diff --git a/filters/.sonar/checkstyle.xml b/filters/.sonar/checkstyle.xml
deleted file mode 100755
index 3fa231535..000000000
--- a/filters/.sonar/checkstyle.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"><!-- Generated by Sonar --><module name="Checker"><module name="SuppressionCommentFilter"/><module name="TreeWalker"><module name="FileContentsHolder"/> <module name="ClassFanOutComplexity"><property name="severity" value="warning"/></module><module name="NestedForDepth"><property name="severity" value="warning"/><property name="max" value="1"/></module><module name="ClassDataAbstractionCoupling"><property name="severity" value="warning"/></module></module></module> \ No newline at end of file
diff --git a/filters/.sonar/pmd.xml b/filters/.sonar/pmd.xml
deleted file mode 100755
index 80343b3bd..000000000
--- a/filters/.sonar/pmd.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ruleset>
- <rule ref="rulesets/java/naming.xml/BooleanGetMethodName">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/j2ee.xml/StaticEJBFieldShouldBeFinal">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/coupling.xml/CouplingBetweenObjects">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/codesize.xml/TooManyMethods">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/naming.xml/AvoidFieldNameMatchingTypeName">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/basic.xml/DoubleCheckedLocking">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/naming.xml/AvoidFieldNameMatchingMethodName">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/coupling.xml/ExcessiveImports">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/basic.xml/OverrideBothEqualsAndHashcode">
- <priority>2</priority>
- </rule>
- <rule ref="rulesets/java/naming.xml/ShortMethodName">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/basic.xml/BooleanInstantiation">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/codesize.xml/TooManyFields">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/controversial.xml/AvoidUsingNativeCode">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/optimizations.xml/UseStringBufferForStringAppends">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/coupling.xml/LooseCoupling">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/design.xml/NonThreadSafeSingleton">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/j2ee.xml/DoNotUseThreads">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/sunsecure.xml/ArrayIsStoredDirectly">
- <priority>5</priority>
- </rule>
- <rule ref="rulesets/java/sunsecure.xml/MethodReturnsInternalArray">
- <priority>2</priority>
- </rule>
- <rule ref="rulesets/java/design.xml/AssignmentToNonFinalStatic">
- <priority>3</priority>
- </rule>
- <rule ref="rulesets/java/strictexception.xml/AvoidCatchingGenericException">
- <priority>3</priority>
- </rule>
-</ruleset>
-
diff --git a/filters/README b/filters/README
deleted file mode 100755
index 5c1b3d627..000000000
--- a/filters/README
+++ /dev/null
@@ -1,14 +0,0 @@
-
-/restconf filters are enabled by specifying filter chain in
- /opt/opendaylight/current/etc/org.opendaylight.aaa.filterchain.cfg
-and enabling bundle class loading
- >bundle:dynamic-import org.onap.ccsdk.sli.core.filters-provider
-
-loggers:
- org.onap.ccsdk.sli.core.filters.audit
- org.onap.ccsdk.sli.core.filters.metric
- org.onap.ccsdk.sli.core.filters.request.response
-
-
-
-
diff --git a/filters/installer/pom.xml b/filters/installer/pom.xml
deleted file mode 100755
index fae31a12b..000000000
--- a/filters/installer/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.ccsdk.parent</groupId>
- <artifactId>odlparent-lite</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters-installer</artifactId>
- <version>1.1.1-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
-
- <properties>
- <application.name>ccsdk-filters</application.name>
- <features.boot>${application.name}</features.boot>
- <features.repositories>mvn:org.onap.ccsdk.sli.core/${features.boot}/${project.version}/xml/features</features.repositories>
- <include.transitive.dependencies>false</include.transitive.dependencies>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>maven-repo-zip</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <attach>true</attach>
- <finalName>stage/${application.name}-${project.version}</finalName>
- <descriptors>
- <descriptor>src/assembly/assemble_mvnrepo_zip.xml</descriptor>
- </descriptors>
- <appendAssemblyId>true</appendAssemblyId>
- </configuration>
- </execution>
- <execution>
- <id>installer-zip</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <attach>true</attach>
- <finalName>${application.name}-${project.version}-installer</finalName>
- <descriptors>
- <descriptor>src/assembly/assemble_installer_zip.xml</descriptor>
- </descriptors>
- <appendAssemblyId>false</appendAssemblyId>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <phase>prepare-package</phase>
- <configuration>
- <transitive>false</transitive>
- <outputDirectory>${project.build.directory}/assembly/system</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <useRepositoryLayout>true</useRepositoryLayout>
- <addParentPoms>false</addParentPoms>
- <copyPom>false</copyPom>
- <includeGroupIds>org.onap.ccsdk.sli.core</includeGroupIds>
- <excludeArtifactIds>sli-common,sli-provider,utils-provider,dblib-provider</excludeArtifactIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals><!-- here the phase you need -->
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/stage</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/scripts</directory>
- <includes>
- <include>install-feature.sh</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/filters/installer/src/assembly/assemble_installer_zip.xml b/filters/installer/src/assembly/assemble_installer_zip.xml
deleted file mode 100644
index 2ff550d2c..000000000
--- a/filters/installer/src/assembly/assemble_installer_zip.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-<!-- Defines how we build the .zip file which is our distribution. -->
-
-<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-
- <id>bin</id>
-
- <formats>
- <format>zip</format>
- </formats>
-
- <!-- we want "system" and related files right at the root level
- as this file is suppose to be unzip on top of a karaf
- distro. -->
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>target/stage/</directory>
- <outputDirectory>${application.name}</outputDirectory>
- <fileMode>755</fileMode>
- <includes>
- <include>*.sh</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target/stage/</directory>
- <outputDirectory>${application.name}</outputDirectory>
- <fileMode>644</fileMode>
- <excludes>
- <exclude>*.sh</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-
-
-
-</assembly>
diff --git a/filters/installer/src/assembly/assemble_mvnrepo_zip.xml b/filters/installer/src/assembly/assemble_mvnrepo_zip.xml
deleted file mode 100644
index 69e9e2909..000000000
--- a/filters/installer/src/assembly/assemble_mvnrepo_zip.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- ============LICENSE_START=======================================================
- ONAP : CCSDK
- ================================================================================
- 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=========================================================
- -->
-
-<!-- Defines how we build the .zip file which is our distribution. -->
-
-<assembly
- xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
- <id>repo</id>
- <formats>
- <format>zip</format>
- </formats>
-
- <!-- we want "system" and related files right at the root level
- as this file is suppose to be unzip on top of a karaf
- distro. -->
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <fileSets>
- <fileSet>
- <directory>target/assembly/</directory>
- <outputDirectory>.</outputDirectory>
- <excludes>
- </excludes>
- </fileSet>
- </fileSets>
-
-
-
-</assembly>
diff --git a/filters/installer/src/main/resources/scripts/install-feature.sh b/filters/installer/src/main/resources/scripts/install-feature.sh
deleted file mode 100644
index 74b95b5c8..000000000
--- a/filters/installer/src/main/resources/scripts/install-feature.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-###
-# ============LICENSE_START=======================================================
-# ONAP : CCSDK
-# ================================================================================
-# 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=========================================================
-###
-
-ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
-ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client}
-INSTALLERDIR=$(dirname $0)
-
-REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip
-
-if [ -f ${REPOZIP} ]
-then
- unzip -d ${ODL_HOME} ${REPOZIP}
-else
- echo "ERROR : repo zip ($REPOZIP) not found"
- exit 1
-fi
-
-${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories}
-${ODL_KARAF_CLIENT} feature:install ${features.boot}
diff --git a/filters/pom.xml b/filters/pom.xml
deleted file mode 100644
index 8db5d810b..000000000
--- a/filters/pom.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.ccsdk.parent</groupId>
- <artifactId>odlparent-lite</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters</artifactId>
- <version>1.1.1-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <name>ccsdk-sli-core :: filters</name>
- <description>Servlet filter to implement ONAP logging spec</description>
- <organization>
- <name>ONAP</name>
- </organization>
-
- <modules>
- <module>provider</module>
- <module>installer</module>
- </modules>
-</project>
diff --git a/filters/provider/pom.xml b/filters/provider/pom.xml
deleted file mode 100755
index ea7f9962e..000000000
--- a/filters/provider/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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.ccsdk.parent</groupId>
- <artifactId>binding-parent</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>filters-provider</artifactId>
- <version>1.1.1-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <name>ccsdk-sli-core :: filters :: ${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.onap.logging-analytics</groupId>
- <artifactId>logging-filter-base</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java
deleted file mode 100644
index 7805e365d..000000000
--- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.onap.ccsdk.sli.core.filters;
-
-import javax.servlet.http.HttpServletRequest;
-import org.onap.logging.filter.base.AuditLogServletFilter;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
-import org.slf4j.MDC;
-
-public class ControllerAuditLogFilter extends AuditLogServletFilter {
- private static final String MDC_HTTP_METHOD_KEY = "HttpMethod";
-
- @Override
- protected void additionalPreHandling(HttpServletRequest httpServletRequest) {
- // Don't overwrite service instance id if it was set outside of this automated method
- if (MDC.get(ONAPLogConstants.MDCs.SERVICE_INSTANCE_ID) == null) {
- String serviceInstanceId = getServiceInstanceId(httpServletRequest.getPathInfo());
- if (serviceInstanceId != null) {
- MDC.put(ONAPLogConstants.MDCs.SERVICE_INSTANCE_ID, serviceInstanceId);
- }
- }
- MDC.put(MDC_HTTP_METHOD_KEY, httpServletRequest.getMethod());
- }
-
- // restconf URLs follow a pattern, this method attempts to extract the service instance id according to that pattern
- protected String getServiceInstanceId(String path) {
- int idx = path.indexOf("service-list");
- if (idx != -1) {
- // chomp off service-list/
- String str = path.substring(idx + 13);
- idx = str.indexOf("/");
- //if there is another forward slash with more information chomp it off
- if (idx != -1) {
- return str.substring(0, idx);
- } else {
- return str;
- }
- }
- return null;
- }
-
-}
diff --git a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java b/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java
deleted file mode 100644
index 3f9f93fc5..000000000
--- a/filters/provider/src/main/java/org/onap/ccsdk/sli/core/filters/ControllerPayloadLoggingFilter.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.onap.ccsdk.sli.core.filters;
-
-import org.onap.logging.filter.base.PayloadLoggingServletFilter;
-
-public class ControllerPayloadLoggingFilter extends PayloadLoggingServletFilter {
-
-}
diff --git a/filters/provider/src/test/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilterTest.java b/filters/provider/src/test/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilterTest.java
deleted file mode 100644
index 9d0357a96..000000000
--- a/filters/provider/src/test/java/org/onap/ccsdk/sli/core/filters/ControllerAuditLogFilterTest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.onap.ccsdk.sli.core.filters;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
-public class ControllerAuditLogFilterTest {
-
- @Test
- public void getSimpleSiid() throws Exception {
- ControllerAuditLogFilter filter = new ControllerAuditLogFilter();
- String siid = filter.getServiceInstanceId("/restconf/config/Layer3API:services/service-list/100");
- assertEquals("100", siid);
- }
-
- @Test
- public void getSimpleComplexSiid() throws Exception {
- ControllerAuditLogFilter filter = new ControllerAuditLogFilter();
- String siid = filter.getServiceInstanceId(
- "/restconf/config/Layer3API:services/service-list/1337/service-data/oper-status");
- assertEquals("1337", siid);
- }
-
-}