hasuniea 9 years ago
commit b72e481371

@ -90,9 +90,9 @@ public class MobileDeviceManagementDAOUtil {
*
* @param dataSource Mobile data source
*/
public static void setupMobileDeviceManagementSchema(DataSource dataSource) throws MobileDeviceMgtPluginException {
public static void setupMobileDeviceManagementSchema(DataSource dataSource, String pluginType) throws MobileDeviceMgtPluginException {
MobileDeviceManagementSchemaInitializer initializer =
new MobileDeviceManagementSchemaInitializer(dataSource);
new MobileDeviceManagementSchemaInitializer(dataSource, pluginType);
log.info("Initializing mobile device management repository database schema");
try {
initializer.createRegistryDatabase();

@ -92,7 +92,7 @@ public class MobileDeviceManagementServiceComponent {
for (String pluginType : dsConfigMap.keySet()) {
MobileDeviceManagementDAOUtil
.setupMobileDeviceManagementSchema(MobileDeviceManagementDAOFactory.getDataSourceMap
().get(pluginType));
().get(pluginType), pluginType);
}
} catch (MobileDeviceMgtPluginException e) {
log.error("Exception occurred while initializing mobile device management database schema", e);

@ -39,13 +39,23 @@ public final class MobileDeviceManagementSchemaInitializer extends DatabaseCreat
CarbonUtils.getCarbonHome() + File.separator + "dbscripts" + File.separator
+ MobilePluginConstants.MOBILE_DB_SCRIPTS_FOLDER +
File.separator + "plugins" + File.separator;
private String pluginType;
public MobileDeviceManagementSchemaInitializer(DataSource dataSource) {
public String getPluginType() {
return pluginType;
}
public void setPluginType(String pluginType) {
this.pluginType = pluginType;
}
public MobileDeviceManagementSchemaInitializer(DataSource dataSource, String pType) {
super(dataSource);
this.pluginType = pType;
}
protected String getDbScriptLocation(String databaseType) {
String scriptName = databaseType + ".sql";
String scriptName = databaseType + "_" + getPluginType() + ".sql";
if (log.isDebugEnabled()) {
log.debug("Loading database script from :" + scriptName);
}

Loading…
Cancel
Save