Rename Recorder.getModelsRecording to Recorder.getModels
This commit is contained in:
parent
2dd8100a97
commit
198a9c6893
|
@ -279,11 +279,11 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
|
|||
}
|
||||
|
||||
private void pauseAll(ActionEvent evt) {
|
||||
new PauseAction(getTabPane(), recorder.getModelsRecording(), recorder).execute();
|
||||
new PauseAction(getTabPane(), recorder.getModels(), recorder).execute();
|
||||
}
|
||||
|
||||
private void resumeAll(ActionEvent evt) {
|
||||
new ResumeAction(getTabPane(), recorder.getModelsRecording(), recorder).execute();
|
||||
new ResumeAction(getTabPane(), recorder.getModels(), recorder).execute();
|
||||
}
|
||||
|
||||
void initializeUpdateService() {
|
||||
|
@ -343,7 +343,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
|
|||
LOG.trace("Updating recorded models");
|
||||
List<Recording> recordings = recorder.getRecordings();
|
||||
List<Model> onlineModels = recorder.getOnlineModels();
|
||||
return recorder.getModelsRecording()
|
||||
return recorder.getModels()
|
||||
.stream()
|
||||
.map(m -> new JavaFxModel(m))
|
||||
.peek(fxm -> {
|
||||
|
|
|
@ -253,7 +253,7 @@ public class ActionSettingsPanel extends TitledPane {
|
|||
|
||||
Label l = new Label("Models");
|
||||
layout.add(l, 0, row);
|
||||
modelSelectionPane = new ListSelectionPane<Model>(recorder.getModelsRecording(), Collections.emptyList());
|
||||
modelSelectionPane = new ListSelectionPane<Model>(recorder.getModels(), Collections.emptyList());
|
||||
layout.add(modelSelectionPane, 1, row++);
|
||||
GridPane.setValignment(l, VPos.TOP);
|
||||
GridPane.setHgrow(modelSelectionPane, Priority.ALWAYS);
|
||||
|
|
|
@ -289,7 +289,7 @@ public class LocalRecorder implements Recorder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Model> getModelsRecording() {
|
||||
public List<Model> getModels() {
|
||||
lock.lock();
|
||||
try {
|
||||
return Collections.unmodifiableList(new ArrayList<>(models));
|
||||
|
@ -300,7 +300,7 @@ public class LocalRecorder implements Recorder {
|
|||
|
||||
@Override
|
||||
public List<Model> getOnlineModels() {
|
||||
return getModelsRecording()
|
||||
return getModels()
|
||||
.stream()
|
||||
.filter(m -> {
|
||||
try {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class OnlineMonitor extends Thread {
|
|||
running = true;
|
||||
while (running) {
|
||||
Instant begin = Instant.now();
|
||||
List<Model> models = recorder.getModelsRecording();
|
||||
List<Model> models = recorder.getModels();
|
||||
|
||||
// remove models, which are not recorded anymore
|
||||
for (Iterator<Model> iterator = states.keySet().iterator(); iterator.hasNext();) {
|
||||
|
|
|
@ -17,12 +17,17 @@ public interface Recorder {
|
|||
public void switchStreamSource(Model model) throws IOException, InvalidKeyException, NoSuchAlgorithmException, IllegalStateException;
|
||||
|
||||
/**
|
||||
* Returns, if a model is in the list of models to record. This does not reflect, if there currently is a recording running. The model might be offline
|
||||
* Returns true, if a model is in the list of models to record. This does not reflect, if there currently is a recording running. The model might be offline
|
||||
* aswell.
|
||||
*/
|
||||
public boolean isRecording(Model model);
|
||||
|
||||
public List<Model> getModelsRecording();
|
||||
/**
|
||||
* Get the list of all models, which are tracked by ctbrec
|
||||
*
|
||||
* @return a List of Model objects, which might be empty
|
||||
*/
|
||||
public List<Model> getModels();
|
||||
|
||||
public List<Recording> getRecordings() throws IOException, InvalidKeyException, NoSuchAlgorithmException, IllegalStateException;
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ public class RemoteRecorder implements Recorder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Model> getModelsRecording() {
|
||||
public List<Model> getModels() {
|
||||
if(!lastSync.equals(Instant.EPOCH) && lastSync.isBefore(Instant.now().minusSeconds(60))) {
|
||||
throw new RuntimeException("Last sync was over a minute ago");
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class RecorderServlet extends AbstractCtbrecServlet {
|
|||
case "list":
|
||||
resp.getWriter().write("{\"status\": \"success\", \"msg\": \"List of models\", \"models\": [");
|
||||
JsonAdapter<Model> modelAdapter = new ModelJsonAdapter();
|
||||
List<Model> models = recorder.getModelsRecording();
|
||||
List<Model> models = recorder.getModels();
|
||||
for (Iterator<Model> iterator = models.iterator(); iterator.hasNext();) {
|
||||
Model model = iterator.next();
|
||||
resp.getWriter().write(modelAdapter.toJson(model));
|
||||
|
|
Loading…
Reference in New Issue