Neutron API v2.0 bindings and APIs for security groups/rules.
[controller.git] / opendaylight / northbound / networkconfiguration / neutron / src / main / java / org / opendaylight / controller / networkconfig / neutron / northbound / NeutronSecurityGroupRequest.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.
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
10 package org.opendaylight.controller.networkconfig.neutron.northbound;
11
12 import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityGroup;
13
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
18 import java.util.List;
19
20
21 @XmlRootElement
22 @XmlAccessorType (XmlAccessType.NONE)
23
24 public class NeutronSecurityGroupRequest {
25     /**
26     * See OpenStack Network API v2.0 Reference for a
27     * description of annotated attributes and operations
28     */
29
30     @XmlElement (name = "security_group")
31     NeutronSecurityGroup singletonSecurityGroup;
32
33     @XmlElement (name = "security_groups")
34     List<NeutronSecurityGroup> bulkRequest;
35
36     NeutronSecurityGroupRequest() {
37     }
38
39     NeutronSecurityGroupRequest(List<NeutronSecurityGroup> bulk) {
40         bulkRequest = bulk;
41         singletonSecurityGroup = null;
42     }
43
44     NeutronSecurityGroupRequest(NeutronSecurityGroup group) {
45         singletonSecurityGroup = group;
46     }
47
48     public List<NeutronSecurityGroup> getBulk() {
49         return bulkRequest;
50     }
51
52     public NeutronSecurityGroup getSingleton() {
53         return singletonSecurityGroup;
54     }
55
56     public boolean isSingleton() {
57         return (singletonSecurityGroup != null);
58     }
59 }