From c68b92c7b44c9ef0b9d4ff13278eb25e6dea222f Mon Sep 17 00:00:00 2001 From: mharindu Date: Mon, 16 May 2016 14:12:28 +0530 Subject: [PATCH] Fixed conflicts --- .../lifecycle/util/AnnotationProcessor.java | 11 +--- .../core/config/DeviceManagementConfig.java | 14 ----- .../config/deviceType/DTConfiguration.java | 53 ------------------- 3 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/deviceType/DTConfiguration.java diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java index 730c8c82dc..46b4db6b7e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java @@ -28,12 +28,11 @@ import org.scannotation.WarUrlFinder; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.api.model.Scope; +import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherUtil; import org.wso2.carbon.apimgt.webapp.publisher.config.APIResource; import org.wso2.carbon.apimgt.webapp.publisher.config.APIResourceConfiguration; import org.wso2.carbon.apimgt.webapp.publisher.config.PermissionConfiguration; import org.wso2.carbon.apimgt.webapp.publisher.config.PermissionManagementException; -import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; -import org.wso2.carbon.device.mgt.core.config.deviceType.DTConfiguration; import javax.servlet.ServletContext; import javax.ws.rs.*; @@ -225,13 +224,7 @@ public class AnnotationProcessor { APIResource resource = new APIResource(); resource.setUriTemplate(makeContextURLReady(apiRootContext + subCtx)); - DTConfiguration deviceTypeConfig = DeviceConfigurationManager.getInstance(). - getDeviceManagementConfig().getDTDeploymentConfiguration(); - - String serverIP = deviceTypeConfig.getDtHostAddress(); - String httpServerPort = deviceTypeConfig.getDtHostPort(); - - resource.setUri(PROTOCOL_HTTP + "://" + serverIP + ":" + httpServerPort + makeContextURLReady( + resource.setUri(APIPublisherUtil.getServerBaseUrl() + makeContextURLReady( resourceRootContext) + makeContextURLReady(subCtx)); resource.setAuthType(AUTH_TYPE); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java index ee11038ca4..1ffbf06257 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java @@ -17,15 +17,12 @@ */ package org.wso2.carbon.device.mgt.core.config; -import org.wso2.carbon.device.mgt.core.config.deviceType.DTConfiguration; import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations; import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration; import org.wso2.carbon.device.mgt.core.config.task.TaskConfiguration; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import java.util.List; /** * Represents Device Mgt configuration. @@ -37,8 +34,6 @@ public final class DeviceManagementConfig { private TaskConfiguration taskConfiguration; private IdentityConfigurations identityConfigurations; private PolicyConfiguration policyConfiguration; - //private List pushNotificationProviders; - private DTConfiguration dTDepyloymentConfiguration; @XmlElement(name = "ManagementRepository", required = true) public DeviceManagementConfigRepository getDeviceManagementConfigRepository() { @@ -77,15 +72,6 @@ public final class DeviceManagementConfig { this.taskConfiguration = taskConfiguration; } - @XmlElement(name = "DTDeploymentConfiguration", required = true) - public DTConfiguration getDTDeploymentConfiguration() { - return dTDepyloymentConfiguration; - } - - public void setDTDeploymentConfiguration(DTConfiguration dTDeploymentConfiguration) { - this.dTDepyloymentConfiguration = dTDeploymentConfiguration; - } - // @XmlElementWrapper(name = "PushNotificationProviders", required = true) // @XmlElement(name = "Provider", required = true) // public List getPushNotificationProviders() { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/deviceType/DTConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/deviceType/DTConfiguration.java deleted file mode 100644 index 14a3af1274..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/deviceType/DTConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ - - -/** - * This class will read the configurations related to task. This task will be responsible for adding the operations. - */ -package org.wso2.carbon.device.mgt.core.config.deviceType; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "DTDepyloymentConfiguration") -public class DTConfiguration { - - private String dtHostAddress; - private String dtHostPort; - - @XmlElement(name = "DTHostAddress", required = true) - public String getDtHostAddress() { - return dtHostAddress; - } - - public void setDtHostAddress(String dtHostAddress) { - this.dtHostAddress = dtHostAddress; - } - - @XmlElement(name = "DTHostPort", required = true) - public String getDtHostPort() { - return dtHostPort; - } - - public void setDtHostPort(String dtHostPort) { - this.dtHostPort = dtHostPort; - } - - -}