Skip to content

Commit 495ecc4

Browse files
committed
Support for auto filter activation
1 parent 02d9894 commit 495ecc4

File tree

17 files changed

+221
-510
lines changed

17 files changed

+221
-510
lines changed

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

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,23 @@
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

2637
import javax.ws.rs.core.MultivaluedMap;
27-
import java.util.Collections;
2838
import java.util.List;
29-
import java.util.Set;
3039

3140
/**
3241
* Implementations of this interface shall handle the communication to the save-and-restore service.
@@ -123,6 +132,7 @@ public interface SaveAndRestoreClient {
123132

124133
/**
125134
* Constructs a path like string to facilitate location of a {@link Node} in the tree structure.
135+
*
126136
* @param uniqueNodeId Unique id
127137
* @return Path like /Root folder/foo/bar/my/favourite/node
128138
*/
@@ -133,8 +143,9 @@ public interface SaveAndRestoreClient {
133143
/**
134144
* Creates a new {@link Node} of type {@link NodeType#CONFIGURATION} in the remote
135145
* service.
136-
* @param parentNodeId Non-null and non-empty unique id of an existing parent {@link Node},
137-
* 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}.
138149
* @param configuration {@link ConfigurationData} object
139150
* @return A representation of the persisted {@link Configuration}.
140151
*/
@@ -147,8 +158,9 @@ public interface SaveAndRestoreClient {
147158

148159
/**
149160
* Creates a {@link Snapshot}
161+
*
150162
* @param parentNodeId The unique id of the configuration {@link Node} associated with the {@link Snapshot}
151-
* @param snapshot The {@link Snapshot} data object.
163+
* @param snapshot The {@link Snapshot} data object.
152164
* @return The new {@link Snapshot} as persisted by the service
153165
*/
154166
Snapshot createSnapshot(String parentNodeId, Snapshot snapshot);
@@ -157,7 +169,8 @@ public interface SaveAndRestoreClient {
157169

158170
/**
159171
* Creates a new {@link CompositeSnapshot}.
160-
* @param parentNodeId The parent {@link Node} for the new {@link CompositeSnapshot}
172+
*
173+
* @param parentNodeId The parent {@link Node} for the new {@link CompositeSnapshot}
161174
* @param compositeSnapshot The data object
162175
* @return A {@link CompositeSnapshot} as persisted by the service.
163176
*/
@@ -167,8 +180,9 @@ public interface SaveAndRestoreClient {
167180
* Utility for the purpose of checking whether a set of snapshots contain duplicate PV names.
168181
* The input snapshot ids may refer to {@link Node}s of types {@link org.phoebus.applications.saveandrestore.model.NodeType#SNAPSHOT}
169182
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
183+
*
170184
* @param snapshotNodeIds List of {@link Node} ids corresponding to {@link Node}s of types {@link org.phoebus.applications.saveandrestore.model.NodeType#SNAPSHOT}
171-
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
185+
* and {@link org.phoebus.applications.saveandrestore.model.NodeType#COMPOSITE_SNAPSHOT}
172186
* @return A list of PV names that occur more than once across the list of {@link Node}s corresponding
173187
* to the input. Empty if no duplicates are found.
174188
*/
@@ -177,20 +191,23 @@ public interface SaveAndRestoreClient {
177191
/**
178192
* Updates a composite snapshot. Note that the list of referenced snapshots must be the full list of wanted
179193
* snapshots, i.e. there is no way to only add new references, or only remove unwanted references.
194+
*
180195
* @param compositeSnapshot A {@link CompositeSnapshot} object hold data.
181196
* @return The updates {@link CompositeSnapshot} object.
182197
*/
183198
CompositeSnapshot updateCompositeSnapshot(CompositeSnapshot compositeSnapshot);
184199

185200
/**
186201
* Search for {@link Node}s based on the specified search parameters.
202+
*
187203
* @param searchParams {@link MultivaluedMap} holding search parameters.
188204
* @return A {@link SearchResult} with potentially empty list of matching {@link Node}s
189205
*/
190206
SearchResult search(MultivaluedMap<String, String> searchParams);
191207

192208
/**
193209
* Save a new or updated {@link Filter}
210+
*
194211
* @param filter The {@link Filter} to save
195212
* @return The saved {@link Filter}
196213
*/
@@ -203,12 +220,14 @@ public interface SaveAndRestoreClient {
203220

204221
/**
205222
* Deletes a {@link Filter} based on its name.
223+
*
206224
* @param name Unique name of a {@link Filter}
207225
*/
208226
void deleteFilter(String name);
209227

210228
/**
211229
* Adds a tag to a list of unique node ids, see {@link TagData}
230+
*
212231
* @param tagData see {@link TagData}
213232
* @return A list of updated {@link Node}s. This may contain fewer elements than the list of unique node ids
214233
* passed in the <code>tagData</code> parameter.
@@ -217,6 +236,7 @@ public interface SaveAndRestoreClient {
217236

218237
/**
219238
* Deletes a tag from a list of unique node ids, see {@link TagData}
239+
*
220240
* @param tagData see {@link TagData}
221241
* @return A list of updated {@link Node}s. This may contain fewer elements than the list of unique node ids
222242
* passed in the <code>tagData</code> parameter.
@@ -225,6 +245,7 @@ public interface SaveAndRestoreClient {
225245

226246
/**
227247
* For the purpose of login and authentication in the service.
248+
*
228249
* @param userName User's account name
229250
* @param password User's password
230251
* @return A {@link UserData} object if login is successful, otherwise implementation should throw
@@ -234,30 +255,25 @@ public interface SaveAndRestoreClient {
234255

235256
/**
236257
* Requests service to restore the specified {@link SnapshotItem}s
258+
*
237259
* @param snapshotItems A {@link List} of {@link SnapshotItem}s
238260
* @return A @{@link List} of {@link RestoreResult}s with information on potentially failed {@link SnapshotItem}s.
239261
*/
240262
List<RestoreResult> restore(List<SnapshotItem> snapshotItems);
241263

242264
/**
243265
* Requests service to restore the specified snapshot.
266+
*
244267
* @param snapshotNodeId Unique id of a snapshot
245268
* @return A @{@link List} of {@link RestoreResult}s with information on potentially failed {@link SnapshotItem}s.
246269
*/
247270
List<RestoreResult> restore(String snapshotNodeId);
248271

249272
/**
250273
* Requests service to take a snapshot.
274+
*
251275
* @param configurationNodeId The unique id of the {@link Configuration} for which to take the snapshot
252276
* @return A {@link List} of {@link SnapshotItem}s carrying snapshot values read by the service.
253277
*/
254278
List<SnapshotItem> takeSnapshot(String configurationNodeId);
255-
256-
default String getAutoSelectedFilter(){
257-
return null;
258-
}
259-
260-
default Set<String> getAutoFilterSelectorNames(){
261-
return Collections.emptySet();
262-
}
263279
}

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,4 @@ private HttpResponse<String> getCall(String relativeUrl) {
694694
throw new RuntimeException(e);
695695
}
696696
}
697-
698-
@Override
699-
public String getAutoSelectedFilter(){
700-
HttpResponse<String> response = getCall("/filter/selected");
701-
return response.body();
702-
}
703-
704-
@Override
705-
public Set<String> getAutoFilterSelectorNames(){
706-
return getCall("/filter/selectors", new TypeReference<>() {
707-
});
708-
}
709697
}

0 commit comments

Comments
 (0)