diff --git a/pom.xml b/pom.xml
index 0aa59f7d8..2f703b17a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,15 +133,7 @@
org.eclipse.equinox.common
${eclipse.equinox.common.version}
-
-
+
org.testng
testng
diff --git a/product/modules/distribution/src/assembly/bin.xml b/product/modules/distribution/src/assembly/bin.xml
index 0209ac3aa..1478107e9 100644
--- a/product/modules/distribution/src/assembly/bin.xml
+++ b/product/modules/distribution/src/assembly/bin.xml
@@ -251,7 +251,7 @@
-
+
wso2cdm-${pom.version}/repository/deployment/server/webapps
755
diff --git a/product/modules/mobileservices/agents/android/jax-rs/pom.xml b/product/modules/mobileservices/agents/android/jax-rs/pom.xml
index 43564dae7..54dfb6b31 100644
--- a/product/modules/mobileservices/agents/android/jax-rs/pom.xml
+++ b/product/modules/mobileservices/agents/android/jax-rs/pom.xml
@@ -115,34 +115,23 @@
org.apache.cxf
cxf-rt-frontend-jaxws
- ${cxf.version}
org.apache.cxf
cxf-rt-frontend-jaxrs
- ${cxf.version}
org.apache.cxf
cxf-rt-transports-http
- ${cxf.version}
junit
junit
test
- ${junit.version}
-
-
- commons-httpclient
- commons-httpclient
- 3.1
- provided
javax.ws.rs
jsr311-api
- 1.1.1
provided
@@ -153,13 +142,11 @@
org.wso2.carbon
org.wso2.carbon.device.mgt.common
- 2.0.0-SNAPSHOT
provided
org.wso2.carbon
org.wso2.carbon.device.mgt.core
- 2.0.0-SNAPSHOT
provided
@@ -170,11 +157,6 @@
org.codehaus.jackson
jackson-jaxrs
- 1.9.0
-
- 2.6.1
- 4.8.2
-
diff --git a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java
index 34b8b8a37..037d5cf30 100644
--- a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java
+++ b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Device.java
@@ -15,13 +15,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-//org.wso2.carbon....
package org.wso2.cdmserver.mobileservices.android;
import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
import org.wso2.cdmserver.mobileservices.android.util.Message;
-import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
@@ -53,8 +51,8 @@ public class Device {
List devices;
try {
- devices = AndroidAPIUtils.getDeviceManagementService().getAllDevices(
- DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
+ devices = AndroidAPIUtils.getDeviceManagementService().getAllDevices(DeviceManagementConstants
+ .MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
return devices;
} catch (DeviceManagementServiceException deviceMgtServiceEx) {
String errorMsg = "Device management service error";
@@ -84,7 +82,7 @@ public class Device {
DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id);
device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier);
if (device == null) {
- Response.status(HttpStatus.SC_NOT_FOUND);
+ Response.status(Response.Status.NOT_FOUND);
}
return device;
} catch (DeviceManagementServiceException deviceMgtServiceEx) {
@@ -116,10 +114,10 @@ public class Device {
device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
result = AndroidAPIUtils.getDeviceManagementService().updateDeviceInfo(device);
if (result) {
- Response.status(HttpStatus.SC_ACCEPTED);
+ Response.status(Response.Status.ACCEPTED);
responseMessage.setResponseMessage("Device information has modified successfully.");
} else {
- Response.status(HttpStatus.SC_NOT_MODIFIED);
+ Response.status(Response.Status.NOT_MODIFIED);
responseMessage.setResponseMessage("Device not found for the update.");
}
return responseMessage;
diff --git a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Enrollment.java b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Enrollment.java
index 5a53cfd61..a5fb3b8de 100644
--- a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Enrollment.java
+++ b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Enrollment.java
@@ -18,17 +18,16 @@
package org.wso2.cdmserver.mobileservices.android;
-import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
-import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
-import org.wso2.cdmserver.mobileservices.android.util.Message;
-import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManagementServiceException;
-import org.wso2.carbon.device.mgt.core.service.DeviceManagementService;
+import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
+import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
+import org.wso2.cdmserver.mobileservices.android.util.Message;
+
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
@@ -50,7 +49,7 @@ public class Enrollment {
try {
device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
AndroidAPIUtils.getDeviceManagementService().enrollDevice(device);
- Response.status(HttpStatus.SC_CREATED);
+ Response.status(Response.Status.CREATED);
responseMsg.setResponseMessage("Device enrollment succeeded");
return responseMsg;
} catch (DeviceManagementServiceException deviceServiceMgtEx) {
@@ -71,13 +70,13 @@ public class Enrollment {
boolean result;
Message responseMsg = new Message();
DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id);
+
try {
result = AndroidAPIUtils.getDeviceManagementService().isEnrolled(deviceIdentifier);
if (result) {
- Response.status(HttpStatus.SC_OK);
responseMsg.setResponseMessage("Device has already enrolled");
} else {
- Response.status(HttpStatus.SC_NOT_FOUND);
+ Response.status(Response.Status.NOT_FOUND);
responseMsg.setResponseMessage("Device not found");
}
return responseMsg;
@@ -99,16 +98,15 @@ public class Enrollment {
boolean result;
Message responseMsg = new Message();
-
try {
device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
result = AndroidAPIUtils.getDeviceManagementService().modifyEnrollment(device);
if (result) {
responseMsg.setResponseMessage("Device enrollment has updated successfully");
- Response.status(HttpStatus.SC_ACCEPTED);
+ Response.status(Response.Status.ACCEPTED);
} else {
responseMsg.setResponseMessage("Device not found for enrollment");
- Response.status(HttpStatus.SC_NOT_MODIFIED);
+ Response.status(Response.Status.NOT_MODIFIED);
}
return responseMsg;
} catch (DeviceManagementServiceException deviceServiceMgtEx) {
@@ -120,15 +118,13 @@ public class Enrollment {
log.error(errorMsg, deviceMgtEx);
throw new AndroidAgentException(errorMsg, deviceMgtEx);
}
- }
+ }
@DELETE
@Path("{id}")
public Message disEnrollDevice(@PathParam("id") String id) throws AndroidAgentException {
- DeviceManagementService dmService;
Message responseMsg = new Message();
-
boolean result;
DeviceIdentifier deviceIdentifier = AndroidAPIUtils.convertToDeviceIdentifierObject(id);
@@ -136,10 +132,9 @@ public class Enrollment {
result = AndroidAPIUtils.getDeviceManagementService().disenrollDevice(deviceIdentifier);
if (result) {
responseMsg.setResponseMessage("Device has removed successfully");
- Response.status(HttpStatus.SC_OK);
} else {
responseMsg.setResponseMessage("Device not found");
- Response.status(HttpStatus.SC_NOT_FOUND);
+ Response.status(Response.Status.NOT_FOUND);
}
return responseMsg;
} catch (DeviceManagementServiceException deviceServiceMgtEx) {
diff --git a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Operation.java b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Operation.java
index fdbef5eae..c4d59291c 100644
--- a/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Operation.java
+++ b/product/modules/mobileservices/agents/android/jax-rs/src/main/java/org/wso2/cdmserver/mobileservices/android/Operation.java
@@ -5,7 +5,7 @@
* 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
+ * 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,
@@ -24,7 +24,6 @@ import org.wso2.carbon.device.mgt.core.service.DeviceManagementService;
import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
import org.wso2.cdmserver.mobileservices.android.util.Message;
-
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.List;
@@ -60,17 +59,14 @@ public class Operation {
operations = dmService.getOperationManager(
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID)
.getOperations(deviceIdentifier);
- Response.status(HttpStatus.SC_OK);
return operations;
} catch (DeviceManagementException e) {
msg = "Error occurred while fetching the operation manager for the device type.";
log.error(msg, e);
- Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR);
throw new AndroidAgentException(msg, e);
} catch (OperationManagementException e) {
msg = "Error occurred while fetching the operation list for the device.";
log.error(msg, e);
- Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR);
throw new AndroidAgentException(msg, e);
}
}
@@ -84,7 +80,6 @@ public class Operation {
try {
dmService = AndroidAPIUtils.getDeviceManagementService();
-
} catch (DeviceManagementServiceException deviceMgtServiceEx) {
msg = "Device management service error";
log.error(msg, deviceMgtServiceEx);
@@ -94,22 +89,19 @@ public class Operation {
try {
boolean result = dmService.getOperationManager("").addOperation(null, null);
if (result) {
- Response.status(HttpStatus.SC_OK);
responseMsg.setResponseMessage("Device has already enrolled");
} else {
- Response.status(HttpStatus.SC_NOT_FOUND);
+ Response.status(Response.Status.NOT_FOUND);
responseMsg.setResponseMessage("Operation not found");
}
return responseMsg;
} catch (DeviceManagementException e) {
msg = "Error occurred while fetching the operation manager for the device type.";
log.error(msg, e);
- Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR);
throw new AndroidAgentException(msg, e);
} catch (OperationManagementException e) {
msg = "Error occurred while updating the operation status for the device.";
log.error(msg, e);
- Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR);
throw new AndroidAgentException(msg, e);
}
}
diff --git a/product/modules/mobileservices/agents/windows/jax-rs/pom.xml b/product/modules/mobileservices/agents/windows/jax-rs/pom.xml
index ec7b11099..e0c51bde9 100644
--- a/product/modules/mobileservices/agents/windows/jax-rs/pom.xml
+++ b/product/modules/mobileservices/agents/windows/jax-rs/pom.xml
@@ -20,7 +20,7 @@
org.wso2.cdmserver
- wso2cdmserver-product
+ wso2cdmserver-product-mobileservices
2.0.0-SNAPSHOT
../../../pom.xml
@@ -113,23 +113,19 @@
org.apache.cxf
cxf-rt-frontend-jaxws
- ${cxf.version}
org.apache.cxf
cxf-rt-frontend-jaxrs
- ${cxf.version}
org.apache.cxf
cxf-rt-transports-http
- ${cxf.version}
junit
junit
test
- ${junit.version}
commons-httpclient
diff --git a/product/modules/mobileservices/pom.xml b/product/modules/mobileservices/pom.xml
index 140e86014..8f10c5562 100644
--- a/product/modules/mobileservices/pom.xml
+++ b/product/modules/mobileservices/pom.xml
@@ -17,4 +17,46 @@
agents/windows/jax-rs
agents/android/jax-rs
+
+
+
+ org.apache.cxf
+ cxf-rt-frontend-jaxws
+ ${cxf.version}
+
+
+ org.apache.cxf
+ cxf-rt-frontend-jaxrs
+ ${cxf.version}
+
+
+ org.apache.cxf
+ cxf-rt-transports-http
+ ${cxf.version}
+
+
+ junit
+ junit
+ test
+ ${junit.version}
+
+
+ org.codehaus.jackson
+ jackson-jaxrs
+ ${jackson.version}
+
+
+ javax.ws.rs
+ jsr311-api
+ ${javax.ws.rs.version}
+ provided
+
+
+
+
+ 2.6.1
+ 4.8.2
+ 1.9.0
+ 1.1.1
+
\ No newline at end of file
diff --git a/product/pom.xml b/product/pom.xml
index 6df2ce31d..c44986509 100644
--- a/product/pom.xml
+++ b/product/pom.xml
@@ -35,5 +35,9 @@
modules/mobileservices
+ modules/rest-api
+ modules/p2-profile-gen
+ modules/distribution
+ modules/integration