GDLMadushanka 8 years ago
commit 4ebb5e3a28

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -3,7 +3,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>androidsense-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>arduino-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>raspberrypi-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -29,6 +29,7 @@ import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.transport.
import java.io.*;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.security.PrivateKey;
import java.security.PublicKey;
@ -67,15 +68,14 @@ public class AgentUtilOperations {
try {
ClassLoader loader = AgentUtilOperations.class.getClassLoader();
URL path = loader.getResource(propertiesFileName);
System.out.println(path);
String root = path.getPath().replace(
"wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig.properties",
"").replace("jar:", "").replace("file:", "");
agentManager.setRootPath(root);
propertiesInputStream = new FileInputStream(
root + AgentConstants.AGENT_PROPERTIES_FILE_NAME);
log.info(AgentConstants.LOG_APPENDER + path);
String rootPath = path.getPath().replace("wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig"
+ ".properties", "").replace("jar:", "").replace("file:", "");
rootPath = URLDecoder.decode(rootPath, StandardCharsets.UTF_8.toString());
agentManager.setRootPath(rootPath);
String deviceConfigFilePath = rootPath + AgentConstants.AGENT_PROPERTIES_FILE_NAME;
propertiesInputStream = new FileInputStream(deviceConfigFilePath);
//load a properties file from class path, inside static method
properties.load(propertiesInputStream);

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>virtual-fire-alarm-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>appm-connector</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mb-extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>siddhi-extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>android-plugin</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.ui</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Android UI</name>
<packaging>pom</packaging>

@ -22,7 +22,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -265,6 +265,11 @@
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId>

@ -19,6 +19,7 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.common.util;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.auth.AUTH;
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.BinarySecurity;
@ -32,6 +33,9 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.AuthenticationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.OAuthTokenValidationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import java.util.HashMap;
@ -94,13 +98,18 @@ public class BSTValidator implements Validator {
private boolean authenticate(String binarySecurityToken, AuthenticationInfo authenticationInfo) throws
AuthenticationException {
WindowsAPIUtils.startTenantFlow(authenticationInfo);
if (DeviceUtil.getCacheEntry(binarySecurityToken) != null) {
CacheEntry cacheentry = (CacheEntry) DeviceUtil.getCacheEntry(binarySecurityToken);
String username = cacheentry.getUsername();
MobileCacheEntry cacheEntry;
try {
cacheEntry = DeviceUtil.getTokenEntry(binarySecurityToken);
if (cacheEntry != null) {
String username = cacheEntry.getUsername();
return username != null;
} else {
return false;
}
} catch (WindowsDeviceEnrolmentException e) {
throw new AuthenticationException("Authentication failure when fetching token entry", e);
}
}
/**

@ -18,14 +18,17 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.common.util;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsUtils;
import javax.cache.Cache;
import javax.cache.CacheConfiguration;
import javax.cache.CacheManager;
import javax.cache.Caching;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* Class for generate random token for XCEP and WSTEP.
@ -36,45 +39,106 @@ public class DeviceUtil {
private static final String TOKEN_CACHE = "TOKEN_CACHE";
private static final long CACHE_DURATION = 15l;
private static boolean isContextCacheInitialized = false;
private static WindowsTokenService tokenService;
private static final Log log = LogFactory.getLog(DeviceUtil.class);
static {
try {
tokenService = WindowsUtils.getEnrollmentTokenService();
} catch (WindowsDeviceMgtPluginException e) {
log.error("WindowsTokenService cannot be initialized.", e);
}
}
public static String generateRandomToken() {
return String.valueOf(UUID.randomUUID());
}
public static void persistChallengeToken(String token, String deviceID, String username) {
Object objCacheEntry = getCacheEntry(token);
CacheEntry cacheEntry;
if (objCacheEntry == null) {
cacheEntry = new CacheEntry();
cacheEntry.setUsername(username);
public static void persistChallengeToken(String token, String deviceID, String username)
throws WindowsDeviceEnrolmentException {
try {
if(tokenService == null) {
tokenService = WindowsUtils.getEnrollmentTokenService();
}
MobileCacheEntry existingCacheEntry = tokenService.getCacheToken(token);
PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
if (existingCacheEntry == null) {
MobileCacheEntry newCacheEntry = new MobileCacheEntry();
newCacheEntry.setDeviceID(deviceID);
newCacheEntry.setUsername(username);
newCacheEntry.setCacheToken(token);
newCacheEntry.setTenantDomain(carbonCtx.getTenantDomain());
newCacheEntry.setTenanatID(carbonCtx.getTenantId());
tokenService.saveCacheToken(newCacheEntry);
} else {
cacheEntry = (CacheEntry) objCacheEntry;
existingCacheEntry.setDeviceID(deviceID);
existingCacheEntry.setCacheToken(token);
tokenService.updateCacheToken(existingCacheEntry);
}
if (deviceID != null) {
cacheEntry.setDeviceID(deviceID);
} catch (MobileDeviceManagementDAOException e) {
String msg = "Error occured when saving cache token for device: " + deviceID;
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
} catch (WindowsDeviceMgtPluginException e) {
String msg = "Error occured when retrieving enrollment token service";
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
}
getTokenCache().put(token.trim(), cacheEntry);
}
public static void removeToken(String token) {
getTokenCache().remove(token);
public static MobileCacheEntry getTokenEntry(String token)
throws WindowsDeviceEnrolmentException {
MobileCacheEntry tokenEntry;
try {
if (tokenService == null) {
tokenService = WindowsUtils.getEnrollmentTokenService();
}
tokenEntry = tokenService.getCacheToken(token);
} catch (WindowsDeviceMgtPluginException e) {
String msg = "Error occured when retrieving enrollment token service.";
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
} catch (MobileDeviceManagementDAOException e) {
String msg = "Error occured when retrieving enrollment token.";
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
}
return tokenEntry;
}
public static Object getCacheEntry(String token) {
return getTokenCache().get(token);
public static MobileCacheEntry getTokenEntryFromDeviceId(String deviceId)
throws WindowsDeviceEnrolmentException {
MobileCacheEntry tokenEntry;
try {
if (tokenService == null) {
tokenService = WindowsUtils.getEnrollmentTokenService();
}
tokenEntry = tokenService.getCacheTokenFromDeviceId(deviceId);
} catch (WindowsDeviceMgtPluginException e) {
String msg = "Error occured when retrieving enrollment token service.";
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
} catch (MobileDeviceManagementDAOException e) {
String msg = "Error occured when retrieving enrollment token.";
log.error(msg);
throw new WindowsDeviceEnrolmentException(msg, e);
}
return tokenEntry;
}
private static Cache getTokenCache() {
CacheManager contextCacheManager = Caching.getCacheManager(TOKEN_CACHE_MANAGER).
getCache(TOKEN_CACHE).getCacheManager();
if (!isContextCacheInitialized) {
return Caching.getCacheManager(TOKEN_CACHE_MANAGER).getCache(TOKEN_CACHE);
} else {
isContextCacheInitialized = true;
return contextCacheManager.createCacheBuilder(TOKEN_CACHE_MANAGER).setExpiry(
CacheConfiguration.ExpiryType.MODIFIED,
new CacheConfiguration.Duration(TimeUnit.MINUTES, CACHE_DURATION)).setStoreByValue(false).build();
public static void removeTokenEntry(String token) {
try {
if (tokenService == null) {
tokenService = WindowsUtils.getEnrollmentTokenService();
}
tokenService.removeCacheToken(token);
} catch (WindowsDeviceMgtPluginException e) {
String msg = "Error occured when retrieving enrollment token service.";
log.error(msg);
} catch (MobileDeviceManagementDAOException e) {
String msg = "Error occured when removing enrollment token.";
log.error(msg);
}
}
}

@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONException;
import org.json.JSONObject;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;

@ -44,6 +44,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlCrede
import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.EnrollmentService;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.beans.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.xml.sax.SAXException;
@ -296,7 +297,7 @@ public class EnrollmentServiceImpl implements EnrollmentService {
//CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst);
// String userName = cacheEntry.getUsername();
authNameNode.setTextContent(userName);
DeviceUtil.removeToken(headerBst);
DeviceUtil.removeTokenEntry(headerBst);
String password = DeviceUtil.generateRandomToken();
Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION);
NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes();
@ -351,7 +352,12 @@ public class EnrollmentServiceImpl implements EnrollmentService {
* @return User for given token.
*/
private String getRequestedUser(String bst) {
CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(bst);
MobileCacheEntry cacheEntry = null;
try {
cacheEntry = DeviceUtil.getTokenEntry(bst);
} catch (WindowsDeviceEnrolmentException e) {
}
return cacheEntry.getUsername();
}

@ -43,6 +43,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.DeviceManagementService;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
@ -80,14 +81,18 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlHeader.getSource().
getLocURI());
msgId = syncmlHeader.getMsgID();
if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) &&
(PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) {
token = syncmlHeader.getCredential().getData();
CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token);
MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token);
DeviceUtil.persistChallengeToken(token, deviceIdentifier.getId(), user);
PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
carbonCtx.setTenantId(cacheToken.getTenanatID(), true);
if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) {
if (modifyEnrollWithMoreDetail(request)) {
if (modifyEnrollWithMoreDetail(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) {
pendingOperations = operationHandler.getPendingOperations(syncmlDocument);
response = operationReply.generateReply(syncmlDocument, pendingOperations);
return Response.status(Response.Status.OK).entity(response).build();
@ -102,6 +107,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
return Response.status(Response.Status.UNAUTHORIZED).entity(msg).build();
}
} else {
MobileCacheEntry cacheToken = DeviceUtil.getTokenEntryFromDeviceId(deviceIdentifier.getId());
PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
carbonCtx.setTenantId(cacheToken.getTenanatID());
if ((syncmlDocument.getBody().getAlert() != null)) {
if (!syncmlDocument.getBody().getAlert().getData().equals(Constants.DISENROLL_ALERT_DATA)) {
pendingOperations = operationHandler.getPendingOperations(syncmlDocument);
@ -152,7 +160,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
* @throws WindowsDeviceEnrolmentException
* @throws WindowsOperationException
*/
private boolean modifyEnrollWithMoreDetail(Document request) throws WindowsDeviceEnrolmentException,
private boolean modifyEnrollWithMoreDetail(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException,
WindowsOperationException {
String devMan = null;
@ -177,6 +185,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
user = syncmlDocument.getHeader().getSource().getLocName();
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
authenticationInfo.setUsername(user);
authenticationInfo.setTenantId(tenantId);
authenticationInfo.setTenantDomain(tenantDomain);
WindowsAPIUtils.startTenantFlow(authenticationInfo);
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlDocument.
getHeader().getSource().getLocURI());

@ -22,12 +22,15 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.Device;
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.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlOperationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException;
@ -35,10 +38,20 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDe
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.AuthenticationInfo;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.DeviceUtil;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.WindowsAPIUtils;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ItemTag;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ReplaceTag;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlDocument;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlHeader;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.WindowsOperationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.Constants;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationHandler;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationReply;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlGenerator;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlParser;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.SyncmlService;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
@ -143,11 +156,11 @@ public class SyncmlServiceImpl implements SyncmlService {
if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) &&
(PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) {
token = syncmlHeader.getCredential().getData();
CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token);
MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token);
if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) {
if (enrollDevice(request)) {
if (enrollDevice(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) {
deviceInfoOperations = deviceInfo.getDeviceInfo();
response = generateReply(syncmlDocument, deviceInfoOperations);
return Response.status(Response.Status.OK).entity(response).build();
@ -163,7 +176,8 @@ public class SyncmlServiceImpl implements SyncmlService {
}
} else if (PluginConstants.SyncML.SYNCML_SECOND_MESSAGE_ID == msgId &&
PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId) {
if (enrollDevice(request)) {
PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
if (enrollDevice(request, carbonCtx.getTenantDomain(), carbonCtx.getTenantId())) {
return Response.ok().entity(generateReply(syncmlDocument, null)).build();
} else {
String msg = "Error occurred in modify enrollment.";
@ -223,7 +237,7 @@ public class SyncmlServiceImpl implements SyncmlService {
* @throws WindowsDeviceEnrolmentException
* @throws WindowsOperationException
*/
private boolean enrollDevice(Document request) throws WindowsDeviceEnrolmentException,
private boolean enrollDevice(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException,
WindowsOperationException {
String osVersion;
@ -256,6 +270,8 @@ public class SyncmlServiceImpl implements SyncmlService {
user = syncmlDocument.getHeader().getSource().getLocName();
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
authenticationInfo.setUsername(user);
authenticationInfo.setTenantDomain(tenantDomain);
authenticationInfo.setTenantId(tenantId);
WindowsAPIUtils.startTenantFlow(authenticationInfo);
if (log.isDebugEnabled()) {

@ -26,14 +26,17 @@ import org.apache.cxf.headers.Header;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.jaxws.context.WrappedMessageContext;
import org.apache.cxf.message.Message;
import org.w3c.dom.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.CertificateGenerationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WAPProvisioningException;
@ -46,6 +49,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.Additi
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.BinarySecurityToken;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestSecurityTokenResponse;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestedSecurityToken;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.xml.sax.SAXException;
import javax.annotation.Resource;
@ -293,10 +297,10 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe
Node userNameAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_USERNAME_POSITION);
NamedNodeMap appServerAttribute = userNameAuthPosition.getAttributes();
Node authNameNode = appServerAttribute.getNamedItem(PluginConstants.CertificateEnrolment.VALUE);
CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst);
MobileCacheEntry cacheEntry = DeviceUtil.getTokenEntry(headerBst);
String userName = cacheEntry.getUsername();
authNameNode.setTextContent(cacheEntry.getUsername());
DeviceUtil.removeToken(headerBst);
DeviceUtil.removeTokenEntry(headerBst);
String password = DeviceUtil.generateRandomToken();
Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION);
NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes();

@ -23,13 +23,13 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.ui</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Windows UI</name>
<packaging>pom</packaging>

@ -22,7 +22,7 @@
<parent>
<artifactId>windows-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -64,6 +64,7 @@
org.wso2.carbon.context,
org.wso2.carbon.utils.*,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.core.dao.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.policy.mgt.common.*,
org.wso2.carbon.registry.core,

@ -0,0 +1,29 @@
/*
* Copyright (c) 2017, 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.mobile.windows.impl;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
public interface WindowsTokenService {
void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException;
void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException;
MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException;
MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException;
void removeCacheToken(String token) throws MobileDeviceManagementDAOException;
}

@ -0,0 +1,81 @@
package org.wso2.carbon.device.mgt.mobile.windows.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsEnrollmentTokenDAOImpl;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
public class WindowsTokenServiceImpl implements WindowsTokenService {
private static final Log log = LogFactory.getLog(WindowsTokenServiceImpl.class);
private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO;
public WindowsTokenServiceImpl() {
WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory();
windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
}
@Override
public void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException {
try {
WindowsDAOFactory.beginTransaction();
windowsEnrollmentTokenDAO.addCacheToken(entry);
WindowsDAOFactory.commitTransaction();
} finally {
WindowsDAOFactory.closeConnection();
}
}
@Override
public void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException {
try {
WindowsDAOFactory.beginTransaction();
windowsEnrollmentTokenDAO.updateCacheToken(entry);
WindowsDAOFactory.commitTransaction();
} finally {
WindowsDAOFactory.closeConnection();
}
}
@Override
public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
MobileCacheEntry cacheEntry = null;
try {
WindowsDAOFactory.beginTransaction();
cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token);
WindowsDAOFactory.commitTransaction();
} finally {
WindowsDAOFactory.closeConnection();
}
return cacheEntry;
}
@Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId)
throws MobileDeviceManagementDAOException {
MobileCacheEntry cacheEntry = null;
try {
WindowsDAOFactory.beginTransaction();
cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId);
WindowsDAOFactory.commitTransaction();
} finally {
WindowsDAOFactory.closeConnection();
}
return cacheEntry;
}
@Override
public void removeCacheToken(String token) throws MobileDeviceManagementDAOException {
try {
WindowsDAOFactory.beginTransaction();
windowsEnrollmentTokenDAO.deleteCacheToken(token);
WindowsDAOFactory.commitTransaction();
} finally {
WindowsDAOFactory.closeConnection();
}
}
}

@ -21,9 +21,13 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsDeviceDAOImpl;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsFeatureDAOImpl;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
@ -35,7 +39,18 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory
private static ThreadLocal<Connection> currentConnection = new ThreadLocal<>();
public WindowsDAOFactory() {
this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
// this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
String dataSourceName = "jdbc/MobileWindowsDM_DS";
initDAO(dataSourceName);
}
public void initDAO(String datasourceName) {
try {
Context ctx = new InitialContext();
dataSource = (DataSource) ctx.lookup(datasourceName);
} catch (NamingException e) {
}
}
@Override

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017, 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.mobile.windows.impl.dao;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
public interface WindowsEnrollmentTokenDAO {
MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException;
MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException;
boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException;
boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException;
boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException;
}

@ -0,0 +1,177 @@
/*
* Copyright (c) 2017, 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.mobile.windows.impl.dao.impl;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.util.MobileDeviceManagementDAOUtil;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsPluginConstants;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class WindowsEnrollmentTokenDAOImpl implements WindowsEnrollmentTokenDAO {
public WindowsEnrollmentTokenDAOImpl() {
}
@Override
public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
MobileCacheEntry cacheEntry = null;
try {
conn = WindowsDAOFactory.getConnection();
String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " +
"FROM WINDOWS_ENROLLMENT_TOKEN WHERE ENROLLMENT_TOKEN = ?";
stmt = conn.prepareStatement(selectDBQuery);
stmt.setString(1, token);
rs = stmt.executeQuery();
while (rs.next()) {
cacheEntry = new MobileCacheEntry();
cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID));
cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN));
cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID));
cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME));
cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP));
}
} catch (SQLException e) {
throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" +
token + "' from the Windows db.", e);
}
return cacheEntry;
}
@Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId)
throws MobileDeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
MobileCacheEntry cacheEntry = null;
try {
conn = WindowsDAOFactory.getConnection();
String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " +
"FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?";
stmt = conn.prepareStatement(selectDBQuery);
stmt.setString(1, deviceId);
rs = stmt.executeQuery();
while (rs.next()) {
cacheEntry = new MobileCacheEntry();
cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID));
cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN));
cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID));
cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME));
cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP));
}
} catch (SQLException e) {
throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" +
deviceId + "' from the Windows db.", e);
}
return cacheEntry;
}
@Override
public boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException {
boolean status = false;
Connection conn;
PreparedStatement stmt = null;
try {
conn = WindowsDAOFactory.getConnection();
String sql = "INSERT INTO WINDOWS_ENROLLMENT_TOKEN(TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, "
+ "USERNAME, OWNERSHIP) VALUES (?, ?, ?, ?, ?, ?)";
stmt = conn.prepareStatement(sql);
stmt.setString(1, cacheEntry.getTenantDomain());
stmt.setInt(2, cacheEntry.getTenanatID());
stmt.setString(3, cacheEntry.getCacheToken());
stmt.setString(4, cacheEntry.getDeviceID());
stmt.setString(5, cacheEntry.getUsername());
stmt.setString(6, cacheEntry.getOwnership());
int rows = stmt.executeUpdate();
if(rows > 0) {
status = true;
}
} catch (SQLException e) {
throw new MobileDeviceManagementDAOException("Error occurred while adding the Windows device enrollment token for'" +
cacheEntry.getDeviceID() + "' to the Windows db.", e);
} finally {
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
}
return status;
}
@Override
public boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException {
boolean status = false;
Connection conn;
PreparedStatement stmt = null;
try {
conn = WindowsDAOFactory.getConnection();
String updateDBQuery =
"UPDATE WINDOWS_ENROLLMENT_TOKEN SET TENANT_DOMAIN = ?, TENANT_ID = ?, ENROLLMENT_TOKEN = ?, USERNAME = ?, " +
"DEVICE_ID = ? WHERE ENROLLMENT_TOKEN = ?";
stmt = conn.prepareStatement(updateDBQuery);
stmt.setString(1, cacheEntry.getTenantDomain());
stmt.setInt(2, cacheEntry.getTenanatID());
stmt.setString(3, cacheEntry.getCacheToken());
stmt.setString(4, cacheEntry.getUsername());
stmt.setString(5, cacheEntry.getDeviceID());
stmt.setString(6, cacheEntry.getCacheToken());
int rows = stmt.executeUpdate();
if(rows > 0) {
status = true;
}
} catch (SQLException e) {
throw new MobileDeviceManagementDAOException("Error occurred while updating the Windows device enrollment token for'" +
cacheEntry.getDeviceID() + "' to the Windows db.", e);
} finally {
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
}
return status;
}
@Override
public boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException {
boolean status = false;
Connection conn;
PreparedStatement stmt = null;
try {
conn = WindowsDAOFactory.getConnection();
String deleteDBQuery = "DELETE FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?";
stmt = conn.prepareStatement(deleteDBQuery);
stmt.setString(1, mobileDeviceId);
int rows = stmt.executeUpdate();
if (rows > 0) {
status = true;
}
} catch (SQLException e) {
throw new MobileDeviceManagementDAOException("Error occurred while deleting windows device '" +
mobileDeviceId + "'", e);
} finally {
MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
}
return status;
}
}

@ -0,0 +1,76 @@
/*
* Copyright (c) 2017, 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.mobile.windows.impl.dto;
public class MobileCacheEntry {
private String cacheToken;
private String tenantDomain;
private int tenanatID;
private String deviceID;
private String username;
private String ownership;
public String getTenantDomain() {
return tenantDomain;
}
public void setTenantDomain(String tenantDomain) {
this.tenantDomain = tenantDomain;
}
public int getTenanatID() {
return tenanatID;
}
public void setTenanatID(int tenanatID) {
this.tenanatID = tenanatID;
}
public String getCacheToken() {
return cacheToken;
}
public void setCacheToken(String cacheToken) {
this.cacheToken = cacheToken;
}
public String getDeviceID() {
return deviceID;
}
public void setDeviceID(String deviceID) {
this.deviceID = deviceID;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getOwnership() {
return ownership;
}
public void setOwnership(String ownership) {
this.ownership = ownership;
}
}

@ -52,5 +52,10 @@ public class WindowsPluginConstants {
public static final String LANGUAGE_CODE_ENGLISH_US = "en_US";
public static final String LANGUAGE_CODE_ENGLISH_UK = "en_UK";
//properties related to WINDOWS_ENROLLMENT_TOKEN table
public static final String TENANT_DOMAIN = "TENANT_DOMAIN";
public static final String TENANT_ID = "TENANT_ID";
public static final String USER_NAME = "USERNAME";
public static final String OWNERSHIP = "OWNERSHIP";
}

@ -18,6 +18,10 @@
package org.wso2.carbon.device.mgt.mobile.windows.impl.util;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
import java.util.Map;
/**
@ -32,4 +36,17 @@ public class WindowsUtils {
}
return deviceProperty;
}
public static WindowsTokenService getEnrollmentTokenService() throws WindowsDeviceMgtPluginException {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
WindowsTokenService tokenService = (WindowsTokenService)
ctx.getOSGiService(WindowsTokenService.class, null);
if(tokenService == null) {
String msg = "WindowsTokenService is not initialized";
throw new WindowsDeviceMgtPluginException(msg);
}
return tokenService;
}
}

@ -18,6 +18,7 @@
package org.wso2.carbon.device.mgt.mobile.windows.internal;
import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
import org.wso2.carbon.registry.core.service.RegistryService;
/**
@ -26,6 +27,7 @@ import org.wso2.carbon.registry.core.service.RegistryService;
public class WindowsDeviceManagementDataHolder {
private RegistryService registryService;
private WindowsTokenService tokenService;
private static WindowsDeviceManagementDataHolder thisInstance = new WindowsDeviceManagementDataHolder();
@ -44,4 +46,19 @@ public class WindowsDeviceManagementDataHolder {
this.registryService = registryService;
}
public WindowsTokenService getTokenService() {
return tokenService;
}
public void setTokenService(WindowsTokenService tokenService) {
this.tokenService = tokenService;
}
public static WindowsDeviceManagementDataHolder getThisInstance() {
return thisInstance;
}
public static void setThisInstance(WindowsDeviceManagementDataHolder thisInstance) {
WindowsDeviceManagementDataHolder.thisInstance = thisInstance;
}
}

@ -23,6 +23,8 @@ import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenServiceImpl;
import org.wso2.carbon.ndatasource.core.DataSourceService;
import org.wso2.carbon.registry.core.service.RegistryService;
@ -65,6 +67,8 @@ public class WindowsDeviceManagementServiceComponent {
// bundleContext.registerService(PolicyMonitoringManager.class,
// new WindowsPolicyMonitoringManager(), null);
//Enrollment token service
bundleContext.registerService(WindowsTokenService.class, new WindowsTokenServiceImpl(), null);
if (log.isDebugEnabled()) {
log.debug("Android Mobile Device Management Service Component has been successfully activated");
@ -114,4 +118,18 @@ public class WindowsDeviceManagementServiceComponent {
WindowsDeviceManagementDataHolder.getInstance().setRegistryService(null);
}
protected void setEnrollmentTokenService(WindowsTokenService service) {
if (log.isDebugEnabled()) {
log.debug("Setting windows enrollment token service provider");
}
WindowsDeviceManagementDataHolder.getInstance().setTokenService(service);
}
protected void unsetEnrollmentTokenService() {
if (log.isDebugEnabled()) {
log.debug("Removing windows enrollment token service provider");
}
WindowsDeviceManagementDataHolder.getInstance().setTokenService(null);
}
}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.analytics.feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.iot.device.statistics.dashboard.feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.backend.feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense Backend Feature</name>
<url>http://wso2.org</url>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>androidsense-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.androidsense.ui.feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Android Sense UI Feature</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>arduino-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>device-types-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management IoT Plugins Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>raspberrypi-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -0,0 +1,7 @@
@echo off
echo.
echo.WSO2 IOT Sample
echo.Virtual Fire Alarm
echo.initializing agent
echo.
java -jar wso2-firealarm-virtual-agent-advanced.jar

@ -0,0 +1,7 @@
@echo off
echo.
echo.WSO2 IOT Sample
echo.Virtual Fire Alarm
echo.initializing agent
echo.
java -jar wso2-firealarm-virtual-agent.jar

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>virtual-fire-alarm-plugin-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Carbon - App management MDM OSGI Connector</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for APP management OSGI MDM connection
@ -36,7 +36,7 @@
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.appmgt.mdm.osgiconnector</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.appmgt.mdm.restconnector.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Carbon - App management MDM REST Connector</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for APP management MDM REST connection
@ -36,7 +36,7 @@
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.appmgt.mdm.restconnector</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.axiom</groupId>

@ -23,14 +23,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.adapter.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Adapters Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the adapter bundles required for IoT Server</description>

@ -20,13 +20,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.extension.siddhi.execution.json.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<name>WSO2 Siddhi Execution Extension - Json Feature</name>
<url>http://wso2.org</url>
<description>This feature contains Siddhi extension feature for changing a json string to individual properties.</description>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extensions-feature</artifactId>
<version>3.0.35-SNAPSHOT</version>
<version>3.0.37-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Extensions</name>
<url>http://wso2.org</url>

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

Loading…
Cancel
Save