forked from community/device-mgt-plugins
commit
23938f5e0b
@ -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();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -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();
|
||||||
|
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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<JNDIProperty> 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<JNDIProperty> getJndiProperties() {
|
||||||
|
return jndiProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJndiProperties(List<JNDIProperty> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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<DataSourceProperty> 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<DataSourceProperty> getDataSourceProps() {
|
||||||
|
return dataSourceProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataSourceProps(List<DataSourceProperty> 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
~
|
||||||
|
~ Licensed 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>device-mgt-feature</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<name>WSO2 Carbon - Device Management Server Feature</name>
|
||||||
|
<url>http://wso2.org</url>
|
||||||
|
<description>This feature contains the core bundles required for Back-end Devvice Management functionality
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.osgi</groupId>
|
||||||
|
<artifactId>org.eclipse.osgi</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.equinox</groupId>
|
||||||
|
<artifactId>org.eclipse.equinox.common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.logging</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources</id>
|
||||||
|
<phase>generate-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>src/main/resources</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>build.properties</include>
|
||||||
|
<include>p2.inf</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.wso2.maven</groupId>
|
||||||
|
<artifactId>carbon-p2-plugin</artifactId>
|
||||||
|
<version>${carbon.p2.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>p2-feature-generation</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>p2-feature-gen</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<id>org.wso2.carbon.device.mgt.server</id>
|
||||||
|
<propertiesFile>../../../features/etc/feature.properties</propertiesFile>
|
||||||
|
<adviceFile>
|
||||||
|
<properties>
|
||||||
|
<propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
|
||||||
|
<propertyDef>org.eclipse.equinox.p2.type.group:false</propertyDef>
|
||||||
|
</properties>
|
||||||
|
</adviceFile>
|
||||||
|
<bundles>
|
||||||
|
<bundleDef>org.wso2.carbon:org.wso2.carbon.device.mgt.core:${project.version}
|
||||||
|
</bundleDef>
|
||||||
|
<bundleDef>org.wso2.carbon:org.wso2.carbon.device.mgt.common:${project.version}
|
||||||
|
</bundleDef>
|
||||||
|
</bundles>
|
||||||
|
<importFeatures>
|
||||||
|
<importFeatureDef>org.wso2.carbon.core.server:${carbon.platform.version}
|
||||||
|
</importFeatureDef>
|
||||||
|
</importFeatures>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1 @@
|
|||||||
|
custom = true
|
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ 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.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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>wso2cdm-parent</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.wso2.carbon</groupId>
|
||||||
|
<artifactId>device-mgt-feature</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<name>WSO2 Carbon - Device Management Feature</name>
|
||||||
|
<url>http://wso2.org</url>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>org.wso2.carbon.device.mgt.server.feature</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
</project>
|
Loading…
Reference in new issue