Skip to content

Commit 9afc568

Browse files
authored
Merge pull request #3448 from ControlSystemStudio/CSSTUDIO-1715
Save&restore auto filter activation
2 parents d762969 + 1f00ba7 commit 9afc568

File tree

12 files changed

+298
-102
lines changed

12 files changed

+298
-102
lines changed

app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreClient.java

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@
1919
package org.phoebus.applications.saveandrestore.client;
2020

2121
import org.phoebus.applications.saveandrestore.SaveAndRestoreClientException;
22-
import org.phoebus.applications.saveandrestore.model.*;
22+
import org.phoebus.applications.saveandrestore.model.CompositeSnapshot;
23+
import org.phoebus.applications.saveandrestore.model.Configuration;
24+
import org.phoebus.applications.saveandrestore.model.ConfigurationData;
25+
import org.phoebus.applications.saveandrestore.model.Node;
26+
import org.phoebus.applications.saveandrestore.model.NodeType;
27+
import org.phoebus.applications.saveandrestore.model.RestoreResult;
28+
import org.phoebus.applications.saveandrestore.model.Snapshot;
29+
import org.phoebus.applications.saveandrestore.model.SnapshotData;
30+
import org.phoebus.applications.saveandrestore.model.SnapshotItem;
31+
import org.phoebus.applications.saveandrestore.model.Tag;
32+
import org.phoebus.applications.saveandrestore.model.TagData;
33+
import org.phoebus.applications.saveandrestore.model.UserData;
2334
import org.phoebus.applications.saveandrestore.model.search.Filter;
2435
import org.phoebus.applications.saveandrestore.model.search.SearchResult;
2536

@@ -77,13 +88,6 @@ public interface SaveAndRestoreClient {
7788
*/
7889
Node createNewNode(String parentsUniqueId, Node node);
7990

80-
/**
81-
* Updates a node, e.g. if user wishes to add or remove tags from a snapshot {@link Node}
82-
*
83-
* @param nodeToUpdate The {@link Node} subject to update.
84-
* @return The updated {@link Node}.
85-
*/
86-
Node updateNode(Node nodeToUpdate);
8791

8892
/**
8993
* Updates a node, e.g. if user wishes to add or remove tags from a snapshot {@link Node}
@@ -128,6 +132,7 @@ public interface SaveAndRestoreClient {
128132

129133
/**
130134
* Constructs a path like string to facilitate location of a {@link Node} in the tree structure.
135+
*
131136
* @param uniqueNodeId Unique id
132137
* @return Path like /Root folder/foo/bar/my/favourite/node
133138
*/
@@ -138,8 +143,9 @@ public interface SaveAndRestoreClient {
138143
/**
139144
* Creates a new {@link Node} of type {@link NodeType#CONFIGURATION} in the remote
140145
* service.
141-
* @param parentNodeId Non-null and non-empty unique id of an existing parent {@link Node},
142-
* which must be of type {@link NodeType#FOLDER}.
146+
*
147+
* @param parentNodeId Non-null and non-empty unique id of an existing parent {@link Node},
148+
* which must be of type {@link NodeType#FOLDER}.
143149
* @param configuration {@link ConfigurationData} object
144150
* @return A representation of the persisted {@link Configuration}.
145151
*/
@@ -152,8 +158,9 @@ public interface SaveAndRestoreClient {
152158

153159
/**
154160
* Creates a {@link Snapshot}
161+
*
155162
* @param parentNodeId The unique id of the configuration {@link Node} associated with the {@link Snapshot}
156-
* @param snapshot The {@link Snapshot} data object.
163+
* @param snapshot The {@link Snapshot} data object.
157164
* @return The new {@link Snapshot} as persisted by the service
158165
*/
159166
Snapshot createSnapshot(String parentNodeId, Snapshot snapshot);
@@ -162,7 +169,8 @@ public interface SaveAndRestoreClient {
162169

163170
/**
164171
* Creates a new {@link CompositeSnapshot}.
165-
* @param parentNodeId The parent {@link Node} for the new {@link CompositeSnapshot}
172+
*
173+
* @param parentNodeId The parent {@link Node} for the new {@link CompositeSnapshot}
166174
* @param compositeSnapshot The data object
167175
* @return A {@link CompositeSnapshot} as persisted by the service.
168176
*/
@@ -172,8 +180,9 @@ public interface SaveAndRestoreClient {
172180
* Utility for the purpose of checking whether a set of snapshots contain duplicate PV names.
173181
* The input snapshot ids may refer to {@link Node}s of types {@link org.phoebus.applications.saveandrestore.model.NodeType#SNAPSHOT}
174182
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
183+
*
175184
* @param snapshotNodeIds List of {@link Node} ids corresponding to {@link Node}s of types {@link org.phoebus.applications.saveandrestore.model.NodeType#SNAPSHOT}
176-
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
185+
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
177186
* @return A list of PV names that occur more than once across the list of {@link Node}s corresponding
178187
* to the input. Empty if no duplicates are found.
179188
*/
@@ -182,20 +191,23 @@ public interface SaveAndRestoreClient {
182191
/**
183192
* Updates a composite snapshot. Note that the list of referenced snapshots must be the full list of wanted
184193
* snapshots, i.e. there is no way to only add new references, or only remove unwanted references.
194+
*
185195
* @param compositeSnapshot A {@link CompositeSnapshot} object hold data.
186196
* @return The updates {@link CompositeSnapshot} object.
187197
*/
188198
CompositeSnapshot updateCompositeSnapshot(CompositeSnapshot compositeSnapshot);
189199

190200
/**
191201
* Search for {@link Node}s based on the specified search parameters.
202+
*
192203
* @param searchParams {@link MultivaluedMap} holding search parameters.
193204
* @return A {@link SearchResult} with potentially empty list of matching {@link Node}s
194205
*/
195206
SearchResult search(MultivaluedMap<String, String> searchParams);
196207

197208
/**
198209
* Save a new or updated {@link Filter}
210+
*
199211
* @param filter The {@link Filter} to save
200212
* @return The saved {@link Filter}
201213
*/
@@ -208,12 +220,14 @@ public interface SaveAndRestoreClient {
208220

209221
/**
210222
* Deletes a {@link Filter} based on its name.
211-
* @param name
223+
*
224+
* @param name Unique name of a {@link Filter}
212225
*/
213226
void deleteFilter(String name);
214227

215228
/**
216229
* Adds a tag to a list of unique node ids, see {@link TagData}
230+
*
217231
* @param tagData see {@link TagData}
218232
* @return A list of updated {@link Node}s. This may contain fewer elements than the list of unique node ids
219233
* passed in the <code>tagData</code> parameter.
@@ -222,6 +236,7 @@ public interface SaveAndRestoreClient {
222236

223237
/**
224238
* Deletes a tag from a list of unique node ids, see {@link TagData}
239+
*
225240
* @param tagData see {@link TagData}
226241
* @return A list of updated {@link Node}s. This may contain fewer elements than the list of unique node ids
227242
* passed in the <code>tagData</code> parameter.
@@ -230,6 +245,7 @@ public interface SaveAndRestoreClient {
230245

231246
/**
232247
* For the purpose of login and authentication in the service.
248+
*
233249
* @param userName User's account name
234250
* @param password User's password
235251
* @return A {@link UserData} object if login is successful, otherwise implementation should throw
@@ -239,20 +255,23 @@ public interface SaveAndRestoreClient {
239255

240256
/**
241257
* Requests service to restore the specified {@link SnapshotItem}s
258+
*
242259
* @param snapshotItems A {@link List} of {@link SnapshotItem}s
243260
* @return A @{@link List} of {@link RestoreResult}s with information on potentially failed {@link SnapshotItem}s.
244261
*/
245262
List<RestoreResult> restore(List<SnapshotItem> snapshotItems);
246263

247264
/**
248265
* Requests service to restore the specified snapshot.
266+
*
249267
* @param snapshotNodeId Unique id of a snapshot
250268
* @return A @{@link List} of {@link RestoreResult}s with information on potentially failed {@link SnapshotItem}s.
251269
*/
252270
List<RestoreResult> restore(String snapshotNodeId);
253271

254272
/**
255273
* Requests service to take a snapshot.
274+
*
256275
* @param configurationNodeId The unique id of the {@link Configuration} for which to take the snapshot
257276
* @return A {@link List} of {@link SnapshotItem}s carrying snapshot values read by the service.
258277
*/

app/save-and-restore/app/src/main/java/org/phoebus/applications/saveandrestore/client/SaveAndRestoreClientImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.time.Duration;
4343
import java.util.Base64;
4444
import java.util.List;
45+
import java.util.Set;
4546
import java.util.logging.Level;
4647
import java.util.logging.Logger;
4748

@@ -155,11 +156,6 @@ public Node createNewNode(String parentsUniqueId, Node node) {
155156
}
156157
}
157158

158-
@Override
159-
public Node updateNode(Node nodeToUpdate) {
160-
return updateNode(nodeToUpdate, false);
161-
}
162-
163159
@Override
164160
public Node updateNode(Node nodeToUpdate, boolean customTimeForMigration) {
165161
try {

0 commit comments

Comments
 (0)