mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Refactored device info
This commit is contained in:
commit
847eb073b9
@ -122,6 +122,7 @@ public interface DeviceManager {
|
|||||||
* @param device Updated device information related data
|
* @param device Updated device information related data
|
||||||
* @throws DeviceManagementException If some unusual behaviour is observed while updating the device info
|
* @throws DeviceManagementException If some unusual behaviour is observed while updating the device info
|
||||||
*/
|
*/
|
||||||
|
|
||||||
boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException;
|
boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
org.wso2.carbon.identity.oauth.stub,
|
org.wso2.carbon.identity.oauth.stub,
|
||||||
org.wso2.carbon.identity.oauth.stub.dto,
|
org.wso2.carbon.identity.oauth.stub.dto,
|
||||||
org.wso2.carbon.ndatasource.core,
|
org.wso2.carbon.ndatasource.core,
|
||||||
org.wso2.carbon.device.mgt.user.core,
|
org.wso2.carbon.device.mgt.user.core.*,
|
||||||
org.wso2.carbon.device.mgt.user.common,
|
org.wso2.carbon.device.mgt.user.common,
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
|
|||||||
@ -138,9 +138,8 @@ public class DeviceManagementServiceProviderImpl implements DeviceManagementServ
|
|||||||
this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
|
this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
|
||||||
boolean status = dms.disenrollDevice(deviceId);
|
boolean status = dms.disenrollDevice(deviceId);
|
||||||
try {
|
try {
|
||||||
org.wso2.carbon.device.mgt.core.dto.Device device = this.getDeviceDAO().getDevice(deviceId);
|
int deviceID = Integer.parseInt(deviceId.getId());
|
||||||
device.setStatus(Status.INACTIVE);
|
this.getDeviceDAO().updateDeviceStatus(deviceID, Status.INACTIVE);
|
||||||
this.getDeviceDAO().updateDevice(device);
|
|
||||||
} catch (DeviceManagementDAOException e) {
|
} catch (DeviceManagementDAOException e) {
|
||||||
throw new DeviceManagementException("Error occurred while modifying the device " +
|
throw new DeviceManagementException("Error occurred while modifying the device " +
|
||||||
"'" + deviceId.getId() + "'", e);
|
"'" + deviceId.getId() + "'", e);
|
||||||
|
|||||||
@ -24,6 +24,8 @@ import org.osgi.service.component.ComponentContext;
|
|||||||
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
|
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
|
||||||
import org.wso2.carbon.core.ServerStartupObserver;
|
import org.wso2.carbon.core.ServerStartupObserver;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnector;
|
||||||
|
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnectorException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
|
||||||
@ -37,8 +39,6 @@ import org.wso2.carbon.device.mgt.core.api.mgt.APIPublisherService;
|
|||||||
import org.wso2.carbon.device.mgt.core.api.mgt.APIPublisherServiceImpl;
|
import org.wso2.carbon.device.mgt.core.api.mgt.APIPublisherServiceImpl;
|
||||||
import org.wso2.carbon.device.mgt.core.api.mgt.APIRegistrationStartupObserver;
|
import org.wso2.carbon.device.mgt.core.api.mgt.APIRegistrationStartupObserver;
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.AppManagementServiceImpl;
|
import org.wso2.carbon.device.mgt.core.app.mgt.AppManagementServiceImpl;
|
||||||
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnector;
|
|
||||||
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnectorException;
|
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.RemoteAppManagerConnector;
|
import org.wso2.carbon.device.mgt.core.app.mgt.RemoteAppManagerConnector;
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
|
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfig;
|
||||||
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfigurationManager;
|
import org.wso2.carbon.device.mgt.core.app.mgt.config.AppManagementConfigurationManager;
|
||||||
@ -55,9 +55,11 @@ import org.wso2.carbon.device.mgt.core.service.DeviceManagementService;
|
|||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementServiceImpl;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementServiceImpl;
|
||||||
import org.wso2.carbon.device.mgt.core.util.DeviceManagementSchemaInitializer;
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagementSchemaInitializer;
|
||||||
import org.wso2.carbon.device.mgt.user.core.UserManager;
|
import org.wso2.carbon.device.mgt.user.core.UserManager;
|
||||||
import org.wso2.carbon.user.core.service.RealmService;
|
import org.wso2.carbon.device.mgt.user.core.service.UserManagementService;
|
||||||
import org.wso2.carbon.ndatasource.core.DataSourceService;
|
import org.wso2.carbon.ndatasource.core.DataSourceService;
|
||||||
import org.wso2.carbon.registry.core.service.RegistryService;
|
import org.wso2.carbon.registry.core.service.RegistryService;
|
||||||
|
import org.wso2.carbon.user.core.service.RealmService;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -93,9 +95,9 @@ import java.util.List;
|
|||||||
* policy="dynamic"
|
* policy="dynamic"
|
||||||
* bind="setDataSourceService"
|
* bind="setDataSourceService"
|
||||||
* unbind="unsetDataSourceService"
|
* unbind="unsetDataSourceService"
|
||||||
* @scr.reference name="org.wso2.carbon.device.mgt.usermanager.service"
|
* @scr.reference name="org.wso2.carbon.device.mgt.user.core.usermanager"
|
||||||
* interface="org.wso2.carbon.device.mgt.user.core.UserManager"
|
* interface="org.wso2.carbon.device.mgt.user.core.UserManager"
|
||||||
* cardinality="1..1"
|
* cardinality="1..1
|
||||||
* policy="dynamic"
|
* policy="dynamic"
|
||||||
* bind="setUserManager"
|
* bind="setUserManager"
|
||||||
* unbind="unsetUserManager"
|
* unbind="unsetUserManager"
|
||||||
|
|||||||
@ -22,6 +22,8 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
import org.osgi.service.component.ComponentContext;
|
import org.osgi.service.component.ComponentContext;
|
||||||
|
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
||||||
|
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
|
||||||
import org.wso2.carbon.device.mgt.core.email.sender.EmailServiceProviderImpl;
|
import org.wso2.carbon.device.mgt.core.email.sender.EmailServiceProviderImpl;
|
||||||
import org.wso2.carbon.device.mgt.core.service.EmailService;
|
import org.wso2.carbon.device.mgt.core.service.EmailService;
|
||||||
import org.wso2.carbon.device.mgt.core.service.EmailServiceImpl;
|
import org.wso2.carbon.device.mgt.core.service.EmailServiceImpl;
|
||||||
@ -48,6 +50,9 @@ public class EmailServiceComponent {
|
|||||||
log.debug("Initializing email service bundle");
|
log.debug("Initializing email service bundle");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeviceConfigurationManager.getInstance().initConfig();
|
||||||
|
DeviceManagementConfig config =
|
||||||
|
DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
|
||||||
/* Initializing Email Service Configurations */
|
/* Initializing Email Service Configurations */
|
||||||
|
|
||||||
EmailService emailServiceProvider = new EmailServiceProviderImpl();
|
EmailService emailServiceProvider = new EmailServiceProviderImpl();
|
||||||
|
|||||||
@ -101,6 +101,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
|
|||||||
public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException {
|
public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException {
|
||||||
return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
|
return DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
|
||||||
updateDeviceInfo(deviceIdentifier, device);
|
updateDeviceInfo(deviceIdentifier, device);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -55,8 +55,8 @@ public class DeviceMgtUserServiceComponent {
|
|||||||
}
|
}
|
||||||
/* Registering User Management service */
|
/* Registering User Management service */
|
||||||
BundleContext bundleContext = componentContext.getBundleContext();
|
BundleContext bundleContext = componentContext.getBundleContext();
|
||||||
bundleContext.registerService(UserManager.class,
|
bundleContext.registerService(org.wso2.carbon.device.mgt.user.core.UserManager.class,
|
||||||
new UserManagementService(), null);
|
new org.wso2.carbon.device.mgt.user.core.service.UserManagementService(), null);
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("User management core bundle has been successfully initialized");
|
log.debug("User management core bundle has been successfully initialized");
|
||||||
}
|
}
|
||||||
|
|||||||
10
pom.xml
10
pom.xml
@ -1078,16 +1078,6 @@
|
|||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>wso2-staging</id>
|
|
||||||
<name>WSO2 Staging Repository</name>
|
|
||||||
<url>http://maven.wso2.org/nexus/content/repositories/orgwso2carbonapimgt-009/</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
<updatePolicy>daily</updatePolicy>
|
|
||||||
<checksumPolicy>ignore</checksumPolicy>
|
|
||||||
</releases>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user