blob: 062fe776fd470a0e0bb74a050a2f207e0ff6c5a2 [file] [log] [blame]
sonu gupta1bb37b82016-11-11 16:51:18 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sonu gupta1bb37b82016-11-11 16:51:18 +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.yms.app.ydt;
18
19import org.onosproject.yms.ydt.YdtContext;
20import org.onosproject.yms.ydt.YdtResponse;
21import org.onosproject.yms.ydt.YmsOperationExecutionStatus;
22import org.onosproject.yms.ydt.YmsOperationType;
23
24public class YangResponseWorkBench implements YdtResponse {
25
26 /*
27 * YDT root node context.
28 */
29 private YdtContext rootNode;
30
31 /*
32 * YMS operation execution status.
33 */
34 private YmsOperationExecutionStatus status;
35
36 /*
37 * YMS operation type.
38 */
39 private YmsOperationType ymsOperationType;
40
41 /**
42 * Creates an instance of YangResponseWorkBench which is use to
43 * initialize rootNode and childNode.
44 *
45 * @param ydtContext root node context
46 * @param exeStatus YMS operation execution status
47 * @param opType YMS operation type
48 */
49 public YangResponseWorkBench(YdtContext ydtContext,
50 YmsOperationExecutionStatus exeStatus,
51 YmsOperationType opType) {
52 rootNode = ydtContext;
53 status = exeStatus;
54 ymsOperationType = opType;
55 }
56
57 @Override
58 public YmsOperationExecutionStatus getYmsOperationResult() {
59 return status;
60 }
61
62 @Override
63 public YdtContext getRootNode() {
64 return rootNode;
65 }
66
67 @Override
68 public YmsOperationType getYmsOperationType() {
69 return ymsOperationType;
70 }
71
72 /**
73 * Sets root node.
74 *
75 * @param rootNode root node
76 */
77 public void setRootNode(YdtContext rootNode) {
78 this.rootNode = rootNode;
79 }
80
81 /**
82 * Sets YMS operation execution status.
83 *
84 * @param status YMS operation execution status
85 */
86 public void setStatus(YmsOperationExecutionStatus status) {
87 this.status = status;
88 }
89
90 /**
91 * Sets YMS operation type.
92 *
93 * @param ymsOperationType YMS operation type
94 */
95 public void setYmsOperationType(YmsOperationType ymsOperationType) {
96 this.ymsOperationType = ymsOperationType;
97 }
98}