Skip to content
Snippets Groups Projects
Verified Commit 489827b2 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: cleanup

parent 4e32b1c8
No related branches found
No related tags found
No related merge requests found
package org.caosdb.server.database.proto; package org.caosdb.server.database.proto;
import java.io.Serializable; import java.io.Serializable;
import java.util.LinkedList; import java.util.List;
/**
* This class is a flat, data-only representation of a single item of version information. This
* class is an intermediate representation which abstracts away the data base results and comes in a
* form which is easily cacheable.
*
* @author Timm Fitschen (t.fitschen@indiscale.com)
*/
public class VersionHistoryItem implements Serializable { public class VersionHistoryItem implements Serializable {
private static final long serialVersionUID = 428030617967255942L; private static final long serialVersionUID = 428030617967255942L;
public String id = null; public String id = null;
public LinkedList<String> parents = null; public List<String> parents = null;
public Long seconds = null; public Long seconds = null;
public Integer nanos = null; public Integer nanos = null;
public String username = null; public String username = null;
......
...@@ -202,10 +202,6 @@ public class Info extends AbstractObservable implements Observer, TransactionInt ...@@ -202,10 +202,6 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
} }
dropOffBox = new File(FileSystem.getDropOffBox()); dropOffBox = new File(FileSystem.getDropOffBox());
final Element info = new Element("Stats"); final Element info = new Element("Stats");
if (CaosDBServer.isDebugMode()) {
info.setAttribute("debug", "true");
}
final Element counts = new Element("counts"); final Element counts = new Element("counts");
counts.setAttribute("records", Integer.toString(recordsCount)); counts.setAttribute("records", Integer.toString(recordsCount));
counts.setAttribute("properties", Integer.toString(propertiesCount)); counts.setAttribute("properties", Integer.toString(propertiesCount));
...@@ -213,16 +209,18 @@ public class Info extends AbstractObservable implements Observer, TransactionInt ...@@ -213,16 +209,18 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
counts.setAttribute("files", Integer.toString(filesCount)); counts.setAttribute("files", Integer.toString(filesCount));
counts.setAttribute("fssize", fssize); counts.setAttribute("fssize", fssize);
counts.setAttribute("tmpfiles", Integer.toString(tmpFilesCount)); counts.setAttribute("tmpfiles", Integer.toString(tmpFilesCount));
if (CaosDBServer.isDebugMode()) {
final Element dropOffBoxElem = new Element("dropOffBox"); counts.setAttribute("debug", "true");
}
final Element e = new Element("dropOffBox");
if (dropOffBox.isDirectory()) { if (dropOffBox.isDirectory()) {
if (dropOffBox.canRead()) { if (dropOffBox.canRead()) {
if (tree) { if (tree) {
dropOffBoxElem.setAttribute("path", dropOffBox.getAbsolutePath()); e.setAttribute("path", dropOffBox.getAbsolutePath());
dropOffBoxElem.addContent(getTree(dropOffBox.listFiles())); e.addContent(getTree(dropOffBox.listFiles()));
} else { } else {
dropOffBoxElem.setAttribute("path", dropOffBox.getAbsolutePath()); e.setAttribute("path", dropOffBox.getAbsolutePath());
dropOffBoxElem.addContent(getFlatList(dropOffBox.listFiles())); e.addContent(getFlatList(dropOffBox.listFiles()));
} }
} else { } else {
// TODO: return a message that the DropOffBox is not readable. // TODO: return a message that the DropOffBox is not readable.
...@@ -232,7 +230,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt ...@@ -232,7 +230,7 @@ public class Info extends AbstractObservable implements Observer, TransactionInt
// present. // present.
} }
info.addContent(counts); info.addContent(counts);
info.addContent(dropOffBoxElem); info.addContent(e);
return info; return info;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment