Refactor add new mobile service module to as parent to agent module

4.x.x
manoj 10 years ago
parent 6703f590f3
commit 50a17eb33d

@ -23,29 +23,17 @@ import java.util.List;
public class Device { public class Device {
private int id; private int id;
private String type; private String type;
private String description; private String description;
private String name; private String name;
private Long dateOfEnrolment; private Long dateOfEnrolment;
private Long dateOfLastUpdate; private Long dateOfLastUpdate;
private String ownership; private String ownership;
private boolean status; private boolean status;
private int deviceTypeId; private int deviceTypeId;
private String deviceIdentifier; private String deviceIdentifier;
private String owner; private String owner;
private List<Feature> features; private List<Feature> features;
private List<Device.Property> properties; private List<Device.Property> properties;
@XmlElement @XmlElement
@ -56,6 +44,7 @@ public class Device {
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
@XmlElement @XmlElement
public String getDescription() { public String getDescription() {
return description; return description;
@ -64,6 +53,7 @@ public class Device {
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
@XmlElement @XmlElement
public String getName() { public String getName() {
return name; return name;
@ -72,6 +62,7 @@ public class Device {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@XmlElement @XmlElement
public Long getDateOfEnrolment() { public Long getDateOfEnrolment() {
return dateOfEnrolment; return dateOfEnrolment;
@ -80,6 +71,7 @@ public class Device {
public void setDateOfEnrolment(Long dateOfEnrolment) { public void setDateOfEnrolment(Long dateOfEnrolment) {
this.dateOfEnrolment = dateOfEnrolment; this.dateOfEnrolment = dateOfEnrolment;
} }
@XmlElement @XmlElement
public Long getDateOfLastUpdate() { public Long getDateOfLastUpdate() {
return dateOfLastUpdate; return dateOfLastUpdate;
@ -88,6 +80,7 @@ public class Device {
public void setDateOfLastUpdate(Long dateOfLastUpdate) { public void setDateOfLastUpdate(Long dateOfLastUpdate) {
this.dateOfLastUpdate = dateOfLastUpdate; this.dateOfLastUpdate = dateOfLastUpdate;
} }
@XmlElement @XmlElement
public String getOwnership() { public String getOwnership() {
return ownership; return ownership;
@ -96,6 +89,7 @@ public class Device {
public void setOwnership(String ownership) { public void setOwnership(String ownership) {
this.ownership = ownership; this.ownership = ownership;
} }
@XmlElement @XmlElement
public boolean isStatus() { public boolean isStatus() {
return status; return status;
@ -104,6 +98,7 @@ public class Device {
public void setStatus(boolean status) { public void setStatus(boolean status) {
this.status = status; this.status = status;
} }
@XmlElement @XmlElement
public int getDeviceTypeId() { public int getDeviceTypeId() {
return deviceTypeId; return deviceTypeId;
@ -112,6 +107,7 @@ public class Device {
public void setDeviceTypeId(int deviceTypeId) { public void setDeviceTypeId(int deviceTypeId) {
this.deviceTypeId = deviceTypeId; this.deviceTypeId = deviceTypeId;
} }
@XmlElement @XmlElement
public String getDeviceIdentifier() { public String getDeviceIdentifier() {
return deviceIdentifier; return deviceIdentifier;
@ -120,6 +116,7 @@ public class Device {
public void setDeviceIdentifier(String deviceIdentifier) { public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier; this.deviceIdentifier = deviceIdentifier;
} }
@XmlElement @XmlElement
public String getOwner() { public String getOwner() {
return owner; return owner;
@ -128,6 +125,7 @@ public class Device {
public void setOwner(String owner) { public void setOwner(String owner) {
this.owner = owner; this.owner = owner;
} }
@XmlElement @XmlElement
public List<Feature> getFeatures() { public List<Feature> getFeatures() {
return features; return features;
@ -136,6 +134,7 @@ public class Device {
public void setFeatures(List<Feature> features) { public void setFeatures(List<Feature> features) {
this.features = features; this.features = features;
} }
@XmlElement @XmlElement
public String getType() { public String getType() {
return type; return type;
@ -144,6 +143,7 @@ public class Device {
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
@XmlElement @XmlElement
public List<Device.Property> getProperties() { public List<Device.Property> getProperties() {
return properties; return properties;

@ -43,6 +43,11 @@ public class DeviceManagementRepository {
} }
} }
public void removeDeviceManagementProvider(DeviceManagerService provider) {
String deviceType = provider.getProviderType();
providers.remove(deviceType);
}
public DeviceManagerService getDeviceManagementProvider(String type) { public DeviceManagerService getDeviceManagementProvider(String type) {
return providers.get(type); return providers.get(type);
} }

@ -75,11 +75,8 @@ public class DeviceManagementServiceComponent {
} }
setupDeviceManagementSchema(dsConfig); setupDeviceManagementSchema(dsConfig);
} }
BundleContext bundleContext = componentContext.getBundleContext(); BundleContext bundleContext = componentContext.getBundleContext();
bundleContext.registerService(DeviceManagementService.class.getName(), bundleContext.registerService(DeviceManagementService.class.getName(), new DeviceManagementService(), null);
new DeviceManagementService(), null);
} catch (Throwable e) { } catch (Throwable e) {
String msg = "Error occurred while initializing device management core bundle"; String msg = "Error occurred while initializing device management core bundle";
log.error(msg, e); log.error(msg, e);
@ -118,6 +115,7 @@ public class DeviceManagementServiceComponent {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Unsetting Device Management Service"); log.debug("Unsetting Device Management Service");
} }
this.getPluginRepository().removeDeviceManagementProvider(deviceManager);
} }
/** /**

@ -22,15 +22,14 @@
<parent> <parent>
<groupId>org.wso2.cdmserver</groupId> <groupId>org.wso2.cdmserver</groupId>
<artifactId>wso2cdmserver-product</artifactId> <artifactId>wso2cdmserver-product-mobileservices</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath> <relativePath>../../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>cdm-android-api</artifactId> <artifactId>cdm-android-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>JAX-RS Android API</name> <name>JAX-RS Android API</name>
<description>JAX-RS Android API</description> <description>JAX-RS Android API</description>
<packaging>war</packaging> <packaging>war</packaging>

@ -18,9 +18,9 @@
//org.wso2.carbon.... //org.wso2.carbon....
package org.wso2.cdmserver.mobileservices.android; package org.wso2.cdmserver.mobileservices.android;
import cdm.api.android.common.AndroidAgentException; import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
import cdm.api.android.util.AndroidAPIUtils; import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
import cdm.api.android.util.Message; import org.wso2.cdmserver.mobileservices.android.util.Message;
import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

@ -18,9 +18,9 @@
package org.wso2.cdmserver.mobileservices.android; package org.wso2.cdmserver.mobileservices.android;
import cdm.api.android.common.AndroidAgentException; import org.wso2.cdmserver.mobileservices.android.common.AndroidAgentException;
import cdm.api.android.util.AndroidAPIUtils; import org.wso2.cdmserver.mobileservices.android.util.AndroidAPIUtils;
import cdm.api.android.util.Message; import org.wso2.cdmserver.mobileservices.android.util.Message;
import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

@ -51,9 +51,9 @@
</jaxrs:providers> </jaxrs:providers>
</jaxrs:server> </jaxrs:server>
<bean id="deviceMgtServiceBean" class="cdm.api.android.Device"/> <bean id="deviceMgtServiceBean" class="org.wso2.cdmserver.mobileservices.android.Device"/>
<bean id="enrollmentServiceBean" class="cdm.api.android.Enrollment"/> <bean id="enrollmentServiceBean" class="org.wso2.cdmserver.mobileservices.android.Enrollment"/>
<bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/> <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
<bean id="errorHandler" class="cdm.api.android.common.ErrorHandler"/> <bean id="errorHandler" class="org.wso2.cdmserver.mobileservices.android.common.ErrorHandler"/>
</beans> </beans>

@ -22,13 +22,12 @@
<groupId>org.wso2.cdmserver</groupId> <groupId>org.wso2.cdmserver</groupId>
<artifactId>wso2cdmserver-product</artifactId> <artifactId>wso2cdmserver-product</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath> <relativePath>../../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>
<artifactId>cdm-windows-api</artifactId> <artifactId>cdm-windows-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>JAX-RS Windows API</name> <name>JAX-RS Windows API</name>
<description>JAX-RS Windows API</description> <description>JAX-RS Windows API</description>
<packaging>war</packaging> <packaging>war</packaging>

@ -34,11 +34,6 @@
<name>WSO2 Connected Device Manager (CDM) - Parent</name> <name>WSO2 Connected Device Manager (CDM) - Parent</name>
<modules> <modules>
<!--<module>modules/agents/android/jax-rs</module>--> <module>modules/mobileservices</module>
<module>modules/agents/windows/jax-rs</module>
<module>modules/agents/android/jax-rs</module>
<module>modules/p2-profile-gen</module>
<module>modules/distribution</module>
<module>modules/integration</module>
</modules> </modules>
</project> </project>

Loading…
Cancel
Save