Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | * use this file except in compliance with the License. You may obtain a copy |
| 6 | * 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, WITHOUT |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | * License for the specific language governing permissions and limitations under |
| 14 | * the License. |
| 15 | */ |
| 16 | // CHECKSTYLE:OFF |
| 17 | |
| 18 | package org.onosproject.netconf.rpc; |
| 19 | |
| 20 | import java.util.ArrayList; |
| 21 | import java.util.HashMap; |
| 22 | import java.util.List; |
| 23 | import java.util.Map; |
| 24 | import javax.xml.bind.annotation.XmlAccessType; |
| 25 | import javax.xml.bind.annotation.XmlAccessorType; |
| 26 | import javax.xml.bind.annotation.XmlAnyAttribute; |
| 27 | import javax.xml.bind.annotation.XmlAttribute; |
| 28 | import javax.xml.bind.annotation.XmlElement; |
| 29 | import javax.xml.bind.annotation.XmlType; |
| 30 | import javax.xml.namespace.QName; |
| 31 | |
| 32 | |
| 33 | /** |
| 34 | * <p>Java class for rpcReplyType complex type. |
| 35 | * |
| 36 | * <p>The following schema fragment specifies the expected content contained within this class. |
| 37 | * |
| 38 | * <pre> |
| 39 | * <complexType name="rpcReplyType"> |
| 40 | * <complexContent> |
| 41 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
| 42 | * <choice> |
| 43 | * <element name="ok" type="{http://www.w3.org/2001/XMLSchema}anyType"/> |
| 44 | * <sequence> |
| 45 | * <element ref="{urn:ietf:params:xml:ns:netconf:base:1.0}rpc-error" maxOccurs="unbounded" minOccurs="0"/> |
| 46 | * <element ref="{urn:ietf:params:xml:ns:netconf:base:1.0}rpcResponse" maxOccurs="unbounded" minOccurs="0"/> |
| 47 | * </sequence> |
| 48 | * </choice> |
| 49 | * <attribute name="message-id" type="{urn:ietf:params:xml:ns:netconf:base:1.0}messageIdType" /> |
| 50 | * <anyAttribute processContents='lax'/> |
| 51 | * </restriction> |
| 52 | * </complexContent> |
| 53 | * </complexType> |
| 54 | * </pre> |
| 55 | * |
| 56 | * |
| 57 | */ |
| 58 | @XmlAccessorType(XmlAccessType.FIELD) |
| 59 | @XmlType(name = "rpcReplyType", propOrder = { |
| 60 | "ok", |
| 61 | "rpcError", |
| 62 | "rpcResponse" |
| 63 | }) |
| 64 | public class RpcReplyType { |
| 65 | |
| 66 | protected Object ok; |
| 67 | @XmlElement(name = "rpc-error") |
| 68 | protected List<RpcErrorType> rpcError; |
| 69 | protected List<RpcResponseType> rpcResponse; |
| 70 | @XmlAttribute(name = "message-id") |
| 71 | protected String messageId; |
| 72 | @XmlAnyAttribute |
| 73 | private Map<QName, String> otherAttributes = new HashMap<QName, String>(); |
| 74 | |
| 75 | /** |
| 76 | * Gets the value of the ok property. |
| 77 | * |
| 78 | * @return |
| 79 | * possible object is |
| 80 | * {@link Object } |
| 81 | * |
| 82 | */ |
| 83 | public Object getOk() { |
| 84 | return ok; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Sets the value of the ok property. |
| 89 | * |
| 90 | * @param value |
| 91 | * allowed object is |
| 92 | * {@link Object } |
| 93 | * |
| 94 | */ |
| 95 | public void setOk(Object value) { |
| 96 | this.ok = value; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Gets the value of the rpcError property. |
| 101 | * |
| 102 | * <p> |
| 103 | * This accessor method returns a reference to the live list, |
| 104 | * not a snapshot. Therefore any modification you make to the |
| 105 | * returned list will be present inside the JAXB object. |
| 106 | * This is why there is not a <CODE>set</CODE> method for the rpcError property. |
| 107 | * |
| 108 | * <p> |
| 109 | * For example, to add a new item, do as follows: |
| 110 | * <pre> |
| 111 | * getRpcError().add(newItem); |
| 112 | * </pre> |
| 113 | * |
| 114 | * |
| 115 | * <p> |
| 116 | * Objects of the following type(s) are allowed in the list |
| 117 | * {@link RpcErrorType } |
| 118 | * |
Thomas Vachuska | a01ef78 | 2018-07-25 14:07:11 -0700 | [diff] [blame^] | 119 | * @return list of rpc error types |
Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 120 | */ |
| 121 | public List<RpcErrorType> getRpcError() { |
| 122 | if (rpcError == null) { |
| 123 | rpcError = new ArrayList<RpcErrorType>(); |
| 124 | } |
| 125 | return this.rpcError; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Gets the value of the rpcResponse property. |
| 130 | * |
| 131 | * <p> |
| 132 | * This accessor method returns a reference to the live list, |
| 133 | * not a snapshot. Therefore any modification you make to the |
| 134 | * returned list will be present inside the JAXB object. |
| 135 | * This is why there is not a <CODE>set</CODE> method for the rpcResponse property. |
| 136 | * |
| 137 | * <p> |
| 138 | * For example, to add a new item, do as follows: |
| 139 | * <pre> |
| 140 | * getRpcResponse().add(newItem); |
| 141 | * </pre> |
| 142 | * |
| 143 | * |
| 144 | * <p> |
| 145 | * Objects of the following type(s) are allowed in the list |
| 146 | * {@link RpcResponseType } |
| 147 | * |
Thomas Vachuska | a01ef78 | 2018-07-25 14:07:11 -0700 | [diff] [blame^] | 148 | * @return list of rpc response types |
Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 149 | */ |
| 150 | public List<RpcResponseType> getRpcResponse() { |
| 151 | if (rpcResponse == null) { |
| 152 | rpcResponse = new ArrayList<RpcResponseType>(); |
| 153 | } |
| 154 | return this.rpcResponse; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Gets the value of the messageId property. |
| 159 | * |
| 160 | * @return |
| 161 | * possible object is |
| 162 | * {@link String } |
| 163 | * |
| 164 | */ |
| 165 | public String getMessageId() { |
| 166 | return messageId; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Sets the value of the messageId property. |
| 171 | * |
| 172 | * @param value |
| 173 | * allowed object is |
| 174 | * {@link String } |
| 175 | * |
| 176 | */ |
| 177 | public void setMessageId(String value) { |
| 178 | this.messageId = value; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Gets a map that contains attributes that aren't bound to any typed property on this class. |
| 183 | * |
| 184 | * <p> |
| 185 | * the map is keyed by the name of the attribute and |
| 186 | * the value is the string value of the attribute. |
| 187 | * |
| 188 | * the map returned by this method is live, and you can add new attribute |
| 189 | * by updating the map directly. Because of this design, there's no setter. |
| 190 | * |
| 191 | * |
| 192 | * @return |
| 193 | * always non-null |
| 194 | */ |
| 195 | public Map<QName, String> getOtherAttributes() { |
| 196 | return otherAttributes; |
| 197 | } |
| 198 | |
| 199 | } |