Partial commit of migration

revert-70aa11f8
mharindu 8 years ago
parent d7e8cc30dd
commit 24930b3042

@ -143,6 +143,7 @@
org.apache.commons.logging,
javax.servlet,
javax.xml.*,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
com.google.gson.*,
org.apache.catalina,
org.apache.catalina.core,

@ -89,6 +89,7 @@
org.wso2.carbon.device.mgt.common.*,
io.swagger.annotations.*;resolution:=optional,
org.wso2.carbon.device.mgt.core.*,
org.wso2.carbon.registry.indexing.*,
<!--org.bouncycastle.pkcs.jcajce-->
</Import-Package>
<Export-Package>
@ -179,7 +180,10 @@
<artifactId>org.wso2.carbon.user.core</artifactId>
<version>4.4.3</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
</dependencies>
</project>

@ -6,16 +6,9 @@ import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManagerImpl;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
/**
* @scr.component name="org.wso2.carbon.certificate.mgt.core.scep" immediate="true"
* @scr.reference name="app.mgt.service"
* interface="org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService"
* cardinality="1..1"
* policy="dynamic"
* bind="setApplicationManagementProviderService"
* unbind="unsetApplicationManagementProviderService"
*/
public class SCEPManagerServiceComponent {
@ -47,14 +40,4 @@ public class SCEPManagerServiceComponent {
}
}
protected void unsetApplicationManagementProviderService(ApplicationManagementProviderService
applicationManagementProviderService) {
//do nothing
}
protected void setApplicationManagementProviderService(ApplicationManagementProviderService
applicationManagementProviderService) {
//do nothing
}
}

