Gaurav Agrawal | 9ac2d55 | 2017-07-14 10:32:34 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 72b2df2 | 2017-08-03 18:48:28 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Gaurav Agrawal | 9ac2d55 | 2017-07-14 10:32:34 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.yang.model; |
| 18 | |
| 19 | /** |
| 20 | * Representation of rpc context which is JAVA coordinates to the RPC. |
| 21 | */ |
| 22 | public class RpcContext { |
| 23 | |
| 24 | private final String rpcName; |
| 25 | |
| 26 | private final Class<? extends RpcService> serviceIntf; |
| 27 | |
| 28 | /** |
| 29 | * Creates an instance of rpc context. |
| 30 | * |
| 31 | * @param name name of rpc |
| 32 | * @param intf service interface class |
| 33 | */ |
| 34 | public RpcContext(String name, Class<? extends RpcService> intf) { |
| 35 | rpcName = name; |
| 36 | serviceIntf = intf; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns JAVA name of the RPC. |
| 41 | * |
| 42 | * @return rpc JAVA name |
| 43 | */ |
| 44 | public String rpcName() { |
| 45 | return rpcName; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns class corresponding to service interface. |
| 50 | * |
| 51 | * @return service interface class |
| 52 | */ |
| 53 | public Class<? extends RpcService> serviceIntf() { |
| 54 | return serviceIntf; |
| 55 | } |
| 56 | } |