public Repository createConnection(Map<String, Object> properties) throws RRepositoryException { return RepositoryFactoryInstatiator.newFactory(properties, true); }
String type = designMode ? DESIGN_REPOSITORY : PRODUCTION_REPOSITORY; String className = get(cfg, type + "factory"); String login = get(cfg, type + "login"); String password = get(cfg, type + "password"); String uri = get(cfg, type + "uri"); String privateKay = get(cfg, "repository.encode.decode.key"); try { password = PassCoder.decode(password, privateKay); if (entry.getKey().startsWith(type)) { String key = entry.getKey().substring(type.length()); params.put(toCamelCase(key), entry.getValue().toString()); } catch (Exception e) { String message = "Failed to initialize repository: " + className; log().error(message, e); throw new RRepositoryException(message, e);
private Repository createFactory(String propertiesFileName) throws RRepositoryException { ConfigurationManager configurationManager = configManagerFactory.getConfigurationManager(propertiesFileName); Map<String, Object> properties = configurationManager.getProperties(); return RepositoryFactoryInstatiator.newFactory(properties, false); }
private Repository createFactory(String propertiesFileName) throws RRepositoryException { ConfigurationManager configurationManager = configManagerFactory.getConfigurationManager(propertiesFileName); Map<String, Object> properties = configurationManager.getProperties(); return RepositoryFactoryInstatiator.newFactory(properties, false); }
public void deployInternal(File zipFile, Map<String, Object> properties, boolean skipExist) throws Exception { Repository deployRepo = null; try { // Initialize repo deployRepo = RepositoryFactoryInstatiator.newFactory(properties, false); String includeVersion = (String) properties.get(VERSION_IN_DEPLOYMENT_NAME); String deployPath = (String) properties.get(DEPLOY_PATH_PROPERTY); if (deployPath == null) { deployPath = "deploy/"; // Workaround for backward compatibility. } deployInternal(zipFile, deployRepo, skipExist, Boolean.valueOf(includeVersion), deployPath); } finally { // Close repo if (deployRepo != null) { if (deployRepo instanceof Closeable) { // Close repo connection after validation IOUtils.closeQuietly((Closeable) deployRepo); } } } } public void deployInternal(File zipFile,
private void validateConnectionToDesignRepo(RepositoryConfiguration designRepositoryConfiguration) throws RepositoryValidationException { try { Map<String, Object> config = designRepositoryConfiguration.getProperties(); Repository repository = RepositoryFactoryInstatiator.newFactory(config, true); if (repository instanceof Closeable) { // Release resources after validation IOUtils.closeQuietly((Closeable) repository); } } catch (RRepositoryException e) { Throwable rootCause = ExceptionUtils.getRootCause(e); String message = "Incorrect Design Repository configuration: " + (rootCause == null ? e.getMessage() : rootCause.getMessage()); throw new RepositoryValidationException(message, e); } }
Repository repository = RepositoryFactoryInstatiator.newFactory(repoConfig.getProperties(), false); if (repository instanceof Closeable) {
Repository repository = RepositoryFactoryInstatiator.newFactory(repoConfig.getProperties(), false); if (repository instanceof Closeable) {
RepositoryConfiguration adminConfig = this.createAdminRepositoryConfiguration(); Repository repository = RepositoryFactoryInstatiator.newFactory(adminConfig.getProperties(), false);
RepositoryConfiguration adminConfig = this.createAdminRepositoryConfiguration(); Repository repository = RepositoryFactoryInstatiator.newFactory(adminConfig.getProperties(), false);