diff options
Diffstat (limited to 'ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository')
16 files changed, 319 insertions, 0 deletions
diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellDetailsRepo.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellDetailsRepo.java new file mode 100644 index 0000000..48e20bf --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellDetailsRepo.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * Ran Simulator Controller + * ================================================================================ + * Copyright (C) 2020 Wipro Limited. + * ================================================================================ + * 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.ransim.rest.api.repository; + +import java.util.List; + +import org.onap.ransim.rest.api.models.CellDetails; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CellDetailsRepo extends CrudRepository<CellDetails, String> { + + @Query("SELECT n FROM CellDetails n WHERE n.serverId is null") + List<CellDetails> findCellsWithNoServerId(); + + @Query("SELECT cd from CellDetails cd where cd.pciCollisionDetected=true or cd.pciConfusionDetected=true") + List<CellDetails> getCellsWithCollisionOrConfusion(); +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellNeighborRepo.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellNeighborRepo.java new file mode 100644 index 0000000..99b620a --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/CellNeighborRepo.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * Ran Simulator Controller + * ================================================================================ + * Copyright (C) 2020 Wipro Limited. + * ================================================================================ + * 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.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.CellNeighbor; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CellNeighborRepo extends CrudRepository<CellNeighbor, String> { + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUCPRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUCPRepository.java new file mode 100644 index 0000000..b591e09 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUCPRepository.java @@ -0,0 +1,17 @@ +package org.onap.ransim.rest.api.repository; + +import java.util.List; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import org.onap.ransim.rest.api.models.GNBCUCPFunction; + +@Repository +public interface GNBCUCPRepository extends CrudRepository<GNBCUCPFunction,String>{ + @Query(nativeQuery=true, value="select distinct(cucp.gnbcuname) from gnbcucpfunction cucp join nrcellcu cellcu where cellcu.celllocalid in (:cellIdList)") + public List<String> findCUCPByCellIds(List<Integer> cellIdList); + @Query(nativeQuery = true, value = "select * from gnbcucpfunction cucp join plmninfo plmn where plmn.snssai=?1 and plmn.nrcellcu_celllocalid IS NOT NULL") + public List<GNBCUCPFunction> findCUCPsByNSSAI(String nSSAI); +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUUPRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUUPRepository.java new file mode 100644 index 0000000..8d15deb --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBCUUPRepository.java @@ -0,0 +1,10 @@ +package org.onap.ransim.rest.api.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.onap.ransim.rest.api.models.GNBCUUPFunction; + +@Repository +public interface GNBCUUPRepository extends CrudRepository<GNBCUUPFunction,Integer>{ + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBDURepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBDURepository.java new file mode 100644 index 0000000..cbc2182 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/GNBDURepository.java @@ -0,0 +1,14 @@ +package org.onap.ransim.rest.api.repository; + +import java.util.List; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.onap.ransim.rest.api.models.GNBDUFunction; + +@Repository +public interface GNBDURepository extends CrudRepository<GNBDUFunction,Integer>{ + @Query(nativeQuery = true, value = "select * from gnbdufunction du join plmninfo plmn where plmn.snssai=?1 and plmn.nrcelldu_celllocalid IS NOT NULL") + public List<GNBDUFunction> findDUsByNSSAI(String nSSAI); +} + diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellCURepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellCURepository.java new file mode 100644 index 0000000..4890343 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellCURepository.java @@ -0,0 +1,10 @@ +package org.onap.ransim.rest.api.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.onap.ransim.rest.api.models.NRCellCU; + +@Repository +public interface NRCellCURepository extends CrudRepository<NRCellCU,Integer>{ + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellDURepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellDURepository.java new file mode 100644 index 0000000..b1c123c --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NRCellDURepository.java @@ -0,0 +1,8 @@ +package org.onap.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.NRCellDU; +import org.springframework.data.repository.CrudRepository; + +public interface NRCellDURepository extends CrudRepository<NRCellDU, Integer> { + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NearRTRICRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NearRTRICRepository.java new file mode 100644 index 0000000..2f90fd4 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NearRTRICRepository.java @@ -0,0 +1,24 @@ +package org.onap.ransim.rest.api.repository; + +import java.util.List; +import java.util.Set; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.onap.ransim.rest.api.models.NearRTRIC; + +@Repository +public interface NearRTRICRepository extends CrudRepository<NearRTRIC,Integer>{ + + @Query(nativeQuery = true, value = "select * from nearrtric ric join trackingarea ta where tracking_area=?1") + public List<NearRTRIC> getListOfRICsInTrackingArea(String trackingArea); + + @Query(nativeQuery=true, value="select * from nearrtric ric join gnbcucpfunction cucp where cucp.gnbcuname=?1") + public List<NearRTRIC> findNearRTRICByCUCPName(String cucpNames); + + @Query(nativeQuery = true, value = "select * from nearrtric ric join rannfnssi nssi where nssi.rannfnssilist=?1") + public List<NearRTRIC> findNearRTRICByNSSI(String ranNFNSSIId); + + @Query(nativeQuery = true, value = "select * from nearrtric ric join plmninfo plmn where plmn.snssai=?1 and plmn.nearrtricid IS NOT NULL") + public Set<NearRTRIC> findNearRTRICByNSSAI(String nSSAI); +}
\ No newline at end of file diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NeighborDetailsRepo.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NeighborDetailsRepo.java new file mode 100644 index 0000000..7209f40 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NeighborDetailsRepo.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * Ran Simulator Controller + * ================================================================================ + * Copyright (C) 2020 Wipro Limited. + * ================================================================================ + * 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.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.NeighborDetails; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface NeighborDetailsRepo extends CrudRepository<NeighborDetails, String> { + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NetconfServersRepo.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NetconfServersRepo.java new file mode 100644 index 0000000..e0ecc03 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/NetconfServersRepo.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * Ran Simulator Controller + * ================================================================================ + * Copyright (C) 2020 Wipro Limited. + * ================================================================================ + * 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.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.NetconfServers; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface NetconfServersRepo extends CrudRepository<NetconfServers, String> { + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/OperationLogRepo.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/OperationLogRepo.java new file mode 100644 index 0000000..0541fec --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/OperationLogRepo.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * Ran Simulator Controller + * ================================================================================ + * Copyright (C) 2020 Wipro Limited. + * ================================================================================ + * 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.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.OperationLog; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface OperationLogRepo extends CrudRepository<OperationLog, String>{ + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RANInventoryRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RANInventoryRepository.java new file mode 100644 index 0000000..7511a89 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RANInventoryRepository.java @@ -0,0 +1,13 @@ +package org.onap.ransim.rest.api.repository; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import org.onap.ransim.rest.api.models.RANSliceInfo; + +@Repository +public interface RANInventoryRepository extends CrudRepository<RANSliceInfo,String>{ + @Query(nativeQuery = true, value = "select distinct(raninfo.rannfnssiid) from raninventory raninfo join nssai where nssai.nssailist=?1") + public String findRANNFNSSIofNSSAI(String sNSSAI); +}
\ No newline at end of file diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyMemberRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyMemberRepository.java new file mode 100644 index 0000000..a6f96d8 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyMemberRepository.java @@ -0,0 +1,31 @@ +/******************************************************************************* +* ============LICENSE_START======================================================= +* Config DB +* ================================================================================ +* Copyright (C) 2020-2021 Wipro Limited. +* ============================================================================== +* 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.ransim.rest.api.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import org.onap.ransim.rest.api.models.RRMPolicyMember; + +@Repository +public interface RRMPolicyMemberRepository extends CrudRepository<RRMPolicyMember,Integer>{ + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyRepository.java new file mode 100644 index 0000000..7a37572 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/RRMPolicyRepository.java @@ -0,0 +1,15 @@ +package org.onap.ransim.rest.api.repository; + +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import org.onap.ransim.rest.api.models.RRMPolicyRatio; + +@Repository +public interface RRMPolicyRepository extends CrudRepository<RRMPolicyRatio,Integer>{ + + @Query(nativeQuery = true, value="select * from rrmpolicy where resourcetype=?1 and resourceid=?2") + public RRMPolicyRatio findByResourceTypeAndId(String resourceType, String resourceId); + +} diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/SliceProfileRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/SliceProfileRepository.java new file mode 100644 index 0000000..717160a --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/SliceProfileRepository.java @@ -0,0 +1,9 @@ +package org.onap.ransim.rest.api.repository; + +import org.onap.ransim.rest.api.models.SliceProfile; +import org.springframework.data.repository.CrudRepository; + +public interface SliceProfileRepository extends CrudRepository <SliceProfile,String>{ + +} + diff --git a/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/TACellRepository.java b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/TACellRepository.java new file mode 100644 index 0000000..6ad6971 --- /dev/null +++ b/ransim/ransimctrlr/RANSIM-CTRLR/src/main/java/org/onap/ransim/rest/api/repository/TACellRepository.java @@ -0,0 +1,15 @@ +package org.onap.ransim.rest.api.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import org.onap.ransim.rest.api.models.TACells; +/*** + * + * @author onapadmin + * + */ +@Repository +public interface TACellRepository extends CrudRepository <TACells,String> { + +} |