[DMAAP-BC] Consolidate bus controller repos
[dmaap/buscontroller.git] / dmaap-bc / src / main / java / org / onap / dmaap / dbcapi / model / DcaeLocation.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.dmaap
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.dmaap.dbcapi.model;
22
23 import javax.xml.bind.annotation.XmlRootElement;
24
25 import java.util.Objects;
26
27 @XmlRootElement
28 public class DcaeLocation extends DmaapObject {
29         private String clli;
30         private String dcaeLayer;
31         private String dcaeLocationName;
32         private String openStackAvailabilityZone;
33         private String subnet;
34
35         
36
37         public DcaeLocation() {
38
39         }
40
41         public DcaeLocation( String c,
42                                                 String dL,
43                                                 String dLN,
44                                                 String oSAZ,
45                                                 String s ) {
46                 
47                 this.clli = c;
48                 this.dcaeLayer = dL;
49                 this.dcaeLocationName = dLN;
50                 this.openStackAvailabilityZone = oSAZ;
51                 this.subnet = s;
52         }
53
54         public String getClli() {
55                 return clli;
56         }
57
58         public void setClli(String clli) {
59                 this.clli = clli;
60         }
61
62         public String getDcaeLayer() {
63                 return dcaeLayer;
64         }
65
66         public void setDcaeLayer(String dcaeLayer) {
67                 this.dcaeLayer = dcaeLayer;
68         }
69         public boolean isCentral() {
70                 return dcaeLayer != null && dcaeLayer.contains("central");
71         }
72         public boolean isLocal() {
73                 return dcaeLayer != null && dcaeLayer.contains("local");
74         }
75
76         public String getDcaeLocationName() {
77                 return dcaeLocationName;
78         }
79
80         public void setDcaeLocationName(String dcaeLocationName) {
81                 this.dcaeLocationName = dcaeLocationName;
82         }
83         
84
85
86         public String getOpenStackAvailabilityZone() {
87                 return openStackAvailabilityZone;
88         }
89
90         public void setOpenStackAvailabilityZone(String openStackAvailabilityZone) {
91                 this.openStackAvailabilityZone = openStackAvailabilityZone;
92         }
93         
94         public String getSubnet() {
95                 return subnet;
96         }
97
98         public void setSubnet(String subnet) {
99                 this.subnet = subnet;
100         }
101
102         @Override
103         public boolean equals(Object o) {
104                 if (this == o) return true;
105                 if (o == null || getClass() != o.getClass()) return false;
106                 DcaeLocation that = (DcaeLocation) o;
107                 return Objects.equals(clli, that.clli) &&
108                                 Objects.equals(dcaeLayer, that.dcaeLayer) &&
109                                 Objects.equals(dcaeLocationName, that.dcaeLocationName) &&
110                                 Objects.equals(openStackAvailabilityZone, that.openStackAvailabilityZone) &&
111                                 Objects.equals(subnet, that.subnet);
112         }
113
114         @Override
115         public int hashCode() {
116
117                 return Objects.hash(clli, dcaeLayer, dcaeLocationName, openStackAvailabilityZone, subnet);
118         }
119 }