diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java index 0808f11963..67a6f21f16 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -41,6 +41,7 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.bean.APIMConsumer.App import io.entgra.device.mgt.core.apimgt.extension.rest.api.bean.APIMConsumer.Subscription; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.ApiApplicationInfo; +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.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; @@ -119,6 +120,40 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe return generateAndRetrieveApplicationKeys(applicationName, tags ,keyType, isAllowedAllDomains, validityTime, tokenInfo); } + @Override + public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], + String keyType, String username, + boolean isAllowedAllDomains, + String validityTime, String password) throws APIManagerException { + + + ConsumerRESTAPIServices consumerRESTAPIServices = + APIApplicationManagerExtensionDataHolder.getInstance().getConsumerRESTAPIServices(); + + + /* + + */ + + try { + consumerRESTAPIServices.getAllApplications(null, null, null); + } catch (APIServicesException e) { + e.printStackTrace(); + } catch (BadRequestException e) { + e.printStackTrace(); + } catch (UnexpectedResponseException e) { + e.printStackTrace(); + } + + return null; + + + } + + + /** + * {@inheritDoc} + */ @Override public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String[] tags, String keyType, String username, diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java index c8608b4fc8..978a46c13a 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java @@ -39,12 +39,8 @@ public class APIApplicationManagerExtensionDataHolder { private TenantIndexingLoader indexLoader; private JWTClientManagerService jwtClientManagerService; private ConsumerRESTAPIServices consumerRESTAPIServices; -<<<<<<< HEAD private APIApplicationServices apiApplicationServices; private MetadataManagementService metadataManagementService; -======= ->>>>>>> 9fc055cd4f (Add Consumer REST API integration) - private APIApplicationManagerExtensionDataHolder() { } @@ -121,7 +117,6 @@ public class APIApplicationManagerExtensionDataHolder { public void setConsumerRESTAPIServices(ConsumerRESTAPIServices consumerRESTAPIServices) { this.consumerRESTAPIServices = consumerRESTAPIServices; } -<<<<<<< HEAD public APIApplicationServices getApiApplicationServices() { return apiApplicationServices; @@ -138,6 +133,4 @@ public class APIApplicationManagerExtensionDataHolder { public void setMetadataManagementService(MetadataManagementService metadataManagementService) { this.metadataManagementService = metadataManagementService; } -======= ->>>>>>> 9fc055cd4f (Add Consumer REST API integration) } diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java index 78e0867d78..ffb576295d 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java @@ -55,12 +55,18 @@ import org.wso2.carbon.user.core.service.RealmService; * policy="dynamic" * bind="setRealmService" * unbind="unsetRealmService" - * @scr.reference name="io.entgra.device.mgt.core.apimgt.extension.rest.api" + * @scr.reference name="apimgt.extension.ConsumerRESTAPIServices" * interface="io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices" * cardinality="0..1" * policy="dynamic" * bind="setConsumerRESTAPIServices" * unbind="unsetConsumerRESTAPIServices" + * @scr.reference name="apimgt.extension.APIApplicationService" + * interface="io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices" + * cardinality="0..1" + * policy="dynamic" + * bind="setAPIApplicationServices" + * unbind="unsetAPIApplicationServices" */ public class APIApplicationManagerExtensionServiceComponent {