From bc1d45117a4b7bf4a224ffe2dd16e532e4f123ee Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 31 Aug 2017 15:28:01 -0400 Subject: Add missing implementation code Due to an error in .gitignore, code that is initially generated from provider yang, but then customized was not submitted to gerrit. This in turn is causing the UnsupportedOperationException seen when sliapi installs in odlsli container. Change-Id: Iceec13b59e5e2bd6f0b868b548d300b76c7f7a38 Issue-ID: CCSDK-69 Signed-off-by: Dan Timoney --- .../impl/rev140523/SliapiProviderModule.java | 64 ++++++++++++++++++++++ .../rev140523/SliapiProviderModuleFactory.java | 34 ++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java create mode 100644 sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java (limited to 'sliapi') diff --git a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java new file mode 100644 index 00000000..e7444e31 --- /dev/null +++ b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModule.java @@ -0,0 +1,64 @@ +/*- + * ============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========================================================= + */ + +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523; + +import org.onap.ccsdk.sli.core.sliapi.sliapiProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SliapiProviderModule extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.AbstractSliapiProviderModule { + private final Logger LOG = LoggerFactory.getLogger( SliapiProviderModule.class ); + + public SliapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public SliapiProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.SliapiProviderModule oldModule, java.lang.AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public void customValidation() { + // add custom validation form module attributes here. + } + + @Override + public java.lang.AutoCloseable createInstance() { + + LOG.info("Calling SliapiProviderModule.createInstance"); + final sliapiProvider provider = new sliapiProvider(); + provider.setDataBroker( getDataBrokerDependency() ); + provider.setNotificationService( getNotificationServiceDependency() ); + provider.setRpcRegistry( getRpcRegistryDependency() ); + provider.initialize(); + return new AutoCloseable() { + + @Override + public void close() throws Exception { + //TODO: CLOSE ANY REGISTRATION OBJECTS CREATED USING ABOVE BROKER/NOTIFICATION + //SERVIE/RPC REGISTRY + provider.close(); + } + }; + } + +} diff --git a/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java new file mode 100644 index 00000000..6454d17c --- /dev/null +++ b/sliapi/provider/src/main/java/org/opendaylight/yang/gen/v1/org/onap/ccsdk/sli/core/sliapi/provider/impl/rev140523/SliapiProviderModuleFactory.java @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ + +/* +* Generated file +* +* Generated from: yang module name: sliapi-provider-impl yang module local name: sliapi-provider-impl +* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator +* Generated at: Thu Aug 03 16:10:18 EDT 2017 +* +* Do not modify this file unless it is present under src/main directory +*/ +package org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523; +public class SliapiProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.provider.impl.rev140523.AbstractSliapiProviderModuleFactory { + +} -- cgit 1.2.3-korg