|
|
@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
package io.entgra.device.mgt.core.apimgt.application.extension;
|
|
|
|
package io.entgra.device.mgt.core.apimgt.application.extension;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.bean.RegistrationProfile;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.bean.RegistrationProfile;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
|
|
|
|
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
|
|
|
@ -54,11 +55,7 @@ import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClient
|
|
|
|
import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This class represents an implementation of APIManagementProviderService.
|
|
|
|
* This class represents an implementation of APIManagementProviderService.
|
|
|
@ -107,17 +104,36 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|
|
|
boolean isAllowedAllDomains,
|
|
|
|
boolean isAllowedAllDomains,
|
|
|
|
String validityTime, String password) throws APIManagerException {
|
|
|
|
String validityTime, String password) throws APIManagerException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
APIApplicationServices apiApplicationServices = APIApplicationManagerExtensionDataHolder.getInstance().getApiApplicationServices();
|
|
|
|
|
|
|
|
|
|
|
|
ConsumerRESTAPIServices consumerRESTAPIServices =
|
|
|
|
ConsumerRESTAPIServices consumerRESTAPIServices =
|
|
|
|
APIApplicationManagerExtensionDataHolder.getInstance().getConsumerRESTAPIServices();
|
|
|
|
APIApplicationManagerExtensionDataHolder.getInstance().getConsumerRESTAPIServices();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
consumerRESTAPIServices.getAllApplications(null, null, applicationName);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
List<String> uniqueApiList = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String tag: tags) {
|
|
|
|
|
|
|
|
Map<String, String> queryParams = new HashMap<>();
|
|
|
|
|
|
|
|
queryParams.put("tag", tag);
|
|
|
|
|
|
|
|
if ("carbon.super".equals(tenantDomain)) {
|
|
|
|
|
|
|
|
consumerRESTAPIServices.getAllApis(null, null, queryParams);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//call All API getting call with carbon super header param
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uniqueApiList.add("Test");
|
|
|
|
|
|
|
|
Set<String> taggedAPISet = new HashSet<>(uniqueApiList);
|
|
|
|
|
|
|
|
uniqueApiList.clear();
|
|
|
|
|
|
|
|
uniqueApiList.addAll(taggedAPISet);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
consumerRESTAPIServices.getAllSubscriptions(null, null, "1");
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
consumerRESTAPIServices.getAllApplications(null, null, null);
|
|
|
|
|
|
|
|
} catch (APIServicesException e) {
|
|
|
|
} catch (APIServicesException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (BadRequestException e) {
|
|
|
|
} catch (BadRequestException e) {
|
|
|
|