@ -19,12 +19,12 @@ package org.wso2.carbon.certificate.mgt.core.scep;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.internal.CertificateManagementDataHolder;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
@ -33,19 +33,18 @@ import java.sql.SQLException;
import java.util.HashMap;
public class SCEPManagerImpl implements SCEPManager {
private DeviceDAO deviceDAO;
private static final Log log = LogFactory.getLog(SCEPManagerImpl.class);
DeviceManagementProviderService dms;
public SCEPManagerImpl() {
deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
this.dms = CertificateManagementDataHolder.getInstance().getDeviceManagementService();
}
@Override
public TenantedDeviceWrapper getValidatedDevice(DeviceIdentifier deviceIdentifier) throws SCEPException {
TenantedDeviceWrapper tenantedDeviceWrapper = new TenantedDeviceWrapper();
try {
DeviceManagementDAOFactory.openConnection();
HashMap<Integer, Device> deviceHashMap = deviceDAO.getDevice(deviceIdentifier);
HashMap<Integer, Device> deviceHashMap = dms.getTenantedDevice(deviceIdentifier);
Object[] keySet = deviceHashMap.keySet().toArray();
if (keySet == null || keySet.length == 0) {
@ -71,15 +70,12 @@ public class SCEPManagerImpl implements SCEPManager {
String tenantDomain = realmService.getTenantManager().getDomain(tenantId);
tenantedDeviceWrapper.setTenantDomain(tenantDomain);
} catch (SQLException e) {
throw new SCEPException("Error occurred while getting the datasource connection.", e);
} catch (DeviceManagementDAOException e) {
throw new SCEPException("Error occurred while reading the device dao.", e);
} catch (UserStoreException e) {
throw new SCEPException("Error occurred while getting the tenant domain.", e);
} catch (DeviceManagementException e) {
throw new SCEPException("Error occurred while getting device '" + deviceIdentifier + "'.", e);
} finally {
PrivilegedCarbonContext.endTenantFlow();
DeviceManagementDAOFactory.closeConnection();
}
return tenantedDeviceWrapper;
}

@ -82,6 +82,10 @@
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.common</artifactId>
</dependency>
<dependency>
<groupId>org.json.wso2</groupId>
<artifactId>json</artifactId>

@ -50,7 +50,7 @@
<Import-Package>
javax.xml.bind.annotation,
com.fasterxml.jackson.annotation,
org.wso2.carbon.apimgt.api.model,
org.wso2.carbon.apimgt.api.model.*;version="${carbon.api.mgt.version.range}",
io.swagger.annotations.*;resolution:=optional
</Import-Package>
</instructions>

@ -58,6 +58,7 @@
org.apache.commons.logging,
javax.naming,
javax.xml.*,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
javax.servlet.*,
org.xml.sax,
javax.sql.*,

@ -19,7 +19,6 @@
package org.wso2.carbon.device.mgt.core.app.mgt;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.core.DeviceManagementPluginRepository;
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
public class ApplicationManagerFactory {

@ -18,9 +18,6 @@
package org.wso2.carbon.device.mgt.core.app.mgt;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
@ -30,18 +27,10 @@ import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
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.core.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
import org.wso2.carbon.device.mgt.core.app.mgt.oauth.ServiceAuthenticator;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations;
import org.wso2.carbon.device.mgt.core.dao.*;
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
import org.wso2.carbon.identity.oauth.stub.OAuthAdminServiceException;
import org.wso2.carbon.identity.oauth.stub.OAuthAdminServiceStub;
import org.wso2.carbon.identity.oauth.stub.dto.OAuthConsumerAppDTO;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@ -23,8 +23,8 @@ import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
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.core.dto.DeviceType;
import java.util.HashMap;
import java.util.List;
/**
@ -205,6 +205,8 @@ public interface DeviceManagementProviderService {
Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException;
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException;
List<String> getAvailableDeviceTypes() throws DeviceManagementException;

@ -757,6 +757,30 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
}
}
@Override
public HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException {
HashMap<Integer, Device> deviceHashMap;
try {
DeviceManagementDAOFactory.openConnection();
deviceHashMap = deviceDAO.getDevice(deviceIdentifier);
if (deviceHashMap == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the type '" + deviceIdentifier.getType() + "' and id '" +
deviceIdentifier.getId() + "'");
}
return null;
}
} catch (DeviceManagementDAOException e) {
throw new DeviceManagementException("Error occurred while obtaining the device for id " +
"'" + deviceIdentifier.getId() + "'", e);
} catch (SQLException e) {
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
return deviceHashMap;
}
@Override
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
Device device;

@ -125,7 +125,7 @@
org.wso2.carbon.device.mgt.core.*,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
org.w3c.dom,
org.wso2.carbon.apimgt.keymgt,
org.wso2.carbon.apimgt.keymgt.handlers,
@ -133,7 +133,7 @@
org.apache.commons.codec.binary,
org.wso2.carbon.identity.application.authentication.framework.model,
org.apache.oltu.oauth2.common,
org.wso2.carbon.base
org.wso2.carbon.base,
</Import-Package>
</instructions>
</configuration>

@ -61,7 +61,7 @@
com.nimbusds.jwt,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
javax.xml.validation,
org.apache.axiom.util.base64,
org.apache.catalina,

@ -68,6 +68,10 @@
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
</dependencies>
<build>
@ -146,6 +150,9 @@
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
</importFeatures>
<importBundles>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
</importBundles>
</configuration>
</execution>
</executions>

@ -39,6 +39,14 @@
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.common</artifactId>
</dependency>
</dependencies>
<build>
@ -96,6 +104,10 @@
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
</importFeatures>
<importBundles>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.common:${carbon.registry.version}</importBundleDef>
</importBundles>
</configuration>
</execution>
</executions>

@ -86,7 +86,7 @@
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
</importFeatureDef>
<importFeatureDef>org.wso2.carbon.governance.metadata:${carbon.governance.version}
<importFeatureDef>org.wso2.carbon.governance.metadata.server:${carbon.governance.version}
</importFeatureDef>
</importFeatures>
</configuration>

@ -49,10 +49,14 @@
<artifactId>org.wso2.carbon.device.mgt.api.feature</artifactId>
<type>zip</type>
</dependency>
<!--<dependency>-->
<!--<groupId>org.wso2.carbon.commons</groupId>-->
<!--<artifactId>org.wso2.carbon.email.verification</artifactId>-->
<!--</dependency>-->
<dependency>
<groupId>org.wso2.orbit.org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
</dependencies>
<build>
@ -125,9 +129,15 @@
</bundleDef>
<!-- Below should be bundled with the email verification -->
</bundles>
<importBundles>
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt:${carbon.api.mgt.version}</importBundleDef>
<importBundleDef>org.wso2.orbit.org.apache.pdfbox:pdfbox:${orbit.version.pdfbox}</importBundleDef>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
</importBundles>
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef>
<!--<importFeatureDef>org.wso2.carbon.apimgt.keymgt.client:${carbon.api.mgt.version}</importFeatureDef>-->
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef>
<importFeatureDef>org.wso2.carbon.email.sender:${carbon.device.mgt.version}</importFeatureDef>
</importFeatures>

@ -48,6 +48,10 @@
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.identity.authenticator.backend.oauth</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
</dependencies>
<build>
@ -84,6 +88,9 @@
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
</importFeatureDef>
</importFeatures>
<importBundles>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
</importBundles>
</configuration>
</execution>
</executions>

@ -53,6 +53,14 @@
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.information.point</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.keymgt.client</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
</dependencies>
<build>
@ -116,6 +124,10 @@
org.wso2.carbon.devicemgt:org.wso2.carbon.policy.information.point:${carbon.device.mgt.version}
</bundleDef>
</bundles>
<importBundles>
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt.client:${carbon.api.mgt.version}</importBundleDef>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
</importBundles>
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
</importFeatureDef>

@ -30,7 +30,7 @@
<artifactId>org.wso2.carbon.webapp.authenticator.framework.server.feature</artifactId>
<packaging>pom</packaging>
<version>1.1.3-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name>
<name>WSO2 Carbon - Webapp Authenticator Framework Server Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for Back-end Device Management functionality
</description>
@ -40,6 +40,18 @@
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.throttle.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
</dependency>
</dependencies>
<build>
@ -97,6 +109,11 @@
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
<importFeatureDef>org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importFeatureDef>
</importFeatures>
<importBundles>
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.core:${carbon.api.mgt.version}</importBundleDef>
<importBundleDef>org.wso2.carbon:org.wso2.carbon.throttle.core:${carbon.throttle.module.version}</importBundleDef>
<importBundleDef>org.apache.ws.commons.axiom.wso2:axiom:${axiom.wso2.version}</importBundleDef>
</importBundles>
</configuration>
</execution>
</executions>

@ -738,6 +738,11 @@
<artifactId>nimbus-jose-jwt</artifactId>
<version>${nimbus.orbit.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${orbit.version.pdfbox}</version>
</dependency>
<!-- End of Orbit dependencies -->
@ -780,6 +785,11 @@
<artifactId>org.wso2.carbon.apimgt.keymgt.client</artifactId>
<version>${carbon.api.mgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.throttle.core</artifactId>
<version>${carbon.throttle.module.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.apimgt</groupId>
<artifactId>org.wso2.carbon.apimgt.keymgt</artifactId>
@ -1406,6 +1416,12 @@
<version>${carbon.registry.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.common</artifactId>
<version>${carbon.registry.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.scannotation</groupId>
<artifactId>scannotation</artifactId>
@ -1512,7 +1528,6 @@
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -1786,12 +1801,12 @@
<carbon.multitenancy.version>4.6.0</carbon.multitenancy.version>
<!-- Carbon Governance -->
<carbon.governance.version>4.7.1</carbon.governance.version>
<carbon.governance.version>4.6.4</carbon.governance.version>
<!-- Axiom -->
<axiom.version>1.2.11-wso2v10</axiom.version>
<axiom.osgi.version.range>[1.2.11, 1.3.0)</axiom.osgi.version.range>
<axiom.wso2.version>1.2.11.wso2v5</axiom.wso2.version>
<axiom.wso2.version>1.2.11.wso2v2</axiom.wso2.version>
<!-- Carbon Device Management -->
<carbon.device.mgt.version>1.1.3-SNAPSHOT</carbon.device.mgt.version>
@ -1811,7 +1826,7 @@
<carbon.analytics.common.version.range>[5.0.11,6.0.0)</carbon.analytics.common.version.range>
<!-- Carbon Registry -->
<carbon.registry.version>4.6.0</carbon.registry.version>
<carbon.registry.version>4.5.6</carbon.registry.version>
<carbon.registry.imp.pkg.version.range>[4.4.8, 5.0.0)</carbon.registry.imp.pkg.version.range>
<!--CXF properties-->
@ -1886,6 +1901,11 @@
<owasp.encoder.version>1.2.0.wso2v1</owasp.encoder.version>
<hibernate-validator.version>5.0.2.Final</hibernate-validator.version>
<javax.xml.parsers.import.pkg.version>[0.0.0, 1.0.0)</javax.xml.parsers.import.pkg.version>
<!-- apache pdfbox version -->
<orbit.version.pdfbox>1.8.10.wso2v2</orbit.version.pdfbox>
<carbon.throttle.module.version>4.2.1</carbon.throttle.module.version>
</properties>
</project>

Loading…
Cancel
Save