From 3219a7cc41e6b9c79151ed059a980d35f3b08b32 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 18 Mar 2015 15:47:31 +0530 Subject: [PATCH] Restructuring source code to be able to make it more maintenable --- .../DeviceManagementServiceException.java | 57 ------------------- .../device/mgt/common/FeatureManager.java | 22 +++++++ .../mgt/common/license/mgt}/License.java | 2 +- .../mgt/LicenseManagementException.java | 2 +- .../common}/license/mgt/LicenseManager.java | 2 +- .../license/mgt/LicenseNotFoundException.java | 2 +- .../mgt/common}/operation/mgt/Operation.java | 2 +- .../mgt/OperationExecutionException.java | 2 +- .../mgt/OperationManagementException.java | 2 +- .../operation/mgt/OperationManager.java | 2 +- 10 files changed, 30 insertions(+), 65 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt}/License.java (97%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/license/mgt/LicenseManagementException.java (96%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/license/mgt/LicenseManager.java (94%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/license/mgt/LicenseNotFoundException.java (96%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/operation/mgt/Operation.java (95%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/operation/mgt/OperationExecutionException.java (96%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/operation/mgt/OperationManagementException.java (96%) rename components/device-mgt/{org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core => org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common}/operation/mgt/OperationManager.java (97%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java deleted file mode 100644 index 15520c16c7..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014, 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.mgt.common; - -public class DeviceManagementServiceException extends Exception { - - private static final long serialVersionUID = -8933146283800122640L; - private String errorMessage; - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public DeviceManagementServiceException(String msg, Exception nestedEx) { - super(msg, nestedEx); - setErrorMessage(msg); - } - - public DeviceManagementServiceException(String message, Throwable cause) { - super(message, cause); - setErrorMessage(message); - } - - public DeviceManagementServiceException(String msg) { - super(msg); - setErrorMessage(msg); - } - - public DeviceManagementServiceException() { - super(); - } - - public DeviceManagementServiceException(Throwable cause) { - super(cause); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java new file mode 100644 index 0000000000..b10f0506fa --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/FeatureManager.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015, 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.mgt.common; + +public interface FeatureManager { +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/License.java similarity index 97% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/License.java index dc7a24135e..7044eb4916 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/license/License.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/License.java @@ -18,7 +18,7 @@ * */ -package org.wso2.carbon.device.mgt.core.config.license; +package org.wso2.carbon.device.mgt.common.license.mgt; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManagementException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManagementException.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManagementException.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManagementException.java index 7668f49682..8a0e462f39 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManagementException.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManagementException.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.device.mgt.core.license.mgt; +package org.wso2.carbon.device.mgt.common.license.mgt; public class LicenseManagementException extends Exception { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManager.java similarity index 94% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManager.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManager.java index df614f5fbb..63df2aefba 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseManager.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.device.mgt.core.license.mgt; +package org.wso2.carbon.device.mgt.common.license.mgt; import org.wso2.carbon.device.mgt.core.config.license.License; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseNotFoundException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseNotFoundException.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseNotFoundException.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseNotFoundException.java index c1c6ce9117..ee25364fcf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/license/mgt/LicenseNotFoundException.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/license/mgt/LicenseNotFoundException.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.device.mgt.core.license.mgt; +package org.wso2.carbon.device.mgt.common.license.mgt; public class LicenseNotFoundException extends RuntimeException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java similarity index 95% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/Operation.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java index a424180260..0f3d46a473 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/Operation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.core.operation.mgt; +package org.wso2.carbon.device.mgt.common.operation.mgt; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationExecutionException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationExecutionException.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationExecutionException.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationExecutionException.java index 94e870a440..422f689af3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationExecutionException.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationExecutionException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.core.operation.mgt; +package org.wso2.carbon.device.mgt.common.operation.mgt; public class OperationExecutionException extends Exception { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagementException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManagementException.java similarity index 96% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagementException.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManagementException.java index cdf8f79c93..ec4d40b0a4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagementException.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManagementException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.core.operation.mgt; +package org.wso2.carbon.device.mgt.common.operation.mgt; public class OperationManagementException extends Exception { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java similarity index 97% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManager.java rename to components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java index f7d9048de3..a045d10f5a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/operation/mgt/OperationManager.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.core.operation.mgt; +package org.wso2.carbon.device.mgt.common.operation.mgt; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.core.dto.DeviceType;