public String getString( String key, String defaultValue ) { String value = lookupRegistry.getString( key, defaultValue ); return value; }
public Collection<String> getKeys() { return this.registry.getSubset( PREFIX ).getFullKeys(); } }
private void addRegistryChangeListener(RegistryListener listener) { Registry section = registry.getSection(KEY + ".user"); if (section != null) { section.addChangeListener(listener); } section = registry.getSection(KEY + ".base"); if (section != null) { section.addChangeListener(listener); } }
private Registry readDefaultConfiguration() { // if it contains some old configuration, remove it (Archiva 0.9) registry.removeSubset(KEY); try { registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY); this.isConfigurationDefaulted = true; } catch (RegistryException e) { throw new ConfigurationRuntimeException( "Fatal error: Unable to find the built-in default configuration and load it into the registry", e); } return registry.getSubset(KEY); }
private NetworkConfiguration readNetworkConfiguration( String prefix, Registry registry ) { NetworkConfiguration value = new NetworkConfiguration(); int maxTotal = registry.getInt( prefix + "maxTotal", value.getMaxTotal() ); value.setMaxTotal( maxTotal ); int maxTotalPerHost = registry.getInt( prefix + "maxTotalPerHost", value.getMaxTotalPerHost() ); value.setMaxTotalPerHost( maxTotalPerHost ); boolean usePooling = registry.getBoolean( prefix + "usePooling", value.isUsePooling() ); value.setUsePooling( usePooling ); return value; }
@Override public void reload() { this.configuration = null; try { this.registry.initialize(); } catch (RegistryException e) { throw new ConfigurationRuntimeException(e.getMessage(), e); } this.initialize(); }
public int getInt( String key, int defaultValue ) { return lookupRegistry.getInt( key, defaultValue ); }
public boolean getBoolean( String key ) { return lookupRegistry.getBoolean( key ); }
@SuppressWarnings("unchecked") public List<String> getList( String key ) { return lookupRegistry.getList( key ); }
public static Result submit() { User user = User.getCurrentUser(); if (user == null) return unauthorized("You must log in"); modelForm = modelForm.bindFromRequest(); if (modelForm.hasErrors()) { return badRequest(views.html.Registry.form.render(modelForm)); } // At this point you have a logged User obj which is not null, // you have modelForm without errors (checked previously) // so you need to only add the user to form and save it. Registry registry = modelForm.get(); registry.creationUser = user; registry.save(); flash("success", "Twój log został zapisany w bazie."); return redirect(routes.Index.index()); }
private Registry readDefaultOnlyConfiguration() { registry.removeSubset(KEY_DEFAULT_ONLY); try { registry.addConfigurationFromResource("org/apache/archiva/configuration/default-archiva.xml", KEY_DEFAULT_ONLY); } catch (RegistryException e) { throw new ConfigurationRuntimeException( "Fatal error: Unable to find the built-in default configuration and load it into the registry", e); } return registry.getSubset(KEY_DEFAULT_ONLY); }
public String getString( String key ) { return lookupRegistry.getString( key ); }
private FileLockConfiguration readFileLockConfiguration( String prefix, Registry registry ) { FileLockConfiguration value = new FileLockConfiguration(); boolean skipLocking = registry.getBoolean( prefix + "skipLocking", value.isSkipLocking() ); value.setSkipLocking( skipLocking ); int lockingTimeout = registry.getInt( prefix + "lockingTimeout", value.getLockingTimeout() ); value.setLockingTimeout( lockingTimeout ); return value; }
public int getInt( String key ) { return lookupRegistry.getInt( key ); }
private void addRegistryChangeListener( RegistryListener listener ) { Registry section = registry.getSection( KEY + ".user" ); if ( section != null ) { section.addChangeListener( listener ); } section = registry.getSection( KEY + ".base" ); if ( section != null ) { section.addChangeListener( listener ); } }
public boolean getBoolean( String key, boolean defaultValue ) { return lookupRegistry.getBoolean( key, defaultValue ); }
private String removeExpressions(String directory) { String value = StringUtils.replace(directory, "${appserver.base}", registry.getString("appserver.base", "${appserver.base}")); value = StringUtils.replace(value, "${appserver.home}", registry.getString("appserver.home", "${appserver.home}")); return value; }
private CacheConfiguration readCacheConfiguration( String prefix, Registry registry ) { CacheConfiguration value = new CacheConfiguration(); int timeToIdleSeconds = registry.getInt( prefix + "timeToIdleSeconds", value.getTimeToIdleSeconds() ); value.setTimeToIdleSeconds( timeToIdleSeconds ); int timeToLiveSeconds = registry.getInt( prefix + "timeToLiveSeconds", value.getTimeToLiveSeconds() ); value.setTimeToLiveSeconds( timeToLiveSeconds ); int maxElementsInMemory = registry.getInt( prefix + "maxElementsInMemory", value.getMaxElementsInMemory() ); value.setMaxElementsInMemory( maxElementsInMemory ); int maxElementsOnDisk = registry.getInt( prefix + "maxElementsOnDisk", value.getMaxElementsOnDisk() ); value.setMaxElementsOnDisk( maxElementsOnDisk ); return value; }
private RepositoryCheckPath readRepositoryCheckPath( Registry registry ) { RepositoryCheckPath value = new RepositoryCheckPath(); String url = registry.getString( "url", value.getUrl() ); value.setUrl( url ); String path = registry.getString( "path", value.getPath() ); value.setPath( path ); return value; }