Bug 5526 - Prepared provider for new implemantation 76/36176/42
authorJakub Toth <jatoth@cisco.com>
Thu, 28 Apr 2016 06:40:16 +0000 (08:40 +0200)
committerJakub Toth <jatoth@cisco.com>
Thu, 5 May 2016 17:35:57 +0000 (17:35 +0000)
Change-Id: I8d89b01b39d32b9491c7c4293c20820720a47b5c
Signed-off-by: Jakub Toth <jatoth@cisco.com>
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/RestConnectorProvider.java [new file with mode: 0644]

diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/RestConnectorProvider.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/rest/RestConnectorProvider.java
new file mode 100644 (file)
index 0000000..7b2a3b6
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, 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
+ */
+package org.opendaylight.restconf.rest;
+
+import com.google.common.base.Preconditions;
+import java.util.Collection;
+import java.util.Collections;
+import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
+import org.opendaylight.controller.sal.core.api.Provider;
+import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.netconf.sal.rest.api.RestConnector;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+
+/**
+ * Provider for restconf draft11.
+ *
+ */
+public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable {
+
+    private ListenerRegistration<SchemaContextListener> listenerRegistration;
+
+    @Override
+    public void onSessionInitiated(final ProviderSession session) {
+        final SchemaService schemaService = Preconditions.checkNotNull(session.getService(SchemaService.class));
+    }
+
+    @Override
+    public Collection<ProviderFunctionality> getProviderFunctionality() {
+        return Collections.emptySet();
+    }
+
+    @Override
+    public void close() throws Exception {
+        if (this.listenerRegistration != null) {
+            this.listenerRegistration.close();
+        }
+    }
+}