OSAM infra seed code - merge with osam-core side-by-side - fixed warnings in onap-enabler POMs

Change-Id: I0cd9ea39d4b7c1dc088ab0ecd6fb787c7f490e5e
Signed-off-by: Aharoni, Pavel (pa0916) <pavel.aharoni@intl.att.com>
diff --git a/osam-core/model/pom.xml b/osam-core/model/pom.xml
new file mode 100644
index 0000000..93c706f
--- /dev/null
+++ b/osam-core/model/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!--/*-

+        * ============LICENSE_START=======================================================

+        * OSAM Core

+        * ================================================================================

+        * Copyright (C) 2018 Netsia

+        * ================================================================================

+        * Licensed under the Apache License, Version 2.0 (the "License");

+        * you may not use this file except in compliance with the License.

+        * You may obtain a copy of the License at

+        *

+        *      http://www.apache.org/licenses/LICENSE-2.0

+        *

+        * Unless required by applicable law or agreed to in writing, software

+        * distributed under the License is distributed on an "AS IS" BASIS,

+        * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+        * See the License for the specific language governing permissions and

+        * limitations under the License.

+        * ============LICENSE_END=========================================================

+        */-->

+

+<project xmlns="http://maven.apache.org/POM/4.0.0"

+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

+    <parent>

+        <artifactId>osam-core</artifactId>

+        <groupId>org.onap.osam</groupId>

+        <version>0.0.1-SNAPSHOT</version>

+    </parent>

+    <modelVersion>4.0.0</modelVersion>

+    <artifactId>model</artifactId>

+

+    <dependencies>

+        <dependency>

+            <groupId>org.springframework.boot</groupId>

+            <artifactId>spring-boot-starter-data-jpa</artifactId>

+        </dependency>

+        <dependency>

+            <groupId>org.mariadb.jdbc</groupId>

+            <artifactId>mariadb-java-client</artifactId>

+        </dependency>

+    </dependencies>

+

+</project>
\ No newline at end of file
diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/AccessPod.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/AccessPod.java
new file mode 100644
index 0000000..879e937
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/AccessPod.java
@@ -0,0 +1,66 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.Column;

+import javax.persistence.Entity;

+

