Refactor: make query methods visible in OpenStackSecurityGroupAdminService
Change-Id: Ie698db5ff5de23219e967d43b8e053859265c706
diff --git a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/api/OpenstackSecurityGroupAdminService.java b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/api/OpenstackSecurityGroupAdminService.java
index b781ff6..2ffec86 100644
--- a/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/api/OpenstackSecurityGroupAdminService.java
+++ b/apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/api/OpenstackSecurityGroupAdminService.java
@@ -21,7 +21,7 @@
/**
* Service for administering the inventory of Openstack security group.
*/
-public interface OpenstackSecurityGroupAdminService {
+public interface OpenstackSecurityGroupAdminService extends OpenstackSecurityGroupService {
/**
* Creates a security group.
*
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
index 106947e..978b4b2 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/cli/OpenstackSyncStateCommand.java
@@ -23,7 +23,6 @@
import org.onosproject.openstacknetworking.api.OpenstackNetworkAdminService;
import org.onosproject.openstacknetworking.api.OpenstackRouterAdminService;
import org.onosproject.openstacknetworking.api.OpenstackSecurityGroupAdminService;
-import org.onosproject.openstacknetworking.api.OpenstackSecurityGroupService;
import org.openstack4j.api.OSClient;
import org.openstack4j.api.exceptions.AuthenticationException;
import org.openstack4j.model.identity.v2.Access;
@@ -80,7 +79,6 @@
@Override
protected void execute() {
OpenstackSecurityGroupAdminService osSgAdminService = get(OpenstackSecurityGroupAdminService.class);
- OpenstackSecurityGroupService osSgService = get(OpenstackSecurityGroupService.class);
OpenstackNetworkAdminService osNetAdminService = get(OpenstackNetworkAdminService.class);
OpenstackRouterAdminService osRouterAdminService = get(OpenstackRouterAdminService.class);
@@ -105,7 +103,7 @@
print("Synchronizing OpenStack security groups");
print(SECURITY_GROUP_FORMAT, "ID", "Name");
osClient.networking().securitygroup().list().forEach(osSg -> {
- if (osSgService.securityGroup(osSg.getId()) != null) {
+ if (osSgAdminService.securityGroup(osSg.getId()) != null) {
osSgAdminService.updateSecurityGroup(osSg);
} else {
osSgAdminService.createSecurityGroup(osSg);