blob: 9d39503bb5d73179e29e25f03e0e59786ac07e5b [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM Core
4 * ================================================================================
5 * Copyright (C) 2018 Netsia
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
22
23package org.onap.osam.model.dao;
24
25import lombok.Getter;
26import lombok.Setter;
27
28import javax.persistence.*;
29import java.util.Set;
30
31/**
32 * Created by Zafer Kaban on 18.09.2018.
33 */
34@Entity
35@Getter
36@Setter
37public class OLTSlot extends BaseEntity {
38
39 private String serialNumber;
40 @Enumerated(value = EnumType.STRING)
41 private ActivityState operationalState;
42 @Enumerated(value = EnumType.STRING)
43 private ActivityState portAuthState;
44 @Enumerated(value = EnumType.STRING)
45 private AdminState adminState;
46 private String ipAddress;
47 private String hostname;
48 private String macAddress;
49 private Integer port;
50 private Integer number;
51 @Enumerated(value = EnumType.STRING)
52 private OltDriver oltDriver;
53 @Enumerated(value = EnumType.STRING)
54 private OltType oltType;
55 private String name;
56 @ManyToOne
57 @JoinColumn(name="chassis_id", nullable=false)
58 private Chassis chassis;
59 @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "oltSlot")
60 private Set<OLTPort> oltPorts;
61
62 @Override
63 public String toString() {
64 final StringBuilder sb = new StringBuilder("oltSlot{");
65 sb.append("serialNumber=").append(serialNumber);
66 sb.append(", operationalState='").append(operationalState).append('\'');
67 sb.append(", portAuthState='").append(portAuthState).append('\'');
68 sb.append(", adminState='").append(adminState).append('\'');
69 sb.append(", ipAddress=").append(ipAddress);
70 sb.append(", hostname=").append(hostname);
71 sb.append(", macAddress=").append(macAddress);
72 sb.append(", port=").append(port);
73 sb.append(", number=").append(number);
74 sb.append(", name=").append(name);
75 sb.append(", oltDriver=").append(oltDriver);
76 sb.append(", oltType=").append(oltType);
77 sb.append('}');
78 return sb.toString();
79 }
80}