Refactored code comments

This commit is contained in:
harshanL 2014-12-22 16:55:11 +05:30
parent 0cd90fc349
commit 87d47c1d93
2 changed files with 8 additions and 2 deletions

View File

@ -35,12 +35,12 @@ public class DeviceManagementRepository {
public void addDeviceManagementProvider(DeviceManagerService provider) {
String deviceType = provider.getProviderType();
providers.put(deviceType, provider);
try {
DeviceManagerUtil.registerDeviceType(deviceType);
} catch (DeviceManagementException e) {
log.error("Exception occured while registering the device type.",e);
}
providers.put(deviceType, provider);
}
public DeviceManagerService getDeviceManagementProvider(String type) {

View File

@ -51,7 +51,7 @@ public final class DeviceManagerUtil {
}
/**
* Resolve data source from the data source definition
* Resolve data source from the data source definition.
*
* @param config data source configuration
* @return data source resolved from the data source definition
@ -84,6 +84,12 @@ public final class DeviceManagerUtil {
return dataSource;
}
/**
* Adds a new device type to the database if it does not exists.
*
* @param deviceTypeName device type
* @return status of the operation
*/
public static boolean registerDeviceType(String deviceTypeName) throws DeviceManagementException{
boolean status = false;
try {