Initial push of Neutron interface
[controller.git] / opendaylight / northbound / networkconfiguration / neutron / src / main / java / org / opendaylight / controller / networkconfig / neutron / northbound / NeutronSubnetRequest.java
1 /*\r
2  * Copyright IBM Corporation, 2013.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.controller.networkconfig.neutron.northbound;\r
10 \r
11 import java.util.List;\r
12 \r
13 import javax.xml.bind.annotation.XmlAccessType;\r
14 import javax.xml.bind.annotation.XmlAccessorType;\r
15 import javax.xml.bind.annotation.XmlElement;\r
16 import javax.xml.bind.annotation.XmlRootElement;\r
17 \r
18 import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet;\r
19 \r
20 @XmlRootElement\r
21 @XmlAccessorType(XmlAccessType.NONE)\r
22 \r
23 public class NeutronSubnetRequest {\r
24     // See OpenStack Network API v2.0 Reference for description of\r
25     // annotated attributes\r
26 \r
27     @XmlElement(name="subnet")\r
28     NeutronSubnet singletonSubnet;\r
29 \r
30     @XmlElement(name="subnets")\r
31     List<NeutronSubnet> bulkRequest;\r
32 \r
33     NeutronSubnetRequest() {\r
34     }\r
35 \r
36     NeutronSubnetRequest(List<NeutronSubnet> bulk) {\r
37         bulkRequest = bulk;\r
38         singletonSubnet = null;\r
39     }\r
40 \r
41     NeutronSubnetRequest(NeutronSubnet subnet) {\r
42         singletonSubnet = subnet;\r
43     }\r
44 \r
45     public NeutronSubnet getSingleton() {\r
46         return singletonSubnet;\r
47     }\r
48 \r
49     public List<NeutronSubnet> getBulk() {\r
50         return bulkRequest;\r
51     }\r
52 \r
53     public boolean isSingleton() {\r
54         return (singletonSubnet != null);\r
55     }\r
56 }\r