Initial push of Neutron interface
[controller.git] / opendaylight / northbound / networkconfiguration / neutron / src / main / java / org / opendaylight / controller / networkconfig / neutron / northbound / NeutronNetworkRequest.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.NeutronNetwork;\r
19 \r
20 @XmlRootElement\r
21 @XmlAccessorType(XmlAccessType.NONE)\r
22 public class NeutronNetworkRequest {\r
23     // See OpenStack Network API v2.0 Reference for description of\r
24     // annotated attributes\r
25 \r
26     @XmlElement(name="network")\r
27     NeutronNetwork singletonNetwork;\r
28 \r
29     @XmlElement(name="networks")\r
30     List<NeutronNetwork> bulkRequest;\r
31 \r
32     NeutronNetworkRequest() {\r
33     }\r
34 \r
35     NeutronNetworkRequest(List<NeutronNetwork> bulk) {\r
36         bulkRequest = bulk;\r
37         singletonNetwork = null;\r
38     }\r
39 \r
40     NeutronNetworkRequest(NeutronNetwork net) {\r
41         singletonNetwork = net;\r
42     }\r
43 \r
44     public NeutronNetwork getSingleton() {\r
45         return singletonNetwork;\r
46     }\r
47 \r
48     public boolean isSingleton() {\r
49         return (singletonNetwork != null);\r
50     }\r
51 \r
52     public List<NeutronNetwork> getBulk() {\r
53         return bulkRequest;\r
54     }\r
55 }\r