Search in sources :

Example 16 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class AutoExportTrigger method updateDataRegistrations.

private void updateDataRegistrations(Set<String> newNamesToWatch) {
    // make a list of the registrations that have changed
    Set<String> unneededNames;
    Set<String> newNames;
    synchronized (this) {
        unneededNames = setDiff(listeningToDataNames, newNamesToWatch);
        newNames = setDiff(newNamesToWatch, listeningToDataNames);
        this.listeningToDataNames = newNamesToWatch;
    }
    // stop listening to any elements we no longer care about.
    DataRepository data = ctx.getData();
    for (String oneName : unneededNames) data.removeDataListener(oneName, this);
    // begin listening to any newly identified data elements.
    for (String oneName : newNames) data.addDataListener(oneName, this, true);
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository)

Example 17 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class OpenTimeLogEditor method getAugmentedHierarchy.

private DashHierarchy getAugmentedHierarchy() {
    // create a copy of the standard hierarchy
    DashHierarchy result = new DashHierarchy(getPSPProperties().dataPath);
    result.copy(getPSPProperties());
    // find the leaves in the hierarchy, and augment each leaf with
    // supplementary children provided from data element specifications
    DataRepository data = getDataRepository();
    Enumeration<PropertyKey> leaves = result.getLeaves(PropertyKey.ROOT);
    while (leaves.hasMoreElements()) {
        PropertyKey leaf = leaves.nextElement();
        augmentHierarchy(result, leaf, data);
    }
    return result;
}
Also used : DashHierarchy(net.sourceforge.processdash.hier.DashHierarchy) DataRepository(net.sourceforge.processdash.data.repository.DataRepository) PropertyKey(net.sourceforge.processdash.hier.PropertyKey)

Example 18 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class MoveProjectWizard method getSimpleValue.

/** Get a value from the data repository. */
private SimpleData getSimpleValue(String name) {
    DataRepository data = getDataRepository();
    String prefix = getPrefix();
    if (prefix == null)
        prefix = "";
    String dataName = DataRepository.createDataName(prefix, name);
    SimpleData d = data.getSimpleValue(dataName);
    return d;
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository) SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 19 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class MoveProjectWizard method putValue.

private void putValue(String name, SimpleData dataValue) {
    DataRepository data = getDataRepository();
    String prefix = getPrefix();
    if (prefix == null)
        prefix = "";
    String dataName = DataRepository.createDataName(prefix, name);
    data.putValue(dataName, dataValue);
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository)

Example 20 with DataRepository

use of net.sourceforge.processdash.data.repository.DataRepository in project processdash by dtuma.

the class MigrationToolTeam method migrate.

public void migrate() throws Exception {
    File dataFile = getRootDataFile();
    makeExtraBackup();
    System.out.println("Starting migration of team project '" + projectPath + "'");
    DataRepository data = ctx.getData();
    data.closeDatafile(projectPath);
    migrateDatafileContents(dataFile);
    data.openDatafile(projectPath, dataFile.getPath());
    System.out.println("Finished migrating team project '" + projectPath + "'");
}
Also used : DataRepository(net.sourceforge.processdash.data.repository.DataRepository) File(java.io.File)

Aggregations

DataRepository (net.sourceforge.processdash.data.repository.DataRepository)37 SimpleData (net.sourceforge.processdash.data.SimpleData)11 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)4 IOException (java.io.IOException)3 ListData (net.sourceforge.processdash.data.ListData)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 StringData (net.sourceforge.processdash.data.StringData)2 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1