e3cb2e83f9912a4efd916819a374a919d9039855
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / NeutronFirewallRequest.java
1 /*
2  * Copyright (c) 2014, 2015 Red Hat, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.northbound.api;
10
11 import org.opendaylight.neutron.spi.NeutronFirewall;
12
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17 import java.util.List;
18
19
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22
23 public class NeutronFirewallRequest
24     implements INeutronRequest<NeutronFirewall> {
25     /**
26      * See OpenStack Network API v2.0 Reference for description of
27      * http://docs.openstack.org/api/openstack-network/2.0/content/
28      */
29
30     @XmlElement(name="firewall")
31     NeutronFirewall singletonFirewall;
32
33     @XmlElement(name="firewalls")
34     List<NeutronFirewall> bulkRequest;
35
36     NeutronFirewallRequest() {
37     }
38
39     NeutronFirewallRequest(List<NeutronFirewall> bulk) {
40         bulkRequest = bulk;
41         singletonFirewall = null;
42     }
43
44     NeutronFirewallRequest(NeutronFirewall group) {
45         singletonFirewall = group;
46     }
47
48     @Override
49     public List<NeutronFirewall> getBulk() {
50         return bulkRequest;
51     }
52
53     @Override
54     public NeutronFirewall getSingleton() {
55         return singletonFirewall;
56     }
57
58     @Override
59     public boolean isSingleton() {
60         return (singletonFirewall != null);
61     }
62 }