Storage servlet update

This commit is contained in:
Alexander Nozik 2017-05-02 16:57:03 +03:00
parent e8f8d2dcc1
commit 5eb59a9f98
3 changed files with 11 additions and 13 deletions

View File

@ -35,6 +35,4 @@ task runServer(dependsOn: classes, type: JavaExec){
workingDir "D:\\Temp\\test\\"
standardInput = System.in
standardOutput = System.out
}
ratpack.baseDir = file('ratpack')
}

View File

@ -3,7 +3,7 @@ package inr.numass.server;
import hep.dataforge.io.MetaFileReader;
import hep.dataforge.meta.Meta;
import hep.dataforge.meta.SimpleConfigurable;
import hep.dataforge.storage.filestorage.FileStorage;
import inr.numass.storage.NumassStorage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -20,7 +20,7 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable {
private static final String LISTENER_ELEMENT = "listener";
private static final String NUMASS_REPO_PATH_PROPERTY = "numass.repository.path";
private final static Logger logger = LoggerFactory.getLogger("NUMASS-SERVER");
FileStorage root;
NumassStorage root;
NumassServer listener;
public ServerRunner() throws IOException, ParseException {
@ -52,12 +52,12 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable {
public ServerRunner start() throws Exception {
String repoPath = meta().getString(NUMASS_REPO_PATH_PROPERTY, ".");
Meta repoConfig = null;
if (meta().hasMeta(NUMASS_REPO_ELEMENT)) {
repoConfig = meta().getMeta(NUMASS_REPO_ELEMENT);
}
// Meta repoConfig = null;
// if (meta().hasMeta(NUMASS_REPO_ELEMENT)) {
// repoConfig = meta().getMeta(NUMASS_REPO_ELEMENT);
// }
logger.info("Initializing file storage in {}", repoPath);
root = FileStorage.in(new File(repoPath), repoConfig);
root = NumassStorage.buildLocalNumassRoot(new File(repoPath),true);//in(new File(repoPath), repoConfig);
logger.info("Starting numass server");
if (root != null) {
@ -88,7 +88,6 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable {
}
}
if (root != null) {
try {
root.close();

View File

@ -30,7 +30,7 @@
<br/>
<#if serverRootState??>
<div class="container">
<h3> Current root state: </h3>
<h3> Server root state: </h3>
<div class="well well-lg">
${serverRootState}
</div>
@ -38,7 +38,7 @@
</#if>
<br/>
<#if runPresent>
<h2> Current run configuration </h2>
<#-- <h2> Current run configuration </h2>
<#if runMeta??>
<div class="container">
<h3> Run metadata: </h3>
@ -47,6 +47,7 @@
</div>
</div>
</#if>
-->
<#if runState?? >
<div class="container">
<h3> Current run state: </h3>