Skip to content

Commit

Permalink
added getRemoved method on demand from theli for migration purpose
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1195 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Dec 8, 2005
1 parent 61bded0 commit 3086e38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions source/de/anomic/server/serverAbstractSwitch.java
Expand Up @@ -57,6 +57,7 @@ public abstract class serverAbstractSwitch implements serverSwitch {
private final File configFile;
private Map configProps;
private final String configComment;
private Map configRemoved;
private final HashMap authorization;
private String rootPath;
private final TreeMap workerThreads;
Expand All @@ -78,7 +79,8 @@ public serverAbstractSwitch(String rootPath, String initPath, String configPath)
new File(configFile.getParent()).mkdir();

// predefine init's
Map initProps, removedProps = new HashMap();
Map initProps;
configRemoved = new HashMap();
if (initFile.exists())
initProps = serverFileUtils.loadHashMap(initFile);
else
Expand All @@ -98,7 +100,7 @@ public serverAbstractSwitch(String rootPath, String initPath, String configPath)
while (i.hasNext()) {
key = (String) i.next();
if (!(initProps.containsKey(key))) {
removedProps.put(key, this.configProps.get(key));
configRemoved.put(key, this.configProps.get(key));
i.remove();
}
}
Expand Down Expand Up @@ -217,7 +219,11 @@ private void saveConfig() {
}
}


public Map getRemoved() {
// returns configuration that had been removed during initialization
return configRemoved;
}

// add/remove action listener
public void deployAction(String actionName, String actionShortDescription, String actionLongDescription,
serverSwitchAction newAction) {
Expand Down
5 changes: 4 additions & 1 deletion source/de/anomic/server/serverSwitch.java
Expand Up @@ -51,6 +51,8 @@ this is an interface for possible switchboard implementations

import java.net.InetAddress;
import java.util.Iterator;
import java.util.Map;

import de.anomic.server.logging.serverLog;

public interface serverSwitch {
Expand Down Expand Up @@ -93,7 +95,8 @@ public void deployThread(String threadName,
public String getConfig(String key, String dflt);
public long getConfigLong(String key, long dflt);
public Iterator configKeys();

public Map getRemoved();

// the switchboard also shall maintain a job list
// jobs can be queued by submitting a job object
// to work off a queue job, use deQueue, which is meant to
Expand Down

0 comments on commit 3086e38

Please sign in to comment.