+/**

+ * Created by cemturker on 26.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class AccessPod extends BaseEntity {

+

+    @Column(unique = true)

+    private String pnfId;

+    @Column(nullable = false)

+    private String coreIp;

+    @Column(nullable = false)

+    private String corePort;

+    @Column(nullable = false)

+    private String ip;

+    @Column(nullable = false)

+    private String port;

+    private String username;

+    private String password;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("AccessPod{");

+        sb.append("pnfId='").append(pnfId).append('\'');

+        sb.append(", coreIp='").append(coreIp).append('\'');

+        sb.append(", corePort='").append(corePort).append('\'');

+        sb.append(", id=").append(id);

+        sb.append(", ip='").append(ip).append('\'');

+        sb.append(", port='").append(port).append('\'');

+        sb.append(", username='").append(username).append('\'');

+        sb.append(", password='").append(password).append('\'');

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/ActiveAlarmsAndEvents.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/ActiveAlarmsAndEvents.java
new file mode 100644
index 0000000..d875d08
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/ActiveAlarmsAndEvents.java
@@ -0,0 +1,43 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+

+import lombok.Data;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.Entity;

+import javax.persistence.Table;

+

+@Table(name = "active_alarm_and_events")

+@Entity

+@NoArgsConstructor

+public class ActiveAlarmsAndEvents extends AlarmsAndEvents {

+

+    public ActiveAlarmsAndEvents(AlarmsAndEvents alarmsAndEvents){

+        super.setAlarmName(alarmsAndEvents.getAlarmName());

+        super.setDate(alarmsAndEvents.getDate());

+        super.setId(alarmsAndEvents.getId());

+        super.setAlarmStatus(alarmsAndEvents.getAlarmStatus());

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/ActivityState.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/ActivityState.java
new file mode 100644
index 0000000..436f5ac
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/ActivityState.java
@@ -0,0 +1,30 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public enum ActivityState {

+    ACTIVE, INACTIVE

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/AdminState.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/AdminState.java
new file mode 100644
index 0000000..bf92071
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/AdminState.java
@@ -0,0 +1,30 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public enum AdminState {

+    ENABLED, DISABLED,PREPROVISION

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmStatus.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmStatus.java
new file mode 100644
index 0000000..1c6f9b0
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmStatus.java
@@ -0,0 +1,34 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.NoArgsConstructor;

+

+@AllArgsConstructor

+@NoArgsConstructor

+public enum AlarmStatus {

+    ACTIVE("active"),

+    DEACTIVE("deactive");

+    String type;

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmsAndEvents.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmsAndEvents.java
new file mode 100644
index 0000000..76e0f32
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/AlarmsAndEvents.java
@@ -0,0 +1,51 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.Data;

+import lombok.EqualsAndHashCode;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.EnumType;

+import javax.persistence.Enumerated;

+import javax.persistence.MappedSuperclass;

+import javax.persistence.Temporal;

+import javax.persistence.TemporalType;

+import java.util.Date;

+

+@Data

+@AllArgsConstructor

+@NoArgsConstructor

+@EqualsAndHashCode(callSuper = false)

+@MappedSuperclass

+public class AlarmsAndEvents extends BaseEntity {

+

+    @Enumerated(value = EnumType.STRING)

+    AlarmStatus alarmStatus;

+

+    String alarmName;

+

+    @Temporal(TemporalType.TIME)

+    Date date;

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/BaseEntity.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/BaseEntity.java
new file mode 100644
index 0000000..67e7fe3
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/BaseEntity.java
@@ -0,0 +1,69 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.Data;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.GeneratedValue;

+import javax.persistence.GenerationType;

+import javax.persistence.Id;

+import javax.persistence.MappedSuperclass;

+import java.io.Serializable;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+@MappedSuperclass

+@Data

+@NoArgsConstructor

+@AllArgsConstructor

+public class BaseEntity implements Serializable {

+    @Id

+    @GeneratedValue(strategy = GenerationType.IDENTITY)

+    protected Long id;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("BaseEntity{");

+        sb.append("id=").append(id);

+        sb.append('}');

+        return sb.toString();

+    }

+

+    @Override

+    public boolean equals(Object o) {

+        if (this == o) return true;

+        if (o == null || getClass() != o.getClass()) return false;

+

+        BaseEntity that = (BaseEntity) o;

+

+        return id.equals(that.id);

+    }

+

+    @Override

+    public int hashCode() {

+        return id.hashCode();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/Chassis.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/Chassis.java
new file mode 100644
index 0000000..0a17b3a
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/Chassis.java
@@ -0,0 +1,61 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.*;

+import java.util.Set;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class Chassis extends BaseEntity {

+

+    @Column(unique = true)

+    private String clli;

+    private int rack;

+    private int shelf;

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState state;

+    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "chassis")

+    private Set<OLTSlot> oltSlots;

+    @ManyToOne

+    @JoinColumn(name="accessPod_pnfId", nullable=false)

+    private AccessPod accessPod;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("Chassis{");

+        sb.append("clli=").append(clli);

+        sb.append(", state='").append(state).append('\'');

+        sb.append(", rack='").append(rack).append('\'');

+        sb.append(", shelf='").append(shelf).append('\'');

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/HistoricalAlarmsAndEvents.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/HistoricalAlarmsAndEvents.java
new file mode 100644
index 0000000..c3b7b2d
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/HistoricalAlarmsAndEvents.java
@@ -0,0 +1,38 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+

+import javax.persistence.Entity;

+import javax.persistence.Table;

+

+@Table(name = "historical_alarms_and_events")

+@Entity

+public class HistoricalAlarmsAndEvents extends AlarmsAndEvents {

+    public HistoricalAlarmsAndEvents(AlarmsAndEvents alarmsAndEvents){

+        super.setAlarmName(alarmsAndEvents.getAlarmName());

+        super.setDate(alarmsAndEvents.getDate());

+        super.setId(alarmsAndEvents.getId());

+        super.setAlarmStatus(alarmsAndEvents.getAlarmStatus());

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTPort.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTPort.java
new file mode 100644
index 0000000..4783c9d
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTPort.java
@@ -0,0 +1,60 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.*;

+import java.util.Set;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class OLTPort extends BaseEntity {

+

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState portAuthState;

+    @Enumerated(value = EnumType.STRING)

+    private AdminState adminState;

+    private Integer portNumber;

+    @ManyToOne

+    @JoinColumn(name="OLTSlot_id", nullable=false)

+    private OLTSlot oltSlot;

+    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "OLTPort")

+    private Set<ONTDevice> ontDevices;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("oltSlot{");

+        sb.append("id=").append(id);

+        sb.append(", portAuthState='").append(portAuthState).append('\'');

+        sb.append(", adminState='").append(adminState).append('\'');

+        sb.append(", portNumber=").append(portNumber);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTSlot.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTSlot.java
new file mode 100644
index 0000000..9d39503
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/OLTSlot.java
@@ -0,0 +1,80 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.*;

+import java.util.Set;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class OLTSlot extends BaseEntity {

+

+    private String serialNumber;

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState operationalState;

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState portAuthState;

+    @Enumerated(value = EnumType.STRING)

+    private AdminState adminState;

+    private String ipAddress;

+    private String hostname;

+    private String macAddress;

+    private Integer port;

+    private Integer number;

+    @Enumerated(value = EnumType.STRING)

+    private OltDriver oltDriver;

+    @Enumerated(value = EnumType.STRING)

+    private OltType oltType;

+    private String name;

+    @ManyToOne

+    @JoinColumn(name="chassis_id", nullable=false)

+    private Chassis chassis;

+    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "oltSlot")

+    private Set<OLTPort> oltPorts;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("oltSlot{");

+        sb.append("serialNumber=").append(serialNumber);

+        sb.append(", operationalState='").append(operationalState).append('\'');

+        sb.append(", portAuthState='").append(portAuthState).append('\'');

+        sb.append(", adminState='").append(adminState).append('\'');

+        sb.append(", ipAddress=").append(ipAddress);

+        sb.append(", hostname=").append(hostname);

+        sb.append(", macAddress=").append(macAddress);

+        sb.append(", port=").append(port);

+        sb.append(", number=").append(number);

+        sb.append(", name=").append(name);

+        sb.append(", oltDriver=").append(oltDriver);

+        sb.append(", oltType=").append(oltType);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/ONTDevice.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/ONTDevice.java
new file mode 100644
index 0000000..17666a6
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/ONTDevice.java
@@ -0,0 +1,66 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.*;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class ONTDevice extends BaseEntity {

+

+    private String serialNumber;

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState portAuthState;

+    @Enumerated(value = EnumType.STRING)

+    private AdminState adminState;

+    @Enumerated(value = EnumType.STRING)

+    private ActivityState operationalState;

+    private String ipAddress;

+    private String macAddress;

+    private int number;

+    @ManyToOne

+    @JoinColumn(name="OLTPort_id", nullable=false)

+    private OLTPort OLTPort;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("oltSlot{");

+        sb.append("id=").append(id);

+        sb.append(", serialNumber='").append(serialNumber).append('\'');

+        sb.append(", portAuthState='").append(portAuthState).append('\'');

+        sb.append(", adminState='").append(adminState).append('\'');

+        sb.append(", operationalState='").append(operationalState).append('\'');

+        sb.append(", macAddress='").append(macAddress).append('\'');

+        sb.append(", number='").append(number).append('\'');

+        sb.append(", ipAddress=").append(ipAddress);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/OltDriver.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/OltDriver.java
new file mode 100644
index 0000000..2418196
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/OltDriver.java
@@ -0,0 +1,34 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public enum OltDriver {

+    OPENOLT,

+    ASFVOLT16,

+    ADTRAN,

+    TIBITS

+}

+

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/OltType.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/OltType.java
new file mode 100644
index 0000000..02de226
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/OltType.java
@@ -0,0 +1,32 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public enum OltType {

+    EDGECORE,

+    ADTRAN,

+    TIBIT,

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfig.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfig.java
new file mode 100644
index 0000000..8cf9d25
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfig.java
@@ -0,0 +1,53 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.Data;

+import lombok.EqualsAndHashCode;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.*;

+

+@Entity

+@Table(name = "pm_config")

+@Data

+@AllArgsConstructor

+@NoArgsConstructor

+@EqualsAndHashCode(callSuper = false)

+public class PmConfig extends BaseEntity {

+    @Enumerated(value = EnumType.STRING)

+    private PmConfigType type;

+

+    private String name;

+    private Boolean enabled;

+    private Integer sampleFreq;

+

+    @ManyToOne

+    @JoinColumn(name="pm_configs_id")

+    private PmConfigs pmConfigs;

+

+    @ManyToOne

+    @JoinColumn(name="pm_group_config_id")

+    private PmGroupConfig pmGroupConfig;

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigType.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigType.java
new file mode 100644
index 0000000..ac03d48
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigType.java
@@ -0,0 +1,30 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+public enum PmConfigType {

+    COUNTER,

+    GAUGE,

+    STATE,

+    CONTEXT

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigs.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigs.java
new file mode 100644
index 0000000..fa76f80
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmConfigs.java
@@ -0,0 +1,46 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.Data;

+import lombok.EqualsAndHashCode;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.*;

+import java.util.List;

+

+@Entity

+@Table(name = "pm_configs")

+@Data

+@AllArgsConstructor

+@NoArgsConstructor

+@EqualsAndHashCode(callSuper = false)

+public class PmConfigs extends BaseEntity{

+    private Boolean grouped;

+    @OneToMany(mappedBy = "pmConfigs",cascade = CascadeType.ALL, fetch = FetchType.LAZY)

+    List<PmGroupConfig> pmGroupConfig;

+    @OneToMany(mappedBy = "pmConfigs",cascade = CascadeType.ALL, fetch = FetchType.EAGER)

+    List<PmConfig> pmConfig;

+

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/PmGroupConfig.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmGroupConfig.java
new file mode 100644
index 0000000..a233886
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/PmGroupConfig.java
@@ -0,0 +1,50 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.AllArgsConstructor;

+import lombok.Data;

+import lombok.EqualsAndHashCode;

+import lombok.NoArgsConstructor;

+

+import javax.persistence.*;

+import java.util.List;

+

+@Entity

+@Table(name = "pm_group_config")

+@Data

+@AllArgsConstructor

+@NoArgsConstructor

+@EqualsAndHashCode(callSuper = false)

+public class PmGroupConfig extends BaseEntity {

+    private String groupName;

+    private Integer groupFreq;

+    private Boolean enabled;

+    @OneToMany(mappedBy = "pmGroupConfig",cascade = CascadeType.ALL, fetch = FetchType.EAGER)

+    private List<PmConfig> pmConfigList;

+

+    @ManyToOne

+    @JoinColumn(name="pm_configs_id")

+    private PmConfigs pmConfigs;

+

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/Service.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/Service.java
new file mode 100644
index 0000000..a8c5ea5
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/Service.java
@@ -0,0 +1,65 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.Entity;

+import javax.persistence.FetchType;

+import javax.persistence.ManyToMany;

+import javax.persistence.OneToOne;

+import java.util.Set;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class Service extends BaseEntity {

+

+    private String name;

+    @OneToOne(fetch = FetchType.EAGER)

+    private TechnologyProfile technologyProfile;

+    @OneToOne(fetch = FetchType.EAGER)

+    private SpeedProfile upStreamProfile;

+    @OneToOne(fetch = FetchType.EAGER)

+    private SpeedProfile downStreamProfile;

+

+    @ManyToMany(mappedBy = "services")

+    private Set<Subscriber> subscribers;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("Service{");

+        sb.append("name='").append(name).append('\'');

+        sb.append(", technologyProfile=").append(technologyProfile);

+        sb.append(", id=").append(id);

+        sb.append(", upStreamProfile=").append(upStreamProfile);

+        sb.append(", downStreamProfile=").append(downStreamProfile);

+        sb.append(", subscribers=").append(subscribers);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/SpeedProfile.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/SpeedProfile.java
new file mode 100644
index 0000000..d4bf1c1
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/SpeedProfile.java
@@ -0,0 +1,54 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.Entity;

+import javax.persistence.EnumType;

+import javax.persistence.Enumerated;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class SpeedProfile extends BaseEntity {

+

+    @Enumerated(value = EnumType.STRING)

+    private StreamDirection streamDirection;

+

+    private String data;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("SpeedProfile{");

+        sb.append("streamDirection=").append(streamDirection);

+        sb.append(", data='").append(data).append('\'');

+        sb.append(", id=").append(id);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/StreamDirection.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/StreamDirection.java
new file mode 100644
index 0000000..d84c518
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/StreamDirection.java
@@ -0,0 +1,30 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+public enum  StreamDirection {

+    UPSTREAM, DOWNSTREAM

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/Subscriber.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/Subscriber.java
new file mode 100644
index 0000000..6da876d
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/Subscriber.java
@@ -0,0 +1,59 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.*;

+import java.util.Set;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+@Entity

+@Setter

+@Getter

+public class Subscriber extends BaseEntity {

+

+    @Column(unique = true)

+    private String userIdentifier;

+    private Integer cTag;

+    private Integer sTag;

+    @ManyToMany

+    @JoinTable(name = "subscriber_service", joinColumns = @JoinColumn(name = "subscriber_id"),

+    inverseJoinColumns = @JoinColumn(name = "service_id"))

+    private Set<Service> services;

+

+    //TODO Configurations such as NAS and DHCP!

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("Subscriber{");

+        sb.append("userIdentifier='").append(userIdentifier).append('\'');

+        sb.append(", cTag=").append(cTag);

+        sb.append(", sTag=").append(sTag);

+        sb.append(", services=").append(services);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/dao/TechnologyProfile.java b/osam-core/model/src/main/java/org/onap/osam/model/dao/TechnologyProfile.java
new file mode 100644
index 0000000..f352bd4
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/dao/TechnologyProfile.java
@@ -0,0 +1,48 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.dao;

+

+import lombok.Getter;

+import lombok.Setter;

+

+import javax.persistence.Entity;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+@Entity

+@Getter

+@Setter

+public class TechnologyProfile extends BaseEntity {

+

+    private String data;

+

+    @Override

+    public String toString() {

+        final StringBuilder sb = new StringBuilder("TechnologyProfile{");

+        sb.append("data='").append(data).append('\'');

+        sb.append(", id=").append(id);

+        sb.append('}');

+        return sb.toString();

+    }

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/AccessPodRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/AccessPodRepository.java
new file mode 100644
index 0000000..c4a400c
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/AccessPodRepository.java
@@ -0,0 +1,36 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.AccessPod;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.Optional;

+

+/**

+ * Created by cemturker on 26.09.2018.

+ */

