use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TaskListDataWatcher method addTaskListNames.
private void addTaskListNames(ExportedDataValue val) {
SimpleData d = val.getSimpleValue();
if (!d.test())
return;
ListData list = null;
if (d instanceof ListData)
list = (ListData) d;
else if (d instanceof StringData)
list = ((StringData) d).asList();
if (list != null)
for (int i = 0; i < list.size(); i++) taskListNames.add(list.get(i));
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class ExportManager method getExportInstructionFromData.
private AbstractInstruction getExportInstructionFromData(String name) {
if (!name.endsWith("/" + EXPORT_DATANAME))
return null;
SimpleData dataVal = data.getSimpleValue(name);
if (dataVal == null || !dataVal.test())
return null;
String filename = Settings.translateFile(dataVal.format());
String path = name.substring(0, name.length() - EXPORT_DATANAME.length() - 1);
Vector filter = new Vector();
filter.add(path);
ExportMetricsFileInstruction instr = new ExportMetricsFileInstruction(filename, filter);
instr.setAttribute(DATANAME_ATTR, name);
String instrDataname = name + EXPORT_INSTRUCTIONS_SUFFIX;
SimpleData instrVal = data.getSimpleValue(instrDataname);
if (instrVal != null && instrVal.test())
addXmlDataToInstruction(instr, instrVal.format());
String disableDataname = name + EXPORT_DISABLED_SUFFIX;
SimpleData disableVal = data.getSimpleValue(disableDataname);
if (disableVal != null && disableVal.test())
instr.setEnabled(false);
String urlDataname = name + EXPORT_URL_SUFFIX;
SimpleData urlVal = data.getSimpleValue(urlDataname);
if (urlVal != null && urlVal.test())
instr.setServerUrl(urlVal.format());
return instr;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class ExportJanitor method startOneTimeExportOperation.
/**
* Some export operations are performed manually by the user and are not
* intended for repeated execution. When we fail to see a repeat of such
* an operation in the future, we should not interpret it as an indication
* that the manually exported file is obsolete. This method is used to
* frame the beginning of such an operation.
*/
public void startOneTimeExportOperation() {
SimpleData histList = data.getSimpleValue(HISTORICALLY_EXPORTED_DATANAME);
if (histList instanceof ListData)
histList = new ListData((ListData) histList);
this.originalHistList = histList;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TinyCGIBase method getPostToken.
/**
* Retrieve the token that was previously generated by
* {@link #generatePostToken(String)}
*
* @param dataNameSuffix the suffix that was used to generate the token
* @since 1.14.0.1
*/
protected String getPostToken(String dataNameSuffix) {
String dataName = getPostTokenDataName(dataNameSuffix);
SimpleData storedToken = getDataRepository().getSimpleValue(dataName);
SimpleData storedDate = getDataRepository().getSimpleValue(dataName + "/TS");
if (storedToken != null && storedDate instanceof DateData) {
DateData date = (DateData) storedDate;
long age = System.currentTimeMillis() - date.getValue().getTime();
if (age > 0 && age < getPostTokenAgeTimeout())
return storedToken.format();
}
return null;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TimingMetricsRecorderTest method assertStartTime.
private void assertStartTime(String path, Date s) {
String dataName = path + "/Started";
SimpleData d = data.getSimpleValue(dataName);
if (d == null && s == null)
return;
assertTrue(d instanceof DateData);
DateData w = (DateData) d;
assertEquals(s, w.getValue());
}
Aggregations