Skip to content

Commit fa0eeea

Browse files
authored
[CSAPI] Add system query parameter to DataStreams and ControlStreams collection endpoints (#324)
1 parent 850ade0 commit fa0eeea

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/obs/DataStreamHandler.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ protected void buildFilter(final ResourceRef parent, final Map<String, String[]>
141141
{
142142
builder.withObservedProperties(obsProps);
143143
}
144+
145+
// system param
146+
var sysIDs = parseResourceIdsOrUids("system", queryParams, idEncoders.getSystemIdEncoder());
147+
if (sysIDs != null && !sysIDs.isEmpty())
148+
{
149+
if (sysIDs.isUids())
150+
builder.withSystems().withUniqueIDs(sysIDs.getUids()).includeMembers(true).done();
151+
else
152+
builder.withSystems().withInternalIDs(sysIDs.getBigIds()).includeMembers(true).done();
153+
}
144154
}
145155

146156

sensorhub-service-consys/src/main/java/org/sensorhub/impl/service/consys/task/CommandStreamHandler.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ protected void buildFilter(final ResourceRef parent, final Map<String, String[]>
126126
.withInternalIDs(foiIDs)
127127
.done();
128128
}*/
129+
130+
// system param
131+
var sysIDs = parseResourceIdsOrUids("system", queryParams, idEncoders.getSystemIdEncoder());
132+
if (sysIDs != null && !sysIDs.isEmpty())
133+
{
134+
if (sysIDs.isUids())
135+
builder.withSystems().withUniqueIDs(sysIDs.getUids()).includeMembers(true).done();
136+
else
137+
builder.withSystems().withInternalIDs(sysIDs.getBigIds()).includeMembers(true).done();
138+
}
129139
}
130140

131141

0 commit comments

Comments
 (0)