Merge "Update comment and remove unwanted FIXME in SchemaSetup"
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / RestConnectorProvider.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.rest;
9
10 import com.google.common.base.Preconditions;
11 import java.util.Collection;
12 import java.util.Collections;
13 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
14 import org.opendaylight.controller.sal.core.api.Provider;
15 import org.opendaylight.controller.sal.core.api.model.SchemaService;
16 import org.opendaylight.netconf.sal.rest.api.RestConnector;
17 import org.opendaylight.yangtools.concepts.ListenerRegistration;
18 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
19
20 /**
21  * Provider for restconf draft11.
22  *
23  */
24 public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable {
25
26     private ListenerRegistration<SchemaContextListener> listenerRegistration;
27
28     @Override
29     public void onSessionInitiated(final ProviderSession session) {
30         final SchemaService schemaService = Preconditions.checkNotNull(session.getService(SchemaService.class));
31     }
32
33     @Override
34     public Collection<ProviderFunctionality> getProviderFunctionality() {
35         return Collections.emptySet();
36     }
37
38     @Override
39     public void close() throws Exception {
40         if (this.listenerRegistration != null) {
41             this.listenerRegistration.close();
42         }
43     }
44 }