diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java index c64c0ad0f56..61fe056852e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java @@ -104,6 +104,13 @@ public interface DeviceManagerService { */ Device getDeviceInfo(String type, String deviceId) throws DeviceManagementException; + /** + * Method to update device information. + * @param device Updated device information related data + * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device + */ + void updateDeviceInfo(Device device) throws DeviceManagementException; + /** * Method to set the ownership type of a particular device. i.e. BYOD, COPE * diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceMgtDBUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceMgtDBUtil.java deleted file mode 100644 index 93a2c994e53..00000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceMgtDBUtil.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2. - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.carbon.device.mgt.core.config; - -import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -public final class DeviceMgtDBUtil { - - private static final Log log = LogFactory.getLog(DeviceMgtDBUtil.class); - - private static volatile DataSource dataSource = null; - private static final String DB_CHECK_SQL = DeviceManagementConstants.DataSourceProperties.DB_CHECK_QUERY; - - private static final String DB_CONFIG = "Database."; - private static final String DB_DRIVER = DB_CONFIG + "Driver"; - private static final String DB_URL = DB_CONFIG + "URL"; - private static final String DB_USER = DB_CONFIG + "Username"; - private static final String DB_PASSWORD = DB_CONFIG + "Password"; - - private static final String DATA_SOURCE_NAME = "DataSourceName"; - - /** - * Initializes the data source - * - */ - public static void initialize() throws Exception { - if (dataSource != null) { - return; - } - - synchronized (DeviceMgtDBUtil.class) { - if (dataSource == null) { - if (log.isDebugEnabled()) { - log.debug("Initializing data source"); - } - APIManagerConfiguration config = ServiceReferenceHolder.getInstance(). - getAPIManagerConfigurationService().getAPIManagerConfiguration(); - String dataSourceName = config.getFirstProperty(DATA_SOURCE_NAME); - - if (dataSourceName != null) { - try { - Context ctx = new InitialContext(); - dataSource = (DataSource) ctx.lookup(dataSourceName); - } catch (NamingException e) { - throw new APIManagementException("Error while looking up the data " + - "source: " + dataSourceName); - } - } else { - DBConfiguration configuration = getDBConfig(config); - String dbUrl = configuration.getDbUrl(); - String driver = configuration.getDriverName(); - String username = configuration.getUserName(); - String password = configuration.getPassword(); - if (dbUrl == null || driver == null || username == null || password == null) { - log.warn("Required DB configuration parameters unspecified. So API Store and API Publisher " + - "will not work as expected."); - } - - BasicDataSource basicDataSource = new BasicDataSource(); - basicDataSource.setDriverClassName(driver); - basicDataSource.setUrl(dbUrl); - basicDataSource.setUsername(username); - basicDataSource.setPassword(password); - dataSource = basicDataSource; - } - } - setupAPIManagerDatabase(); - } - } - - /** - * Creates the APIManager Database if not created already. - * - * @throws Exception if an error occurs while creating the APIManagerDatabase. - */ - private static void setupAPIManagerDatabase() throws Exception { - - String value = System.getProperty("setup"); - if (value != null) { - LocalDatabaseCreator databaseCreator = new LocalDatabaseCreator(dataSource); - try { - if (!databaseCreator.isDatabaseStructureCreated(DB_CHECK_SQL)) { - databaseCreator.createRegistryDatabase(); - } else { - log.info("APIManager database already exists. Not creating a new database."); - } - } catch (Exception e) { - String msg = "Error in creating the APIManager database"; - throw new Exception(msg, e); - } - } - } - - /** - * Utility method to get a new database connection - * - * @return Connection - * @throws java.sql.SQLException if failed to get Connection - */ - public static Connection getConnection() throws SQLException { - if (dataSource != null) { - return dataSource.getConnection(); - } - throw new SQLException("Data source is not configured properly."); - } - - /** - * Utility method to close the connection streams. - * @param preparedStatement PreparedStatement - * @param connection Connection - * @param resultSet ResultSet - */ - public static void closeAllConnections(PreparedStatement preparedStatement, Connection connection, - ResultSet resultSet) { - closeConnection(connection); - closeResultSet(resultSet); - closeStatement(preparedStatement); - } - - /** - * Close Connection - * @param dbConnection Connection - */ - private static void closeConnection(Connection dbConnection) { - if (dbConnection != null) { - try { - dbConnection.close(); - } catch (SQLException e) { - log.warn("Database error. Could not close database connection. Continuing with " + - "others. - " + e.getMessage(), e); - } - } - } - - /** - * Close ResultSet - * @param resultSet ResultSet - */ - private static void closeResultSet(ResultSet resultSet) { - if (resultSet != null) { - try { - resultSet.close(); - } catch (SQLException e) { - log.warn("Database error. Could not close ResultSet - " + e.getMessage(), e); - } - } - - } - - /** - * Close PreparedStatement - * @param preparedStatement PreparedStatement - */ - private static void closeStatement(PreparedStatement preparedStatement) { - if (preparedStatement != null) { - try { - preparedStatement.close(); - } catch (SQLException e) { - log.warn("Database error. Could not close PreparedStatement. Continuing with" + - " others. - " + e.getMessage(), e); - } - } - - } - - /** - * Return the DBConfiguration - * - * @param config APIManagerConfiguration containing the JDBC settings - * @return DBConfiguration - */ - private static DBConfiguration getDBConfig(APIManagerConfiguration config) { - DBConfiguration dbConfiguration = new DBConfiguration(); - dbConfiguration.setDbUrl(config.getFirstProperty(DB_URL)); - dbConfiguration.setDriverName(config.getFirstProperty(DB_DRIVER)); - dbConfiguration.setUserName(config.getFirstProperty(DB_USER)); - dbConfiguration.setPassword(config.getFirstProperty(DB_PASSWORD)); - return dbConfiguration; - } - - /** - * Function converts IS to String - * Used for handling blobs - * @param is - * @return - */ - public static String getStringFromInputStream(InputStream is) { - BufferedReader br = null; - StringBuilder sb = new StringBuilder(); - - String line; - try { - - br = new BufferedReader(new InputStreamReader(is)); - while ((line = br.readLine()) != null) { - sb.append(line); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (br != null) { - try { - br.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return sb.toString(); - - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DSXMLConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DSXMLConfig.java new file mode 100644 index 00000000000..c8205aea608 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DSXMLConfig.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.wso2.carbon.device.mgt.core.config.datasource; + +import javax.xml.bind.Marshaller; + +public interface DSXMLConfig { + + public Marshaller getDSMarshaller(); + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java new file mode 100644 index 00000000000..5525f9f8968 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2005-2013, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.wso2.carbon.device.mgt.core.config.datasource; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Class for holding data source configuration in rss-config.xml at parsing with JAXB + */ +@XmlRootElement(name = "DataSourceConfiguration") +public class DataSourceConfig { + + private JNDILookupDefinition jndiLookupDefintion; + private RDBMSConfig rdbmsConfig; + + @XmlElement(name = "JndiLookupDefinition", nillable = true) + public JNDILookupDefinition getJndiLookupDefintion() { + return jndiLookupDefintion; + } + + public void setJndiLookupDefintion(JNDILookupDefinition jndiLookupDefintion) { + this.jndiLookupDefintion = jndiLookupDefintion; + } + + @XmlElement(name = "Definition", nillable = true) + public RDBMSConfig getRdbmsConfiguration() { + return rdbmsConfig; + } + + public void setRdbmsConfiguration(RDBMSConfig rdbmsConfig) { + this.rdbmsConfig = rdbmsConfig; + } + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java new file mode 100644 index 00000000000..91b4d5228b4 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2005-2013, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.wso2.carbon.device.mgt.core.config.datasource; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlValue; +import java.util.List; + +/** + * Class for hold JndiLookupDefinition of rss-manager.xml at parsing with JAXB + */ +@XmlRootElement(name = "JndiLookupDefinition") +public class JNDILookupDefinition { + + private String jndiName; + private List jndiProperties; + + @XmlElement(name = "Name", nillable = false) + public String getJndiName() { + return jndiName; + } + + public void setJndiName(String jndiName) { + this.jndiName = jndiName; + } + + @XmlElementWrapper(name = "Environment", nillable = false) + @XmlElement(name = "Property", nillable = false) + public List getJndiProperties() { + return jndiProperties; + } + + public void setJndiProperties(List jndiProperties) { + this.jndiProperties = jndiProperties; + } + + @XmlRootElement(name = "Property") + public static class JNDIProperty { + + private String name; + + private String value; + + @XmlAttribute(name = "Name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlValue + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } + +} + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/RDBMSConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/RDBMSConfig.java new file mode 100644 index 00000000000..3f7bc080a37 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/RDBMSConfig.java @@ -0,0 +1,420 @@ +/* + * Copyright (c) 2013, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.wso2.carbon.device.mgt.core.config.datasource; + +import javax.xml.bind.Marshaller; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlValue; +import java.util.List; + +/** + * Class for hold data source configuration properties at parsing with JAXB + */ +@XmlRootElement(name = "Definition") +public class RDBMSConfig implements DSXMLConfig { + + private String url; + private String driverClassName; + private String username; + private String password; + private Boolean defaultAutoCommit; + private Boolean defaultReadOnly; + private String defaultTransactionIsolation; + private String defaultCatalog; + private Integer maxActive; + private Integer maxIdle; + private Integer minIdle; + private Integer initialSize; + private Integer maxWait; + private Boolean testOnBorrow; + private Boolean testOnReturn; + private Boolean testWhileIdle; + private String validationQuery; + private String validatorClassName; + private Integer timeBetweenEvictionRunsMillis; + private Integer numTestsPerEvictionRun; + private Integer minEvictableIdleTimeMillis; + private Boolean accessToUnderlyingConnectionAllowed; + private Boolean removeAbandoned; + private Integer removeAbandonedTimeout; + private Boolean logAbandoned; + private String connectionProperties; + private String initSQL; + private String jdbcInterceptors; + private Long validationInterval; + private Boolean jmxEnabled; + private Boolean fairQueue; + private Integer abandonWhenPercentageFull; + private Long maxAge; + private Boolean useEquals; + private Integer suspectTimeout; + private Boolean alternateUsernameAllowed; + private String dataSourceClassName; + private List dataSourceProps; + + public RDBMSConfig() { + } + + + @XmlElement(name = "Url", nillable = false) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @XmlElement(name = "DriverClassName", nillable = false) + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + @XmlElement(name = "Username", nillable = false) + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + @XmlElement(name = "Password", nillable = false) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Boolean getDefaultAutoCommit() { + return defaultAutoCommit; + } + + public void setDefaultAutoCommit(Boolean defaultAutoCommit) { + this.defaultAutoCommit = defaultAutoCommit; + } + + public Boolean getDefaultReadOnly() { + return defaultReadOnly; + } + + public void setDefaultReadOnly(Boolean defaultReadOnly) { + this.defaultReadOnly = defaultReadOnly; + } + + public String getDefaultTransactionIsolation() { + return defaultTransactionIsolation; + } + + public void setDefaultTransactionIsolation(String defaultTransactionIsolation) { + this.defaultTransactionIsolation = defaultTransactionIsolation; + } + + public String getDefaultCatalog() { + return defaultCatalog; + } + + public void setDefaultCatalog(String defaultCatalog) { + this.defaultCatalog = defaultCatalog; + } + + public Integer getMaxActive() { + return maxActive; + } + + public void setMaxActive(Integer maxActive) { + this.maxActive = maxActive; + } + + public Integer getMaxIdle() { + return maxIdle; + } + + public void setMaxIdle(Integer maxIdle) { + this.maxIdle = maxIdle; + } + + public Integer getMinIdle() { + return minIdle; + } + + public void setMinIdle(Integer minIdle) { + this.minIdle = minIdle; + } + + public Integer getInitialSize() { + return initialSize; + } + + public void setInitialSize(Integer initialSize) { + this.initialSize = initialSize; + } + + public Integer getMaxWait() { + return maxWait; + } + + public void setMaxWait(Integer maxWait) { + this.maxWait = maxWait; + } + + public Boolean getTestOnBorrow() { + return testOnBorrow; + } + + public void setTestOnBorrow(Boolean testOnBorrow) { + this.testOnBorrow = testOnBorrow; + } + + public Boolean getTestOnReturn() { + return testOnReturn; + } + + public void setTestOnReturn(Boolean testOnReturn) { + this.testOnReturn = testOnReturn; + } + + public Boolean getTestWhileIdle() { + return testWhileIdle; + } + + public void setTestWhileIdle(Boolean testWhileIdle) { + this.testWhileIdle = testWhileIdle; + } + + public String getValidationQuery() { + return validationQuery; + } + + public void setValidationQuery(String validationQuery) { + this.validationQuery = validationQuery; + } + + public String getValidatorClassName() { + return validatorClassName; + } + + public void setValidatorClassName(String validatorClassName) { + this.validatorClassName = validatorClassName; + } + + public Integer getTimeBetweenEvictionRunsMillis() { + return timeBetweenEvictionRunsMillis; + } + + public void setTimeBetweenEvictionRunsMillis(Integer timeBetweenEvictionRunsMillis) { + this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; + } + + public Integer getNumTestsPerEvictionRun() { + return numTestsPerEvictionRun; + } + + public void setNumTestsPerEvictionRun(Integer numTestsPerEvictionRun) { + this.numTestsPerEvictionRun = numTestsPerEvictionRun; + } + + public Integer getMinEvictableIdleTimeMillis() { + return minEvictableIdleTimeMillis; + } + + public void setMinEvictableIdleTimeMillis(Integer minEvictableIdleTimeMillis) { + this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; + } + + public Boolean getAccessToUnderlyingConnectionAllowed() { + return accessToUnderlyingConnectionAllowed; + } + + public void setAccessToUnderlyingConnectionAllowed(Boolean accessToUnderlyingConnectionAllowed) { + this.accessToUnderlyingConnectionAllowed = accessToUnderlyingConnectionAllowed; + } + + public Boolean getRemoveAbandoned() { + return removeAbandoned; + } + + public void setRemoveAbandoned(Boolean removeAbandoned) { + this.removeAbandoned = removeAbandoned; + } + + public Integer getRemoveAbandonedTimeout() { + return removeAbandonedTimeout; + } + + public void setRemoveAbandonedTimeout(Integer removeAbandonedTimeout) { + this.removeAbandonedTimeout = removeAbandonedTimeout; + } + + public Boolean getLogAbandoned() { + return logAbandoned; + } + + public void setLogAbandoned(Boolean logAbandoned) { + this.logAbandoned = logAbandoned; + } + + public String getConnectionProperties() { + return connectionProperties; + } + + public void setConnectionProperties(String connectionProperties) { + this.connectionProperties = connectionProperties; + } + + public String getInitSQL() { + return initSQL; + } + + public void setInitSQL(String initSQL) { + this.initSQL = initSQL; + } + + public String getJdbcInterceptors() { + return jdbcInterceptors; + } + + public void setJdbcInterceptors(String jdbcInterceptors) { + this.jdbcInterceptors = jdbcInterceptors; + } + + public Long getValidationInterval() { + return validationInterval; + } + + public void setValidationInterval(Long validationInterval) { + this.validationInterval = validationInterval; + } + + public Boolean getJmxEnabled() { + return jmxEnabled; + } + + public void setJmxEnabled(Boolean jmxEnabled) { + this.jmxEnabled = jmxEnabled; + } + + public Boolean getFairQueue() { + return fairQueue; + } + + public void setFairQueue(Boolean fairQueue) { + this.fairQueue = fairQueue; + } + + public Integer getAbandonWhenPercentageFull() { + return abandonWhenPercentageFull; + } + + public void setAbandonWhenPercentageFull(Integer abandonWhenPercentageFull) { + this.abandonWhenPercentageFull = abandonWhenPercentageFull; + } + + public Long getMaxAge() { + return maxAge; + } + + public void setMaxAge(Long maxAge) { + this.maxAge = maxAge; + } + + public Boolean getUseEquals() { + return useEquals; + } + + public void setUseEquals(Boolean useEquals) { + this.useEquals = useEquals; + } + + public Integer getSuspectTimeout() { + return suspectTimeout; + } + + public void setSuspectTimeout(Integer suspectTimeout) { + this.suspectTimeout = suspectTimeout; + } + + public Boolean getAlternateUsernameAllowed() { + return alternateUsernameAllowed; + } + + public void setAlternateUsernameAllowed(Boolean alternateUsernameAllowed) { + this.alternateUsernameAllowed = alternateUsernameAllowed; + } + + @XmlElement(name = "DataSourceClassName", nillable = false) + public String getDataSourceClassName() { + return dataSourceClassName; + } + + public void setDataSourceClassName(String dataSourceClassName) { + this.dataSourceClassName = dataSourceClassName; + } + + @XmlElementWrapper(name = "DataSourceProps", nillable = false) + @XmlElement(name = "Property", nillable = false) + public List getDataSourceProps() { + return dataSourceProps; + } + + public void setDataSourceProps(List dataSourceProps) { + this.dataSourceProps = dataSourceProps; + } + + public Marshaller getDSMarshaller() { + return null; + } + + @XmlRootElement(name = "Property") + public static class DataSourceProperty { + + private String name; + + private String value; + + @XmlAttribute(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlValue + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } + +} + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java index aa10e188695..2dbfcfcb72c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java @@ -78,6 +78,11 @@ public class AndroidDeviceManagerService implements DeviceManagerService { return null; } + @Override + public void updateDeviceInfo(Device device) throws DeviceManagementException{ + + } + @Override public void setOwnership(String ownershipType) throws DeviceManagementException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java index cf174c5cf21..f3e613a0b56 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java @@ -78,6 +78,11 @@ public class IOSDeviceManagerService implements DeviceManagerService { return null; } + @Override + public void updateDeviceInfo(Device device) throws DeviceManagementException{ + + } + @Override public void setOwnership(String ownershipType) throws DeviceManagementException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java index 9efa62bb02d..2ee45342373 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java @@ -78,6 +78,11 @@ public class WindowsDeviceManagerService implements DeviceManagerService { return null; } + @Override + public void updateDeviceInfo(Device device) throws DeviceManagementException{ + + } + @Override public void setOwnership(String ownershipType) throws DeviceManagementException { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index f39fe3df818..da740f2c430 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -78,11 +78,6 @@ org.wso2.carbon org.wso2.carbon.logging - - org.wso2.carbon - org.wso2.carbon.logging - ${carbon.kernel.version} - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml new file mode 100644 index 00000000000..ab9bf942f2d --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -0,0 +1,124 @@ + + + + + + + org.wso2.carbon + device-mgt-feature + 2.0.0-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.server.feature + pom + 2.0.0-SNAPSHOT + WSO2 Carbon - Device Management Server Feature + http://wso2.org + This feature contains the core bundles required for Back-end Devvice Management functionality + + + + + org.eclipse.osgi + org.eclipse.osgi + + + org.eclipse.equinox + org.eclipse.equinox.common + + + org.wso2.carbon + org.wso2.carbon.logging + + + org.wso2.carbon + org.wso2.carbon.device.mgt.core + + + org.wso2.carbon + org.wso2.carbon.device.mgt.common + + + + + + + maven-resources-plugin + 2.6 + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + org.wso2.maven + carbon-p2-plugin + ${carbon.p2.plugin.version} + + + p2-feature-generation + package + + p2-feature-gen + + + org.wso2.carbon.device.mgt.server + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:false + + + + org.wso2.carbon:org.wso2.carbon.device.mgt.core:${project.version} + + org.wso2.carbon:org.wso2.carbon.device.mgt.common:${project.version} + + + + org.wso2.carbon.core.server:${carbon.platform.version} + + + + + + + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/build.properties b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/build.properties new file mode 100644 index 00000000000..9c86577d768 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/build.properties @@ -0,0 +1 @@ +custom = true diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/p2.inf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml new file mode 100644 index 00000000000..44b69518064 --- /dev/null +++ b/features/device-mgt/pom.xml @@ -0,0 +1,43 @@ + + + + + + + org.wso2.carbon + wso2cdm-parent + 2.0.0-SNAPSHOT + ../../pom.xml + + + 4.0.0 + org.wso2.carbon + device-mgt-feature + 2.0.0-SNAPSHOT + pom + WSO2 Carbon - Device Management Feature + http://wso2.org + + + org.wso2.carbon.device.mgt.server.feature + + + diff --git a/pom.xml b/pom.xml index b7f40adc0ab..db6e0454223 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,6 @@ http://wso2.org WSO2 Connected Device Manager - org.wso2 wso2 @@ -40,6 +39,7 @@ components/device-mgt components/policy-mgt + features/device-mgt product/modules/p2-profile-gen product/modules/distribution product/modules/integration @@ -48,12 +48,6 @@ - org.wso2.carbon.automation org.wso2.carbon.automation.engine @@ -112,11 +106,34 @@ org.wso2.carbon.utils ${carbon.kernel.version} + org.wso2.carbon - org.wso2.carbon.user.mgt + org.wso2.carbon.logging ${carbon.kernel.version} + + org.wso2.carbon + org.wso2.carbon.device.mgt.core + ${project.version} + + + org.wso2.carbon + org.wso2.carbon.device.mgt.common + ${project.version} + + + + + org.eclipse.osgi + org.eclipse.osgi + ${eclipse.osgi.version} + + + org.eclipse.equinox + org.eclipse.equinox.common + ${eclipse.equinox.common.version} + @@ -128,11 +145,17 @@ 1.3 [1.6.1.wso2v11, 1.7.0) 1.0.0.Final + 1.5.4 4.3.1 6.8 4.3.0-SNAPSHOT 1.1.0 + + + 3.6.100.v20120522-1841 + 3.8.1.v20120830-144521 + \ No newline at end of file diff --git a/product/modules/p2-profile-gen/pom.xml b/product/modules/p2-profile-gen/pom.xml index 9d70de4249b..7883a736403 100644 --- a/product/modules/p2-profile-gen/pom.xml +++ b/product/modules/p2-profile-gen/pom.xml @@ -104,6 +104,9 @@ org.wso2.carbon:org.wso2.carbon.ndatasource.feature:${carbon.kernel.version} + + org.wso2.carbon:org.wso2.carbon.device.mgt.server.feature:${project.version} + @@ -129,11 +132,14 @@ org.wso2.carbon.ndatasource.feature.group ${carbon.kernel.version} - org.wso2.carbon.ndatasource.ui.feature.group ${carbon.kernel.version} + + org.wso2.carbon.device.mgt.server.feature.group + ${project.version} +