Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor

Christian Bauer0f859d8cfaf2
diff --git a/README.md b/README.md
index a7d3ee441..539931c1c 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,8 @@ This is the platform project of OpenRemote, where we integrate services and code
TODO: Document other projects
+WORK IN PROGRESS:
+
```
docker-compose -p myproject -f profile/dependencies/postgresql.yml -f profile/dependencies/keycloak.yml up
@@ -41,3 +43,7 @@ org.openremote.ccs.Server#main()
GET localhost:8080/master/command/controller/123
(Should result in 403 NOT ALLOWED)
```
+
+```
+./gradlew -p controller clean test
+```
\ No newline at end of file
diff --git a/controller/src/main/java/org/openremote/controller/command/builtin/VirtualCommand.java b/controller/src/main/java/org/openremote/controller/command/builtin/VirtualCommand.java
index db61fa377..4c9c7f6e3 100644
--- a/controller/src/main/java/org/openremote/controller/command/builtin/VirtualCommand.java
+++ b/controller/src/main/java/org/openremote/controller/command/builtin/VirtualCommand.java
@@ -57,7 +57,7 @@ public class VirtualCommand implements ExecutableCommand, PullCommand {
*
* @param address arbitrary address string that is used to store the command parameter in
* memory
- * @param command command name TODO (not used)
+ * @param command command name TODO (not used) (The whole virtual command makes not much sense...)
* @param commandParam command parameter value -- stored as a virtual device state value in
* memory and can be later retrieved using this command's {@link #read}
* method.
@@ -79,7 +79,7 @@ public class VirtualCommand implements ExecutableCommand, PullCommand {
*/
@Override
public void send(String arg) {
- // TODO arg
+ // TODO What's with the arg? Never used?
if (commandParam == null) {
virtualDevices.put(address, command);
} else {
diff --git a/controller/src/main/java/org/openremote/controller/context/DataContext.java b/controller/src/main/java/org/openremote/controller/context/DataContext.java
index 5edc551a1..7f6b8fb6a 100644
--- a/controller/src/main/java/org/openremote/controller/context/DataContext.java
+++ b/controller/src/main/java/org/openremote/controller/context/DataContext.java
@@ -6,7 +6,7 @@ import org.openremote.controller.event.EventProcessorChain;
import org.openremote.controller.model.Deployment;
import org.openremote.controller.model.Sensor;
-`import java.util.Map;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -21,10 +21,6 @@ public class DataContext {
final protected Map<Integer, Sensor> sensors = new ConcurrentHashMap<>();
final protected StateStorage stateStorage = new InMemoryStateStorage();
- /**
- * Used to indicate if the data context is in the middle of a shut down process -- this
- * flag can be used by methods to fail-fast in such cases.
- */
private volatile Boolean isShutdownInProcess = false;
public DataContext(Deployment deployment, EventProcessorChain eventProcessorChain) {
diff --git a/controller/src/main/java/org/openremote/controller/context/StateStorage.java b/controller/src/main/java/org/openremote/controller/context/StateStorage.java
index 1d8112657..1c7e96787 100644
--- a/controller/src/main/java/org/openremote/controller/context/StateStorage.java
+++ b/controller/src/main/java/org/openremote/controller/context/StateStorage.java
@@ -10,7 +10,7 @@ public interface StateStorage {
SensorState get(int sensorID);
- /* TODO For offset publishing/polling
+ /* TODO For polling/pushing to external system we need to be able to continue processing events from a known offset
Iterator<SensorState> getSince(int timestamp);
Iterator<SensorState> getSince(int timestamp, int sensorID);
diff --git a/controller/src/main/java/org/openremote/controller/event/CustomStateEvent.java b/controller/src/main/java/org/openremote/controller/event/CustomStateEvent.java
index 7347e90a8..189963516 100644
--- a/controller/src/main/java/org/openremote/controller/event/CustomStateEvent.java
+++ b/controller/src/main/java/org/openremote/controller/event/CustomStateEvent.java
@@ -51,7 +51,7 @@ public class CustomStateEvent extends Event<String> {
@Override
public CustomStateEvent clone(String newValue) {
- // TODO
+ // TODO What is this?
throw new Error("NYI");
}
diff --git a/controller/src/main/java/org/openremote/controller/model/Sensor.java b/controller/src/main/java/org/openremote/controller/model/Sensor.java
index 8b38ecdd0..4b08d592d 100644
--- a/controller/src/main/java/org/openremote/controller/model/Sensor.java
+++ b/controller/src/main/java/org/openremote/controller/model/Sensor.java
@@ -165,6 +165,8 @@ public abstract class Sensor {
/**
* Handles the {@link PullCommand#read(Sensor)} polling.
+ *
+ * TODO This is a major problem, every PullCommand uses a separate thread, we have hundreds of threads!
*/
private class SensorReader implements Runnable {
diff --git a/controller/src/main/java/org/openremote/controller/rules/RangeFacade.java b/controller/src/main/java/org/openremote/controller/rules/RangeFacade.java
index 734a629a6..8ee468b4d 100644
--- a/controller/src/main/java/org/openremote/controller/rules/RangeFacade.java
+++ b/controller/src/main/java/org/openremote/controller/rules/RangeFacade.java
@@ -10,7 +10,7 @@ public class RangeFacade extends SingleValueEventFacade<RangeFacade.RangeAdapter
@Override
protected RangeEvent createDefaultEvent(int sourceID, String sourceName) {
- // TODO We drop the min/max here, not good
+ // TODO We drop the min/max here? This leads to events that don't restrict boundaries...
return new RangeEvent(sourceID, sourceName, 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
}