Bug 5528 - Preparing enviroment for impl of restful services
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / handlers / SchemaContextHandler.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.handlers;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12
13 /**
14  * Implementation of {@link SchemaContextHandler}
15  *
16  */
17 public class SchemaContextHandler implements SchemaContextListenerHandler {
18
19     private SchemaContext context;
20
21     @Override
22     public void onGlobalContextUpdated(final SchemaContext context) {
23         Preconditions.checkNotNull(context);
24         this.context = null;
25         this.context = context;
26     }
27
28     @Override
29     public SchemaContext get() {
30         return this.context;
31     }
32 }