From da07b1e1018bb1eb2313885e16696134a74b6c1f Mon Sep 17 00:00:00 2001 From: Ashera Silva Date: Wed, 18 Oct 2023 20:12:50 +0530 Subject: [PATCH] Clean codebase --- .../subscription/SubscriptionDataStore.java | 10 ------- .../SubscriptionDataStoreImpl.java | 28 ------------------- 2 files changed, 38 deletions(-) diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java index 9ce200ad50..2819c267ba 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java @@ -70,16 +70,6 @@ void addSubscriptionPolicies( void addApplicationKeyMappings( List applicationKeyMappingList); - /** - * Filter the API map according to the provided parameters - * @param name API Name - * @param context API Context - * @param version API Version - * @param uuid API UUID - * @return Matching list of apis. - */ - List getMatchingAPIs(String name, String context, String version, String uuid); - /** * Filter the API map according to the provided parameters * diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java index 2495def26e..55e0652d11 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java @@ -293,34 +293,6 @@ public void addApplicationMappings( this.applicationMappingMap = newApplicationMappingMap; } - @Override - public List getMatchingAPIs(String name, String context, String version, String uuid) { - - List apiList = new ArrayList<>(); - for (API api : apiMap.values()) { - boolean isNameMatching = true; - boolean isContextMatching = true; - boolean isVersionMatching = true; - boolean isUUIDMatching = true; - if (StringUtils.isNotEmpty(name)) { - isNameMatching = api.getApiName().contains(name); - } - if (StringUtils.isNotEmpty(context)) { - isContextMatching = api.getContext().equals(context); - } - if (StringUtils.isNotEmpty(version)) { - isVersionMatching = api.getApiVersion().equals(version); - } - if (StringUtils.isNotEmpty(uuid)) { - isUUIDMatching = api.getApiUUID().equals(uuid); - } - if (isNameMatching && isContextMatching && isVersionMatching && isUUIDMatching) { - apiList.add(api); - } - } - return apiList; - } - @Override public API getMatchingAPI(String context, String version) {