Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into access-certification
- Loading branch information
Showing
15 changed files
with
227 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 90 additions & 90 deletions
180
gui/admin-gui/src/main/resources/localization/Midpoint_sk_SK.properties
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 0 additions & 86 deletions
86
repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/CompositeDataSource.java
This file was deleted.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/DataSourceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright (c) 2010-2015 Evolveum | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.evolveum.midpoint.repo.sql; | ||
|
||
import com.evolveum.midpoint.repo.api.RepositoryServiceFactoryException; | ||
import com.evolveum.midpoint.repo.sql.util.MidPointConnectionCustomizer; | ||
import com.evolveum.midpoint.repo.sql.util.MidPointConnectionTester; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.mchange.v2.c3p0.ComboPooledDataSource; | ||
import org.apache.commons.lang.StringUtils; | ||
import org.springframework.jndi.JndiObjectFactoryBean; | ||
|
||
import javax.naming.NamingException; | ||
import javax.sql.DataSource; | ||
import java.beans.PropertyVetoException; | ||
|
||
/** | ||
* @author Viliam Repan (lazyman) | ||
*/ | ||
public class DataSourceFactory { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(DataSourceFactory.class); | ||
|
||
private SqlRepositoryConfiguration configuration; | ||
|
||
public void setConfiguration(SqlRepositoryConfiguration configuration) { | ||
this.configuration = configuration; | ||
} | ||
|
||
public DataSource createDataSource() throws RepositoryServiceFactoryException { | ||
LOGGER.info("Loading datasource."); | ||
if (configuration == null) { | ||
throw new RepositoryServiceFactoryException("SQL configuration is null, couldn't create datasource."); | ||
} | ||
|
||
try { | ||
if (StringUtils.isNotEmpty(configuration.getDataSource())) { | ||
LOGGER.info("JDNI datasource present in configuration, looking for '{}'.", | ||
new Object[]{configuration.getDataSource()}); | ||
return createJNDIDataSource(); | ||
} | ||
|
||
LOGGER.info("Constructing default C3P0 datasource with connection pooling."); | ||
return createC3P0DataSource(); | ||
} catch (Exception ex) { | ||
throw new RepositoryServiceFactoryException("Couldn't initialize datasource, reason: " + ex.getMessage(), ex); | ||
} | ||
} | ||
|
||
private DataSource createJNDIDataSource() throws IllegalArgumentException, NamingException { | ||
JndiObjectFactoryBean factory = new JndiObjectFactoryBean(); | ||
factory.setJndiName(configuration.getDataSource()); | ||
factory.afterPropertiesSet(); | ||
|
||
return (DataSource) factory.getObject(); | ||
} | ||
|
||
private DataSource createC3P0DataSource() throws PropertyVetoException { | ||
ComboPooledDataSource ds = new ComboPooledDataSource(); | ||
ds.setDriverClass(configuration.getDriverClassName()); | ||
ds.setJdbcUrl(configuration.getJdbcUrl()); | ||
ds.setUser(configuration.getJdbcUsername()); | ||
ds.setPassword(configuration.getJdbcPassword()); | ||
|
||
ds.setAcquireIncrement(3); | ||
ds.setMinPoolSize(configuration.getMinPoolSize()); | ||
ds.setMaxPoolSize(configuration.getMaxPoolSize()); | ||
ds.setIdleConnectionTestPeriod(1800); | ||
ds.setConnectionTesterClassName(MidPointConnectionTester.class.getName()); | ||
ds.setConnectionCustomizerClassName(MidPointConnectionCustomizer.class.getName()); | ||
|
||
return ds; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.