refactored device type implemenation

merge-requests/1/head
ayyoob 9 years ago
parent 2778e1c1ef
commit 3488d9d79d

@ -10,7 +10,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.service.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - Android Sense API</name>
<description>WSO2 Carbon - Android Sense Service-API Implementation</description>

@ -56,18 +56,10 @@
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.xml.bind.*;resolution:=optional,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers;resolution:=optional,
javax.net;resolution:=optional,
javax.net.ssl;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.context.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*

@ -30,6 +30,8 @@ import java.util.List;
public class AndroidSenseManagerService implements DeviceManagementService {
private DeviceManager deviceManager;
private static final String SUPER_TENANT_DOMAIN = "carbon.super";
@Override
public String getType() {
return AndroidSenseConstants.DEVICE_TYPE;
@ -37,7 +39,7 @@ public class AndroidSenseManagerService implements DeviceManagementService {
@Override
public String getProviderTenantDomain() {
return "carbon.super";
return SUPER_TENANT_DOMAIN;
}
@Override

@ -34,7 +34,7 @@
<modules>
<module>org.wso2.carbon.device.mgt.iot.androidsense.analytics</module>
<module>org.wso2.carbon.device.mgt.iot.androidsense.service.impl</module>
<module>org.wso2.carbon.device.mgt.iot.androidsense.api</module>
<module>org.wso2.carbon.device.mgt.iot.androidsense.plugin</module>
<module>org.wso2.carbon.device.mgt.iot.androidsense.ui</module>
</modules>

@ -28,7 +28,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.service.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - IoT Server Arduino Service API</name>
<description>WSO2 Carbon - Arduino Service API Implementation</description>
@ -54,7 +54,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.jwt.client.extension</artifactId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@ -132,7 +132,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.plugin.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.plugin</artifactId>
<scope>provided</scope>
</dependency>

@ -33,10 +33,10 @@ import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants;
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.device.mgt.iot.util.ZipUtil;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClient;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.device.mgt.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.ws.rs.core.Response;
import java.nio.ByteBuffer;

@ -28,7 +28,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.plugin.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.arduino.plugin</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - IoT Server Arduino Management Plugin</name>
<description>WSO2 Carbon - Arduino Management/Control Plugin Implementation</description>
@ -64,18 +64,10 @@
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.xml.bind.*;resolution:=optional,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers;resolution:=optional,
javax.net;resolution:=optional,
javax.net.ssl;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.context.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*

@ -35,8 +35,8 @@
<modules>
<module>org.wso2.carbon.device.mgt.iot.arduino.analytics</module>
<module>org.wso2.carbon.device.mgt.iot.arduino.service.impl</module>
<module>org.wso2.carbon.device.mgt.iot.arduino.plugin.impl</module>
<module>org.wso2.carbon.device.mgt.iot.arduino.api</module>
<module>org.wso2.carbon.device.mgt.iot.arduino.plugin</module>
<module>org.wso2.carbon.device.mgt.iot.arduino.ui</module>
</modules>

@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.digitaldisplay.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - IoT Server DigitalDisplay API</name>
<description>WSO2 Carbon - Digital Display Service API Implementation</description>
@ -224,7 +224,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.jwt.client.extension</artifactId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
<scope>provided</scope>
</dependency>
<dependency>

@ -34,10 +34,10 @@ import org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin.constants.DigitalDis
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.device.mgt.iot.util.ZipUtil;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClient;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.device.mgt.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.ws.rs.core.Response;

@ -47,18 +47,10 @@
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.xml.bind.*;resolution:=optional,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers;resolution:=optional,
javax.net,
javax.net.ssl,
org.w3c.dom,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.context.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*

@ -33,7 +33,7 @@
<url>http://wso2.org</url>
<modules>
<module>org.wso2.carbon.device.mgt.iot.digitaldisplay.service.impl</module>
<module>org.wso2.carbon.device.mgt.iot.digitaldisplay.api</module>
<module>org.wso2.carbon.device.mgt.iot.digitaldisplay.plugin</module>
<module>org.wso2.carbon.device.mgt.iot.digitaldisplay.ui</module>
</modules>

@ -7,7 +7,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.droneanalyzer.service.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.droneanalyzer.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - IoT Server Drone Analyzer API</name>
<url>http://maven.apache.org</url>
@ -229,7 +229,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.jwt.client.extension</artifactId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
<scope>provided</scope>
</dependency>
<dependency>

@ -35,10 +35,10 @@ import org.wso2.carbon.device.mgt.iot.droneanalyzer.plugin.constants.DroneConsta
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.device.mgt.iot.util.ZipUtil;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClient;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.device.mgt.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.ws.rs.core.Response;
import java.nio.ByteBuffer;

@ -49,18 +49,10 @@
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.xml.bind.*;resolution:=optional,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers;resolution:=optional,
javax.net;resolution:=optional,
javax.net.ssl;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.context.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*

@ -34,7 +34,7 @@
<modules>
<module>org.wso2.carbon.device.mgt.iot.droneanalyzer.ui</module>
<module>org.wso2.carbon.device.mgt.iot.droneanalyzer.service.impl</module>
<module>org.wso2.carbon.device.mgt.iot.droneanalyzer.api</module>
<module>org.wso2.carbon.device.mgt.iot.droneanalyzer.plugin</module>
</modules>

@ -83,7 +83,6 @@
org.wso2.carbon.utils.*;version="${carbon.kernel.version.range}",
org.wso2.carbon.device.mgt.common.*,
org.eclipse.paho.client.mqttv3.*;version="${eclipse.paho.version}",
javax.ws.rs.core,
javax.xml;resolution:=optional,
javax.net.ssl;resolution:=optional
</Import-Package>

@ -35,7 +35,7 @@ import org.json.JSONObject;
import org.wso2.carbon.device.mgt.iot.exception.DeviceControllerException;
import org.wso2.carbon.device.mgt.iot.util.IoTUtil;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
@ -53,6 +53,7 @@ public class XmppServerClient {
@SuppressWarnings("unused")
private static final String APPLICATION_JSON_MT = "application/json";
private static final String DEVICEMGT_CONFIG_FILE = "devicemgt-config.xml";
private static final String APPLICATION_JSON = "application/json";
private String xmppEndpoint;
private String xmppUsername;
private String xmppPassword;
@ -99,7 +100,7 @@ public class XmppServerClient {
StringEntity requestEntity;
try {
requestEntity = new StringEntity(jsonRequest, MediaType.APPLICATION_JSON,
requestEntity = new StringEntity(jsonRequest, APPLICATION_JSON,
StandardCharsets.UTF_8.toString());
} catch (UnsupportedEncodingException e) {
return false;
@ -249,7 +250,7 @@ public class XmppServerClient {
HttpGet httpGet = new HttpGet(xmppSessionsAPIEndpoint);
httpGet.addHeader(HttpHeaders.AUTHORIZATION, authorizationHeader);
httpGet.addHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
httpGet.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON);
try {
HttpResponse httpResponse = httpClient.execute(httpGet);

@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - IoT Server RaspberryPi API</name>
<description>WSO2 Carbon - RaspberryPi Service API Implementation</description>
@ -92,7 +92,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.plugin</artifactId>
<scope>provided</scope>
</dependency>
@ -133,7 +133,7 @@
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.jwt.client.extension</artifactId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
<scope>provided</scope>
</dependency>
<dependency>

@ -37,10 +37,10 @@ import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.constants.RaspberrypiCo
import org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl.util.APIUtil;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.device.mgt.iot.util.ZipUtil;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClient;
import org.wso2.carbon.device.mgt.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.device.mgt.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.device.mgt.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.JWTClientManager;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.ws.rs.core.Response;

@ -29,7 +29,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl</artifactId>
<artifactId>org.wso2.carbon.device.mgt.iot.raspberrypi.plugin</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - IoT Server RaspberryPi Management Plugin</name>
<description>WSO2 Carbon - RaspberryPi Management/Control Plugin Implementation</description>
@ -65,18 +65,10 @@
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.xml.bind.*,
javax.naming;resolution:=optional,,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers;resolution:=optional,
javax.net;resolution:=optional,
javax.net.ssl;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.context.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save