|
|
@ -18,13 +18,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.wso2.carbon.device.mgt.mobile.config;
|
|
|
|
package org.wso2.carbon.device.mgt.mobile.config;
|
|
|
|
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.common.PluginTypeEnum;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.config.datasource.DataSourceConfigAdapter;
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.config.datasource.DataSourceConfigAdapter;
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
|
|
|
|
import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|
|
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -34,12 +34,13 @@ import java.util.Map;
|
|
|
|
public class MobileDeviceManagementRepository {
|
|
|
|
public class MobileDeviceManagementRepository {
|
|
|
|
|
|
|
|
|
|
|
|
private Map<String, MobileDataSourceConfig> mobileDataSourceConfigMap;
|
|
|
|
private Map<String, MobileDataSourceConfig> mobileDataSourceConfigMap;
|
|
|
|
|
|
|
|
private List<MobileDataSourceConfig> mobileDataSourceConfigs;
|
|
|
|
|
|
|
|
|
|
|
|
public MobileDataSourceConfig getMobileDataSourceConfig(PluginTypeEnum type) {
|
|
|
|
public MobileDataSourceConfig getMobileDataSourceConfig(String provider) {
|
|
|
|
return mobileDataSourceConfigMap.get(type.toString());
|
|
|
|
return mobileDataSourceConfigMap.get(provider);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@XmlElement(name="DataSourceConfigurations")
|
|
|
|
@XmlElement(name = "DataSourceConfigurations")
|
|
|
|
@XmlJavaTypeAdapter(DataSourceConfigAdapter.class)
|
|
|
|
@XmlJavaTypeAdapter(DataSourceConfigAdapter.class)
|
|
|
|
public Map<String, MobileDataSourceConfig> getMobileDataSourceConfigMap() {
|
|
|
|
public Map<String, MobileDataSourceConfig> getMobileDataSourceConfigMap() {
|
|
|
|
return mobileDataSourceConfigMap;
|
|
|
|
return mobileDataSourceConfigMap;
|
|
|
@ -48,4 +49,9 @@ public class MobileDeviceManagementRepository {
|
|
|
|
public void setMobileDataSourceConfigMap(Map<String, MobileDataSourceConfig> mobileDataSourceConfigMap) {
|
|
|
|
public void setMobileDataSourceConfigMap(Map<String, MobileDataSourceConfig> mobileDataSourceConfigMap) {
|
|
|
|
this.mobileDataSourceConfigMap = mobileDataSourceConfigMap;
|
|
|
|
this.mobileDataSourceConfigMap = mobileDataSourceConfigMap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<MobileDataSourceConfig> getMobileDataSourceConfigs() {
|
|
|
|
|
|
|
|
return (List<MobileDataSourceConfig>) mobileDataSourceConfigMap.values();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|