5e9cfb969fa3f408c6723a23659a96b47546c0da
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronFirewallPolicy.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.  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.spi;
10
11 import java.io.Serializable;
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 /**
18  * OpenStack Neutron v2.0 Firewall as a service
19  * (FWaaS) bindings. See OpenStack Network API
20  * v2.0 Reference for description of  the fields.
21  * The implemented fields are as follows:
22  *
23  * <p>
24  * id             uuid-str
25  * tenant_id      uuid-str
26  * name           String
27  * shared         Boolean
28  * audited        Boolean
29  * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
30  *
31  */
32
33 @XmlRootElement
34 @XmlAccessorType(XmlAccessType.NONE)
35 public final class NeutronFirewallPolicy extends NeutronBaseAttributes<NeutronFirewallPolicy> implements Serializable {
36     private static final long serialVersionUID = 1L;
37
38     @XmlElement(defaultValue = "false", name = "shared")
39     Boolean firewallPolicyIsShared;
40
41     @XmlElement(defaultValue = "false", name = "audited")
42     Boolean firewallPolicyIsAudited;
43
44     public Boolean getFirewallPolicyIsAudited() {
45         return firewallPolicyIsAudited;
46     }
47
48     public void setFirewallPolicyIsAudited(Boolean firewallPolicyIsAudited) {
49         this.firewallPolicyIsAudited = firewallPolicyIsAudited;
50     }
51
52     public Boolean getFirewallPolicyIsShared() {
53         return firewallPolicyIsShared;
54     }
55
56     public void setFirewallPolicyIsShared(Boolean firewallPolicyIsShared) {
57         this.firewallPolicyIsShared = firewallPolicyIsShared;
58     }
59
60     @Override
61     protected boolean extractField(String field, NeutronFirewallPolicy ans) {
62         switch (field) {
63             case "shared":
64                 ans.setFirewallPolicyIsShared(firewallPolicyIsShared);
65                 break;
66             case "audited":
67                 ans.setFirewallPolicyIsAudited(firewallPolicyIsAudited);
68                 break;
69             default:
70                 return super.extractField(field, ans);
71         }
72         return true;
73     }
74
75     @Override
76     public String toString() {
77         return "NeutronFirewallPolicy{" + "firewallPolicyUUID='" + uuid + '\'' + ", firewallPolicyTenantID='" + tenantID
78                 + '\'' + ", firewallPolicyName='" + name + '\'' + ", firewallPolicyIsShared="
79                 + firewallPolicyIsShared + ", firewallPolicyIsAudited='" + firewallPolicyIsAudited + '\'' + '}';
80     }
81 }