Create pluin level databases

revert-dabc3590
manoj 10 years ago
parent 2ece5764d3
commit 1c13180e56

@ -60,7 +60,7 @@
javax.xml.bind.*, javax.xml.bind.*,
javax.naming, javax.naming,
javax.sql, javax.sql,
javax.xml.bind.annotation, javax.xml.bind.annotation.*,
javax.xml.parsers, javax.xml.parsers,
org.w3c.dom, org.w3c.dom,
org.wso2.carbon.core, org.wso2.carbon.core,

@ -33,8 +33,8 @@ public abstract class AbstractMobileOperationManager implements OperationManager
} }
@Override @Override
public boolean addOperation(Operation operation, public boolean addOperation(Operation operation, List<DeviceIdentifier> devices) throws
List<DeviceIdentifier> devices) throws OperationManagementException { OperationManagementException {
return true; return true;
} }

@ -75,8 +75,5 @@ public class MobileDeviceConfigurationManager {
return currentMobileDeviceConfig; return currentMobileDeviceConfig;
} }
public MobileDataSourceConfig getMobileDataSourceConfig() {
return currentMobileDeviceConfig.getMobileDeviceMgtRepository().getMobileDataSourceConfig();
}
} }

@ -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();
}
} }

@ -25,7 +25,8 @@ import javax.xml.bind.annotation.XmlRootElement;
/** /**
* Class for holding data source configuration in mobile-config.xml at parsing with JAXB. * Class for holding data source configuration in mobile-config.xml at parsing with JAXB.
*/ */
@XmlRootElement(name = "DataSourceConfiguration") public class MobileDataSourceConfig { @XmlRootElement(name = "DataSourceConfiguration")
public class MobileDataSourceConfig {
private JNDILookupDefinition jndiLookupDefinition; private JNDILookupDefinition jndiLookupDefinition;
private String type; private String type;

@ -1,9 +1,3 @@
package org.wso2.carbon.device.mgt.mobile.config.datasource;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
/* /*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
@ -21,10 +15,19 @@ import java.util.List;
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.wso2.carbon.device.mgt.mobile.config.datasource;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
@XmlRootElement(name = "DataSourceConfigurations") @XmlRootElement(name = "DataSourceConfigurations")
@XmlAccessorType(XmlAccessType.FIELD)
public class MobileDataSourceConfigurations { public class MobileDataSourceConfigurations {
@XmlElement(name = "DataSourceConfigurations", nillable = true) @XmlElement(name = "DataSourceConfiguration", nillable = true)
private List<MobileDataSourceConfig> mobileDataSourceConfigs; private List<MobileDataSourceConfig> mobileDataSourceConfigs;
public List<MobileDataSourceConfig> getMobileDataSourceConfigs() { public List<MobileDataSourceConfig> getMobileDataSourceConfigs() {

@ -34,17 +34,13 @@ import java.util.List;
*/ */
public class WindowsDeviceManager implements DeviceManager { public class WindowsDeviceManager implements DeviceManager {
<<<<<<< HEAD:components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory;
private static final Log log = LogFactory.getLog(WindowsDeviceManagerService.class);
private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory;
public WindowsDeviceManagerService() { public WindowsDeviceManager() {
mobileDeviceManagementDAOFactory = new MobileDeviceManagementDAOFactory(DeviceManagementConstants mobileDeviceManagementDAOFactory = new MobileDeviceManagementDAOFactory(DeviceManagementConstants
.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); .MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
} }
=======
private static final Log log = LogFactory.getLog(WindowsDeviceManager.class); private static final Log log = LogFactory.getLog(WindowsDeviceManager.class);
>>>>>>> 2c5cc4c28de5586b7450887d02c49a4c9973b40a:components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManager.java
@Override @Override
public String getProviderType() { public String getProviderType() {

@ -19,24 +19,23 @@
<MobileDeviceMgtConfiguration> <MobileDeviceMgtConfiguration>
<ManagementRepository> <ManagementRepository>
<DataSourceConfiguration> <DataSourceConfigurations>
<JndiLookupDefinition> <DataSourceConfiguration type="ios">
<Name>jdbc/MobileDM_DS</Name> <JndiLookupDefinition>
</JndiLookupDefinition> <Name>jdbc/MobileIOSDM_DS</Name>
</DataSourceConfiguration> </JndiLookupDefinition>
</DataSourceConfiguration>
<DataSourceConfiguration type="android">
<JndiLookupDefinition>
<Name>jdbc/MobileAndroidDM_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
<DataSourceConfiguration type="windows">
<JndiLookupDefinition>
<Name>jdbc/MobileWindowsDM_DS</Name>
</JndiLookupDefinition>
</DataSourceConfiguration>
</DataSourceConfigurations>
</ManagementRepository> </ManagementRepository>
<APIPublisher>
<APIs>
<MalformedAPI>
<Name>enrollment</Name>
<Owner>admin</Owner>
<Context>enrollment</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/</Endpoint>
<Transports>http,https</Transports>
</MalformedAPI>
</APIs>
</APIPublisher>
</MobileDeviceMgtConfiguration> </MobileDeviceMgtConfiguration>

@ -19,7 +19,6 @@
<MobileDeviceMgtConfiguration> <MobileDeviceMgtConfiguration>
<ManagementRepository> <ManagementRepository>
<DataSourceConfigurations> <DataSourceConfigurations>
<DataSourceConfiguration type="ios"> <DataSourceConfiguration type="ios">
<JndiLookupDefinition> <JndiLookupDefinition>

Loading…
Cancel
Save