blob: ee486505feb81e679e4f19be41fd80f16bdaa714 [file] [log] [blame]
Gaurav Agrawal9ac2d552017-07-14 10:32:34 +05301/*
Brian O'Connor72b2df22017-08-03 18:48:28 -07002 * Copyright 2017-present Open Networking Foundation
Gaurav Agrawal9ac2d552017-07-14 10:32:34 +05303 *
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
17package org.onosproject.yang.model;
18
19/**
20 * Representation of rpc context which is JAVA coordinates to the RPC.
21 */
22public 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}