Exemple #1
0
 private Response getResponse(MissionInfo info) {
   QueryResponse response = new QueryResponse();
   Snapshot snapshot = info.getSnapshot();
   response.setTime(snapshot.getTimestamp());
   response.setVersion(snapshot.getVersion());
   response.setMinVersion(snapshot.getMinVersion());
   response.setMaxVersion(snapshot.getMaxVersion());
   Report report = snapshot.getReport();
   response.setRunning(info.getState().equals(LAUNCHED));
   response.setReport(Arrays.asList(report.getAllMetrics()));
   return response;
 }
Exemple #2
0
 @Override
 protected Response process(MissionInfo info) {
   if (isStopped(info.getState())) return new Response(false, "mission aleady stopped");
   return getResponse(info);
 }