Skip to content

Commit

Permalink
Check in the archivePV lists etc.
Browse files Browse the repository at this point in the history
This call is principally intended for use in automation. If the IOC engn
gives us a list of PVs, we use this call to quickly check what's not
being archived.
  • Loading branch information
slacmshankar committed Jun 9, 2017
1 parent 996603f commit 0252df4
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -28,8 +29,8 @@
* Of course, you can use the status call but that makes calls to the engine etc and can be stressful if you are checking several thousand PVs
* All this does is check the configservice...
*
* @epics.BPLAction - Given a list of PVs, determine those that are not being archived/have pending requests.
* @epics.BPLActionParam pv - A list of pv names. Send as a CSV using a POST.
* @epics.BPLAction - Given a list of PVs, determine those that are not being archived/have pending requests/have aliases.
* @epics.BPLActionParam pv - A list of pv names. Send as a CSV using a POST or JSON array.
* @epics.BPLActionEnd
*
* @author mshankar
Expand Down Expand Up @@ -64,7 +65,18 @@ public void execute(HttpServletRequest req, HttpServletResponse resp, ConfigServ
if(typeInfo != null) {
if(Arrays.asList(typeInfo.getArchiveFields()).contains(fieldName)) continue;
}
String fieldAliasRealName = configService.getRealNameForAlias(PVNames.stripFieldNameFromPVName(pvName));
if(fieldAliasRealName != null) {
typeInfo = configService.getTypeInfoForPV(fieldAliasRealName);
if(typeInfo != null) {
if(Arrays.asList(typeInfo.getArchiveFields()).contains(fieldName)) continue;
}
}
}
// Check for pending requests...
Set<String> workFlowPVs = configService.getArchiveRequestsCurrentlyInWorkflow();
if(workFlowPVs.contains(PVNames.normalizePVName(pvName)) || (aliasRealName != null && workFlowPVs.contains(aliasRealName))) continue;

// Think we've tried every possible use cases..
unarchivedPVs.add(pvName);
}
Expand Down

0 comments on commit 0252df4

Please sign in to comment.