return true;
}
+ /**
+ * Invoke by blueprint
+ */
@Override
- public void close() throws Exception {
+ public void close() {
listenerTracker.close();
nullableCredService = null;
}
package org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715;
import com.google.common.base.Preconditions;
-import org.opendaylight.aaa.odl.CredentialServiceAuthProvider;
+import com.google.common.reflect.AbstractInvocationHandler;
+import com.google.common.reflect.Reflection;
+import java.lang.reflect.Method;
import org.opendaylight.controller.config.api.DependencyResolver;
import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
+import org.opendaylight.netconf.auth.AuthProvider;
import org.osgi.framework.BundleContext;
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
public class AuthProviderModule extends org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715.AbstractAuthProviderModule {
private BundleContext bundleContext;
}
@Override
- public AutoCloseable createInstance() {
- return new CredentialServiceAuthProvider(bundleContext);
+ public java.lang.AutoCloseable createInstance() {
+ final WaitingServiceTracker<AuthProvider> tracker =
+ WaitingServiceTracker.create(AuthProvider.class, bundleContext, "(type=netconf-auth-provider)");
+ final AuthProvider service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
+
+ return Reflection.newProxy(AutoCloseableAuthProvider.class, new AbstractInvocationHandler() {
+ @Override
+ protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
+ if (method.getName().equals("close")) {
+ tracker.close();
+ return null;
+ } else {
+ return method.invoke(service, args);
+ }
+ }
+ });
}
+ private static interface AutoCloseableAuthProvider extends AuthProvider, AutoCloseable {
+ }
}
import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.osgi.framework.BundleContext;
+/**
+ * @deprecated Replaced by blueprint wiring
+ */
+@Deprecated
public class AuthProviderModuleFactory extends org.opendaylight.yang.gen.v1.config.aaa.authn.netconf.plugin.rev150715.AbstractAuthProviderModuleFactory {
private static final ModuleIdentifier DEFAULT_INSTANCE_ID = new ModuleIdentifier(NAME, "default-auth-provider");
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies Inc. and others. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
+
+ <bean id="credentialServiceAuthProvider"
+ class="org.opendaylight.aaa.odl.CredentialServiceAuthProvider"
+ destroy-method="close">
+ <argument ref="blueprintBundleContext"/>
+ </bean>
+ <service ref="credentialServiceAuthProvider" interface="org.opendaylight.netconf.auth.AuthProvider"
+ odl:type="netconf-auth-provider"/>
+
+</blueprint>
\ No newline at end of file
base config:module-type;
config:java-name-prefix AuthProvider;
config:provided-service na:netconf-auth-provider;
+ status deprecated;
}
augment "/config:modules/config:module/config:configuration" {
+ status deprecated;
case aaa-authn-netconf-plugin {
when "/config:modules/config:module/config:type = 'aaa-authn-netconf-plugin'";
// no config yet
identity netconf-auth-provider {
base "config:service-type";
config:java-class "org.opendaylight.netconf.auth.AuthProvider";
+ config:disable-osgi-service-registration;
+ status deprecated;
}
}
\ No newline at end of file
<capability>urn:ietf:params:xml:ns:yang:ietf-network-topology?module=ietf-network-topology&revision=2015-06-08</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&revision=2012-02-06</capability>
<capability>urn:TBD:params:xml:ns:yang:ospf-topology?module=ospf-topology&revision=2013-10-21</capability>
- <capability>config:aaa:authn:netconf:plugin?module=aaa-authn-netconf-plugin&revision=2015-07-15</capability>
<capability>urn:opendaylight:params:xml:ns:yang:controller:config:netconf:auth?module=netconf-auth&revision=2015-07-15</capability>
<capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:operational-dom-store?module=opendaylight-operational-dom-datastore&revision=2014-06-17</capability>
<capability>urn:ietf:params:xml:ns:yang:ospf-topology?module=ospf-topology&revision=2013-07-12</capability>