nitin-maharana commented on a change in pull request #2031: CLOUDSTACK-8672 : 
NCC Integration with CloudStack
URL: https://github.com/apache/cloudstack/pull/2031#discussion_r122589608
 
 

 ##########
 File path: 
engine/schema/src/com/cloud/offerings/dao/NetworkOfferingDaoImpl.java
 ##########
 @@ -189,4 +191,32 @@ public NetworkOfferingVO persist(NetworkOfferingVO off, 
Map<Detail, String> deta
         return vo;
     }
 
+    @Override
+    public List<Long> listNetworkOfferingID() {
+        final SearchCriteria<NetworkOfferingVO> sc_1 = createSearchCriteria();
+        final Filter searchFilter_1 = new Filter(NetworkOfferingVO.class, 
"created", false, null, null);
+        sc_1.addAnd("servicePackageUuid", SearchCriteria.Op.NEQ, null);
+        sc_1.addAnd("removed", SearchCriteria.Op.EQ, null);
+        List<NetworkOfferingVO> set_of_servicePackageUuid = this.search(sc_1, 
searchFilter_1);
+        List<Long> id_set = new ArrayList<Long>();
+        for (NetworkOfferingVO node : set_of_servicePackageUuid) {
+            if (node.getServicePackage() != null && 
!node.getServicePackage().isEmpty()) {
+                id_set.add(node.getId());
+            }
+        }
+        return id_set;
+    }
+
+    @Override
+    public boolean isUsingServicePackage(String uuid) {
+        final SearchCriteria<NetworkOfferingVO> sc = createSearchCriteria();
+        final Filter searchFilter= new Filter(NetworkOfferingVO.class, 
"created", false, null, null);
+        sc.addAnd("state", SearchCriteria.Op.EQ, 
NetworkOffering.State.Enabled);
+        sc.addAnd("servicePackageUuid", SearchCriteria.Op.EQ, uuid);
+        List<NetworkOfferingVO> list = this.search(sc, searchFilter);
+        if(list!=null && !list.isEmpty())
 
 Review comment:
   DONE.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to