From 9d88d3f3f4791ea83f996032b64faed2a30735eb Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 18 Jan 2019 13:50:18 -0500 Subject: Add gRPC client scafholding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3775d0bfe2806f099952fe620b8b7705bf30fb7a Issue-ID: CCSDK-947 Signed-off-by: Alexis de Talhouët --- grpc-resource/features/ccsdk-grpc-client/pom.xml | 62 ++++++++ .../features/features-grpc-client/pom.xml | 49 +++++++ grpc-resource/features/pom.xml | 39 +++++ grpc-resource/installer/pom.xml | 159 +++++++++++++++++++++ .../src/assembly/assemble_installer_zip.xml | 53 +++++++ .../src/assembly/assemble_mvnrepo_zip.xml | 43 ++++++ .../src/main/resources/scripts/install-feature.sh | 34 +++++ grpc-resource/pom.xml | 41 ++++++ grpc-resource/provider/pom.xml | 113 +++++++++++++++ .../onap/ccsdk/sli/adaptors/grpc/GrpcClient.java | 29 ++++ .../org/opendaylight/blueprint/grpc-client.xml | 22 +++ .../ccsdk/sli/adaptors/grpc/GrpcClientTest.java | 20 +++ 12 files changed, 664 insertions(+) create mode 100644 grpc-resource/features/ccsdk-grpc-client/pom.xml create mode 100755 grpc-resource/features/features-grpc-client/pom.xml create mode 100755 grpc-resource/features/pom.xml create mode 100755 grpc-resource/installer/pom.xml create mode 100644 grpc-resource/installer/src/assembly/assemble_installer_zip.xml create mode 100644 grpc-resource/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 grpc-resource/installer/src/main/resources/scripts/install-feature.sh create mode 100644 grpc-resource/pom.xml create mode 100644 grpc-resource/provider/pom.xml create mode 100644 grpc-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClient.java create mode 100644 grpc-resource/provider/src/main/resources/org/opendaylight/blueprint/grpc-client.xml create mode 100644 grpc-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClientTest.java diff --git a/grpc-resource/features/ccsdk-grpc-client/pom.xml b/grpc-resource/features/ccsdk-grpc-client/pom.xml new file mode 100644 index 000000000..d24d1e238 --- /dev/null +++ b/grpc-resource/features/ccsdk-grpc-client/pom.xml @@ -0,0 +1,62 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + ccsdk-grpc-client + 0.4.1-SNAPSHOT + feature + + ccsdk-sli-adaptors :: grpc-client :: ${project.artifactId} + + + + ${project.version} + + + + + org.opendaylight.controller + odl-mdsal-broker + xml + features + + + + org.onap.ccsdk.sli.core + ccsdk-sli + ${ccsdk.sli.core.version} + xml + features + + + + ${project.groupId} + grpc-client-provider + ${project.version} + + + diff --git a/grpc-resource/features/features-grpc-client/pom.xml b/grpc-resource/features/features-grpc-client/pom.xml new file mode 100755 index 000000000..993fbe13b --- /dev/null +++ b/grpc-resource/features/features-grpc-client/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + feature-repo-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + features-grpc-client + 0.4.1-SNAPSHOT + feature + + ccsdk-sli-adaptors :: grpc-client :: ${project.artifactId} + + + ${project.version} + + + + + ${project.groupId} + ccsdk-grpc-client + ${project.version} + xml + features + + + + diff --git a/grpc-resource/features/pom.xml b/grpc-resource/features/pom.xml new file mode 100755 index 000000000..ededb8ee5 --- /dev/null +++ b/grpc-resource/features/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + grpc-client-features + 0.4.1-SNAPSHOT + pom + + ccsdk-sli-adaptors :: grpc-client :: ${project.artifactId} + + + ccsdk-grpc-client + features-grpc-client + + diff --git a/grpc-resource/installer/pom.xml b/grpc-resource/installer/pom.xml new file mode 100755 index 000000000..3bb4162c1 --- /dev/null +++ b/grpc-resource/installer/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + grpc-client-installer + 0.4.1-SNAPSHOT + pom + + ccsdk-sli-adaptors :: grpc-client :: ${project.artifactId} + + + ccsdk-grpc-client + ${application.name} + mvn:org.onap.ccsdk.sli.adaptors/${features.boot}/${project.version}/xml/features + + false + + + + + + org.onap.ccsdk.sli.adaptors + ccsdk-grpc-client + ${project.version} + xml + features + + + * + * + + + + + + org.onap.ccsdk.sli.adaptors + grpc-client-provider + ${project.version} + + + + + + + + maven-assembly-plugin + 2.6 + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + installer-zip + + single + + package + + true + ${application.name}-${project.version}-installer + + src/assembly/assemble_installer_zip.xml + + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + + copy-dependencies + + prepare-package + + false + ${project.build.directory}/assembly/system + false + true + true + true + false + false + org.onap.ccsdk.sli.adaptors + provided + + + + + + maven-resources-plugin + 2.6 + + + copy-version + + copy-resources + + validate + + ${basedir}/target/stage + + + src/main/resources/scripts + + install-feature.sh + + true + + + + + + + + + + + diff --git a/grpc-resource/installer/src/assembly/assemble_installer_zip.xml b/grpc-resource/installer/src/assembly/assemble_installer_zip.xml new file mode 100644 index 000000000..1a05df9c4 --- /dev/null +++ b/grpc-resource/installer/src/assembly/assemble_installer_zip.xml @@ -0,0 +1,53 @@ + + + + + + installer_zip + + zip + + + + false + + + + target/stage/ + ${application.name} + 755 + + *.sh + + + + target/stage/ + ${application.name} + 644 + + *.sh + + + + + + diff --git a/grpc-resource/installer/src/assembly/assemble_mvnrepo_zip.xml b/grpc-resource/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..ae6765f4e --- /dev/null +++ b/grpc-resource/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,43 @@ + + + + + + repo + + zip + + + + false + + + + target/assembly/ + . + + + + + + + diff --git a/grpc-resource/installer/src/main/resources/scripts/install-feature.sh b/grpc-resource/installer/src/main/resources/scripts/install-feature.sh new file mode 100644 index 000000000..7e022e840 --- /dev/null +++ b/grpc-resource/installer/src/main/resources/scripts/install-feature.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# +# Copyright (C) 2019 Bell Canada +# +# 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. +# + +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 -nd ${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/grpc-resource/pom.xml b/grpc-resource/pom.xml new file mode 100644 index 000000000..7b80f9b3a --- /dev/null +++ b/grpc-resource/pom.xml @@ -0,0 +1,41 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + grpc-client + 0.4.1-SNAPSHOT + pom + + ccsdk-sli-adaptors :: grpc-client + The CCSDK Adaptors for gRPC as an OSGi service + + + provider + features + installer + + diff --git a/grpc-resource/provider/pom.xml b/grpc-resource/provider/pom.xml new file mode 100644 index 000000000..20f83c1e4 --- /dev/null +++ b/grpc-resource/provider/pom.xml @@ -0,0 +1,113 @@ + + + + + + org.onap.ccsdk.parent + binding-parent + 1.2.1-SNAPSHOT + + + + org.onap.ccsdk.sli.adaptors + grpc-client-provider + 0.4.1-SNAPSHOT + bundle + 4.0.0 + + ccsdk-sli-adaptors :: grpc-client :: ${project.artifactId} + + + ${project.version} + 1.16.1 + + + + + + org.onap.ccsdk.sli.core + sli-core-artifacts + ${ccsdk.sli.core.version} + pom + import + + + + + + + org.onap.ccsdk.sli.core + sliPluginUtils-provider + compile + + + + + io.grpc + grpc-core + ${grpc.version} + + + io.grpc + grpc-netty + ${grpc.version} + + + io.grpc + grpc-protobuf + ${grpc.version} + + + io.grpc + grpc-stub + ${grpc.version} + + + + + junit + junit + ${junit.version} + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + + org.onap.ccsdk.sli.adaptors.grpc + + + + + + + + diff --git a/grpc-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClient.java b/grpc-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClient.java new file mode 100644 index 000000000..c70bcec46 --- /dev/null +++ b/grpc-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClient.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.ccsdk.sli.adaptors.grpc; + +public class GrpcClient { + +// ManagedChannel channel = ManagedChannelBuilder +// .forAddress("localhost", 8080) +// .executor(Executors.newSingleThreadExecutor()) +// .intercept() +// .userAgent("CCSDK gRPC Client") +// .usePlaintext() +// //.useTransportSecurity() +// .build(); + +} diff --git a/grpc-resource/provider/src/main/resources/org/opendaylight/blueprint/grpc-client.xml b/grpc-resource/provider/src/main/resources/org/opendaylight/blueprint/grpc-client.xml new file mode 100644 index 000000000..5e9d5c809 --- /dev/null +++ b/grpc-resource/provider/src/main/resources/org/opendaylight/blueprint/grpc-client.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/grpc-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClientTest.java b/grpc-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClientTest.java new file mode 100644 index 000000000..f56736a56 --- /dev/null +++ b/grpc-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/grpc/GrpcClientTest.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.ccsdk.sli.adaptors.grpc; + +public class GrpcClientTest { + +} \ No newline at end of file -- cgit 1.2.3-korg