Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / restconf / restconf-client-impl / src / main / java / org / opendaylight / yangtools / restconf / client / to / RestRpcServiceContext.java
1 /*
2  * Copyright (c) 2013 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.yangtools.restconf.client.to;
9
10 import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
11 import org.opendaylight.yangtools.restconf.client.BindingToRestRpc;
12 import org.opendaylight.yangtools.restconf.client.RestconfClientImpl;
13 import org.opendaylight.yangtools.restconf.client.api.rpc.RpcServiceContext;
14 import org.opendaylight.yangtools.yang.binding.RpcService;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18
19 public class RestRpcServiceContext <T extends RpcService> implements RpcServiceContext<T> {
20
21     private static final Logger logger = LoggerFactory.getLogger(RestRpcServiceContext.class);
22     private T rpcServiceProxy;
23
24     public RestRpcServiceContext(Class<T> rpcService,BindingNormalizedNodeCodecRegistry mappingService, RestconfClientImpl
25             restconfClient,SchemaContext schemaContext){
26         this.rpcServiceProxy = BindingToRestRpc.getProxy(rpcService,mappingService,restconfClient,schemaContext);
27     }
28
29     @Override
30     public T getRpcService() {
31         return this.rpcServiceProxy;
32     }
33
34     @Override
35     public void close() {
36
37     }
38 }