From 69ace640914299e5fb0ca2f2b2e5cccd0a406fe4 Mon Sep 17 00:00:00 2001 From: Chatura Dilan Date: Fri, 26 May 2017 14:21:54 +0530 Subject: [PATCH] Refactoring services classes --- .../services/ApplicationReleaseManager.java | 2 +- .../mgt/common/services/CategoryManager.java | 2 +- .../mgt/common/services/CommentsManager.java | 2 +- .../services/LifecycleStateManager.java | 2 +- .../mgt/common/services/PlatformManager.java | 2 +- .../common/services/ResourceTypeManager.java | 2 +- .../common/services/SubscriptionManager.java | 2 +- .../common/services/VisibilityManager.java | 2 +- .../ApplicationManagementServiceFactory.java | 11 +++++++++- .../impl/ApplicationReleaseManagerImpl.java} | 7 +++--- .../extensions/payments/PaymentService.java | 22 ------------------- 11 files changed, 22 insertions(+), 34 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/impl/PaymentServiceImpl.java => org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationReleaseManagerImpl.java} (74%) delete mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/PaymentService.java diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java index 628f2c1ed83..43a870d8cc4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationReleaseManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface ApplicationReleaseManager { +public interface ApplicationReleaseManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java index 6a2197a0d4f..462db94f5d5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CategoryManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface CategoryManager { +public interface CategoryManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CommentsManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CommentsManager.java index 5dd3db83c7b..031e3fcf85c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CommentsManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/CommentsManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface CommentsManager { +public interface CommentsManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/LifecycleStateManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/LifecycleStateManager.java index 36e772f7e8d..cfc84506a43 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/LifecycleStateManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/LifecycleStateManager.java @@ -18,6 +18,6 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface LifecycleStateManager { +public interface LifecycleStateManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java index fb57b924a30..e006ad5697f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/PlatformManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface PlatformManager { +public interface PlatformManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ResourceTypeManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ResourceTypeManager.java index 8f05c6bba9e..87bff5dcac2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ResourceTypeManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ResourceTypeManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface ResourceTypeManager { +public interface ResourceTypeManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java index 1067c3bcb9c..371fa93695c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface SubscriptionManager { +public interface SubscriptionManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/VisibilityManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/VisibilityManager.java index 409f8e571f7..e2febced23e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/VisibilityManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/VisibilityManager.java @@ -18,5 +18,5 @@ */ package org.wso2.carbon.device.application.mgt.common.services; -public interface VisibilityManager { +public interface VisibilityManager extends ApplicationManagementService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationManagementServiceFactory.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationManagementServiceFactory.java index d1db02f71fb..1de229058c4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationManagementServiceFactory.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationManagementServiceFactory.java @@ -35,13 +35,22 @@ public class ApplicationManagementServiceFactory { public enum ManagerService { APPLICATION_MANAGER, - APPLICATION_RELEASE_MANAGER + APPLICATION_RELEASE_MANAGER, + CATEGORY_MANAGER, + COMMENTS_MANAGER, + LIFECYCLE_STATE_MANAGER, + PLATFORM_MANAGER, + RESOURCE_TYPE_MANAGER, + SUBSCRIPTION_MANAGER, + VISIBILITY_MANAGER } public ApplicationManagementService getApplicationManagementService(ManagerService managerService) { switch (managerService) { case APPLICATION_MANAGER: return new ApplicationManagerImpl(); + case APPLICATION_RELEASE_MANAGER: + return new ApplicationReleaseManagerImpl(); default: return null; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/impl/PaymentServiceImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationReleaseManagerImpl.java similarity index 74% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/impl/PaymentServiceImpl.java rename to components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationReleaseManagerImpl.java index a3df8dd4f71..622c6d516e3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/impl/PaymentServiceImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/services/impl/ApplicationReleaseManagerImpl.java @@ -16,9 +16,10 @@ * under the License. * */ -package org.wso2.carbon.device.application.mgt.extensions.payments.impl; +package org.wso2.carbon.device.application.mgt.core.services.impl; -import org.wso2.carbon.device.application.mgt.extensions.payments.PaymentService; +import org.wso2.carbon.device.application.mgt.common.services.ApplicationReleaseManager; + +public class ApplicationReleaseManagerImpl implements ApplicationReleaseManager { -public class PaymentServiceImpl implements PaymentService { } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/PaymentService.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/PaymentService.java deleted file mode 100644 index e9868a9637e..00000000000 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.extensions/src/main/java/org/wso2/carbon/device/application/mgt/extensions/payments/PaymentService.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.wso2.carbon.device.application.mgt.extensions.payments; - -public interface PaymentService { -}