+public interface AccessPodRepository extends CrudRepository<AccessPod, Long> {

+    Optional<AccessPod> findByPnfId(String pnfId);

+    void removeByPnfId(String pnfId);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/ActiveAlarmsAndEventsRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/ActiveAlarmsAndEventsRepository.java
new file mode 100644
index 0000000..f474c5b
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/ActiveAlarmsAndEventsRepository.java
@@ -0,0 +1,34 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.ActiveAlarmsAndEvents;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.Date;

+import java.util.List;

+

+public interface ActiveAlarmsAndEventsRepository extends CrudRepository<ActiveAlarmsAndEvents, Long> {

+    List<ActiveAlarmsAndEvents> findAllActiveAlarmsAndEventsByDateLessThanEqualAndDateGreaterThanEqual(Date endDate, Date startDate);

+

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/ChassisRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/ChassisRepository.java
new file mode 100644
index 0000000..73f1d5f
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/ChassisRepository.java
@@ -0,0 +1,40 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.Chassis;

+import org.springframework.data.jpa.repository.Query;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.List;

+import java.util.Optional;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public interface ChassisRepository extends CrudRepository<Chassis, Long> {

+

+    @Query("select c from Chassis c where c.clli = ?1")

+    Optional<Chassis> findByClli(String clli);

+    Optional<List<Chassis>> findByAccessPodPnfId(String pnfId);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/HistoricalAlarmsAndEventsRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/HistoricalAlarmsAndEventsRepository.java
new file mode 100644
index 0000000..8b1db77
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/HistoricalAlarmsAndEventsRepository.java
@@ -0,0 +1,33 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.HistoricalAlarmsAndEvents;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.Date;

+import java.util.List;

+

+public interface HistoricalAlarmsAndEventsRepository extends CrudRepository<HistoricalAlarmsAndEvents, Long> {

+    List<HistoricalAlarmsAndEvents> findAllHistoricalAlarmsAndEventsByDateLessThanEqualAndDateGreaterThanEqual(Date endDate, Date startDate);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTPortRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTPortRepository.java
new file mode 100644
index 0000000..06b7694
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTPortRepository.java
@@ -0,0 +1,39 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.OLTPort;

+import org.springframework.data.jpa.repository.JpaRepository;

+

+import java.util.Optional;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public interface OLTPortRepository extends JpaRepository<OLTPort, Long> {

+

+    Optional<OLTPort> findByPortNumber(int number);

+

+    Optional<OLTPort> findByPortNumberAndOltSlot_NumberAndOltSlot_ChassisClli(int portNumber, int slotNumber, String clli);

+

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTSlotRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTSlotRepository.java
new file mode 100644
index 0000000..d8fcddf
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/OLTSlotRepository.java
@@ -0,0 +1,37 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.OLTSlot;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.Optional;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public interface OLTSlotRepository extends CrudRepository<OLTSlot, Long> {

+

+    Optional<OLTSlot> findByNumber(int number);

+    Optional<OLTSlot> findBySerialNumber(String serialNumber);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/ONTDeviceRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/ONTDeviceRepository.java
new file mode 100644
index 0000000..9aac009
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/ONTDeviceRepository.java
@@ -0,0 +1,37 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.ONTDevice;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.Optional;

+

+/**

+ * Created by Zafer Kaban on 18.09.2018.

+ */

+public interface ONTDeviceRepository extends CrudRepository<ONTDevice, Long> {

+

+    Optional<ONTDevice> findBySerialNumber(String serialNumber);

+

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigRepository.java
new file mode 100644
index 0000000..9964268
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigRepository.java
@@ -0,0 +1,35 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.PmConfig;

+import org.springframework.data.repository.CrudRepository;

+

+import java.util.List;

+

+public interface PmConfigRepository extends CrudRepository<PmConfig, Long> {

+

+    List<PmConfig> getByPmConfigs_Id(Long pmConfigsId);

+

+    List<PmConfig> getByPmGroupConfig_Id(Long pmGroupConfigId);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigsRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigsRepository.java
new file mode 100644
index 0000000..249f0c5
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmConfigsRepository.java
@@ -0,0 +1,29 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.PmConfigs;

+import org.springframework.data.repository.CrudRepository;

+

+public interface PmConfigsRepository extends CrudRepository<PmConfigs, Long> {

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/PmGroupConfigRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmGroupConfigRepository.java
new file mode 100644
index 0000000..4867afe
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/PmGroupConfigRepository.java
@@ -0,0 +1,29 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.PmGroupConfig;

+import org.springframework.data.repository.CrudRepository;

+

+public interface PmGroupConfigRepository extends CrudRepository<PmGroupConfig, Long> {

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/ServiceRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/ServiceRepository.java
new file mode 100644
index 0000000..fbec2a3
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/ServiceRepository.java
@@ -0,0 +1,32 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.Service;

+import org.springframework.data.repository.CrudRepository;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+public interface ServiceRepository extends CrudRepository<Service, Long> {

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/SpeedProfileRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/SpeedProfileRepository.java
new file mode 100644
index 0000000..ee4fb0e
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/SpeedProfileRepository.java
@@ -0,0 +1,32 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.SpeedProfile;

+import org.springframework.data.repository.CrudRepository;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+public interface SpeedProfileRepository extends CrudRepository<SpeedProfile, Long> {

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/SubscriberRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/SubscriberRepository.java
new file mode 100644
index 0000000..51da514
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/SubscriberRepository.java
@@ -0,0 +1,34 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.Subscriber;

+import org.springframework.data.repository.CrudRepository;

+

+/**

+ * Created by cemturker on 19.09.2018.

+ */

+public interface SubscriberRepository extends CrudRepository<Subscriber, Long> {

+    Subscriber findByUserIdentifier(String userIdentifier);

+    void deleteByUserIdentifier(String userIdentifier);

+}

diff --git a/osam-core/model/src/main/java/org/onap/osam/model/repository/TechnologyProfileRepository.java b/osam-core/model/src/main/java/org/onap/osam/model/repository/TechnologyProfileRepository.java
new file mode 100644
index 0000000..302cd52
--- /dev/null
+++ b/osam-core/model/src/main/java/org/onap/osam/model/repository/TechnologyProfileRepository.java
@@ -0,0 +1,32 @@
+/*-

+ * ============LICENSE_START=======================================================

+ * OSAM Core

+ * ================================================================================

+ * Copyright (C) 2018 Netsia

+ * ================================================================================

+ * Licensed under the Apache License, Version 2.0 (the "License");

+ * you may not use this file except in compliance with the License.

+ * You may obtain a copy of the License at

+ * 

+ *      http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing, software

+ * distributed under the License is distributed on an "AS IS" BASIS,

+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+ * See the License for the specific language governing permissions and

+ * limitations under the License.

+ * ============LICENSE_END=========================================================

+ */

+

+

+

+package org.onap.osam.model.repository;

+

+import org.onap.osam.model.dao.TechnologyProfile;

+import org.springframework.data.repository.CrudRepository;

+

+/**

+ * Created by cemturker on 18.09.2018.

+ */

+public interface TechnologyProfileRepository extends CrudRepository<TechnologyProfile, Long> {

+}

diff --git a/osam-core/model/src/main/resources/application.properties b/osam-core/model/src/main/resources/application.properties
new file mode 100644
index 0000000..f03a78a
--- /dev/null
+++ b/osam-core/model/src/main/resources/application.properties
@@ -0,0 +1,9 @@
+spring.datasource.url=jdbc:mariadb://localhost:3306/osam_core

+spring.datasource.username=root

+spring.datasource.password=123456

+spring.datasource.driver-class-name=org.mariadb.jdbc.Driver

+spring.jpa.hibernate.ddl-auto=update

+

+logging.level.org.hibernate.SQL=DEBUG

+logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

+logging.level.org.hibernate.type=TRACE
\ No newline at end of file