Skip to content

Commit 97e887f

Browse files
authored
Merge pull request #3481 from JMit-dev/plan-manager
Bluesky plan manager implementation
2 parents 83a4d9e + 5e2d635 commit 97e887f

File tree

14 files changed

+1581
-275
lines changed

14 files changed

+1581
-275
lines changed

app/queue-server/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,11 @@
3434
<artifactId>jackson-dataformat-yaml</artifactId>
3535
<version>2.19.1</version>
3636
</dependency>
37+
<dependency>
38+
<groupId>org.apache.poi</groupId>
39+
<artifactId>poi</artifactId>
40+
<version>5.0.0</version>
41+
<scope>compile</scope>
42+
</dependency>
3743
</dependencies>
38-
</project>
44+
</project>

app/queue-server/src/main/java/org/phoebus/applications/queueserver/client/RunEngineService.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public final class RunEngineService {
3434
/* ---- Ping & status --------------------------------------------------- */
3535

3636
public Envelope<?> ping() throws Exception { return http.call(ApiEndpoint.PING, NoBody.INSTANCE); }
37-
public StatusResponse status() throws Exception {
37+
public StatusResponse status() throws Exception {
3838
LOG.log(Level.FINEST, "Fetching status");
39-
return http.send(ApiEndpoint.STATUS, NoBody.INSTANCE, StatusResponse.class);
39+
return http.send(ApiEndpoint.STATUS, NoBody.INSTANCE, StatusResponse.class);
4040
}
4141
public Envelope<?> configGet() throws Exception { return http.call(ApiEndpoint.CONFIG_GET, NoBody.INSTANCE); }
4242

@@ -136,6 +136,22 @@ public Envelope<?> queueItemAddBatch(List<QueueItem> items,
136136
public Envelope<?> queueItemAddBatch(QueueItemMoveBatch body ) throws Exception { return http.call(ApiEndpoint.QUEUE_ITEM_ADD_BATCH, body); }
137137
public Envelope<?> queueItemGet(Object params ) throws Exception { return http.call(ApiEndpoint.QUEUE_ITEM_GET, params); }
138138
public Envelope<?> queueItemUpdate(Object b ) throws Exception { return http.call(ApiEndpoint.QUEUE_ITEM_UPDATE, b); }
139+
140+
public Envelope<?> queueItemUpdate(QueueItem item) throws Exception {
141+
Map<String, Object> updateRequest = Map.of(
142+
"item", Map.of(
143+
"item_type", item.itemType(),
144+
"name", item.name(),
145+
"args", item.args(),
146+
"kwargs", item.kwargs(),
147+
"item_uid", item.itemUid()
148+
),
149+
"user", item.user() != null ? item.user() : "GUI Client",
150+
"user_group", item.userGroup() != null ? item.userGroup() : "primary",
151+
"replace", true
152+
);
153+
return queueItemUpdate(updateRequest);
154+
}
139155
public Envelope<?> queueItemRemove(Object b ) throws Exception { return http.call(ApiEndpoint.QUEUE_ITEM_REMOVE, b); }
140156
public Envelope<?> queueItemRemoveBatch(Object b) throws Exception {return http.call(ApiEndpoint.QUEUE_ITEM_REMOVE_BATCH,b); }
141157
public Envelope<?> queueItemMove(Object b ) throws Exception { return http.call(ApiEndpoint.QUEUE_ITEM_MOVE, b); }
@@ -234,9 +250,9 @@ public Envelope<?> rePause(String option) throws Exception {
234250
/* ---- Permissions & allowed lists ------------------------------------ */
235251

236252
public Envelope<?> plansAllowed() throws Exception { return http.call(ApiEndpoint.PLANS_ALLOWED, NoBody.INSTANCE); }
237-
public Map<String, Object> plansAllowedRaw() throws Exception {
253+
public Map<String, Object> plansAllowedRaw() throws Exception {
238254
LOG.log(Level.FINE, "Fetching plans allowed (raw)");
239-
return http.send(ApiEndpoint.PLANS_ALLOWED, NoBody.INSTANCE);
255+
return http.send(ApiEndpoint.PLANS_ALLOWED, NoBody.INSTANCE);
240256
}
241257
public Envelope<?> devicesAllowed() throws Exception { return http.call(ApiEndpoint.DEVICES_ALLOWED, NoBody.INSTANCE); }
242258
public Envelope<?> plansExisting() throws Exception { return http.call(ApiEndpoint.PLANS_EXISTING, NoBody.INSTANCE); }
@@ -276,4 +292,4 @@ public Map<String, Object> plansAllowedRaw() throws Exception {
276292
public Envelope<?> whoAmI() throws Exception { return http.call(ApiEndpoint.WHOAMI, NoBody.INSTANCE); }
277293
public Envelope<?> apiScopes() throws Exception { return http.call(ApiEndpoint.API_SCOPES, NoBody.INSTANCE); }
278294
public Envelope<?> logout() throws Exception { return http.call(ApiEndpoint.LOGOUT, NoBody.INSTANCE); }
279-
}
295+
}

0 commit comments

Comments
 (0)