Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Dynamic configuration alternative (File based) #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Ignore the MVN compiled output directories from version tracking
target/

## Ignore project files created by Eclipse
.settings/
.project
.classpath

## Ignore project files created by IntelliJ IDEA
*.iml
*.ipr
*.iws
.idea/

## Ignore project files created by NetBeans
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
META-INF/
5 changes: 5 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.8</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.services;

import java.util.List;

import org.apache.commons.configuration.event.ConfigurationListener;

/**
* Dynamic Configuration Service API
*
* @author DSpace @ Lyncode
*/
public interface DynamicConfigurationService {
// Main Configuration File API
public Object getProperty (String key);
public String getDescription (String key);
public boolean setProperty (String key, Object value);
public String getString (String key, String defaultValue);
public int getInt (String key, int defaultValue);
public long getLong (String key, long defaultValue);
public boolean getBoolean (String key, boolean defaultValue);
public List<String> getList (String key);
public void addConfigurationListener (ConfigurationListener listener);

// Modules Configuration API
public Object getModuleProperty (String module, String key);
public String getModuleDescription (String module, String key);
public boolean setModuleProperty (String module, String key, Object value);
public String getModuleString (String module, String key, String defaultValue);
public int getModuleInt (String module, String key, int defaultValue);
public long getModuleLong (String module, String key, long defaultValue);
public boolean getModuleBoolean (String module, String key, boolean defaultValue);
public List<String> getModuleList (String module, String key);
public void addModuleConfigurationListener (String module, ConfigurationListener listener);

// Addon Configuration API
public Object getAddonProperty (String addon, String key);
public String getAddonDescription (String addon, String key);
public boolean setAddonProperty (String addon, String key, Object value);
public String getAddonString (String addon, String key, String defaultValue);
public long getAddonLong (String addon, String key, long defaultValue);
public int getAddonInt (String addon, String key, int defaultValue);
public boolean getAddonBoolean (String addon, String key, boolean defaultValue);
public List<String> getAddonList (String addon, String key);
public void addAddonConfigurationListener (String addon, ConfigurationListener listener);
public boolean createAddonConfiguration (String addon);
public boolean addProperty (String addon, String key, Object value, String description);
}
5 changes: 5 additions & 0 deletions impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.8</version>
</dependency>
</dependencies>

<build>
Expand Down
Loading