package org.yamcs.xtce;

import java.io.FileWriter;
import java.io.IOException;
import java.io.RandomAccessFile;

import org.yamcs.ConfigurationException;
/**
 * Database "loader" that simply creates an empty SpaceSystem with the given name
 * 
 * @author nm
 *
 */
public class EmptyNodeLoader implements SpaceSystemLoader {
    final String name;
    public EmptyNodeLoader(String name) {
        this.name = name;
    }
    @Override
    public SpaceSystem load() throws ConfigurationException, DatabaseLoadException {
        return new SpaceSystem(name);
    }

    @Override
    public boolean needsUpdate(RandomAccessFile consistencyDateFile) throws IOException, ConfigurationException {
        return false;
    }

    @Override
    public String getConfigName() throws ConfigurationException {
        return name;
    }

    @Override
    public void writeConsistencyDate(FileWriter consistencyDateFile) throws IOException {
        //intentionally left empty
    }

}

@@ -105,16 +105,38 @@
 essFile;
+%0Aimport java.util.Map;
 %0A%0Aimport
@@ -170,16 +170,50 @@
 eption;%0A
+import org.yamcs.YConfiguration;%0A%0A
 /**%0A * D
@@ -375,16 +375,17 @@
 oader %7B%0A
+%0A
     fina
@@ -395,24 +395,142 @@
 tring name;%0A
+%0A    public EmptyNodeLoader(Map%3CString, Object%3E args) %7B%0A        name = YConfiguration.getString(args, %22name%22);%0A    %7D%0A%0A
     public E
@@ -585,22 +585,23 @@
 = name;%0A
-
     %7D%0A
+%0A
     @Ove
@@ -1115,16 +1115,17 @@
       //
+ 
 intentio
@@ -1147,11 +1147,10 @@
 y%0A    %7D%0A
-%0A
 %7D%0A

Support map-based constructor in EmptyNodeLoader