public abstract class ConditionsReader extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
ConditionsReader.DetectorFileValidator |
Modifier and Type | Field and Description |
---|---|
private static Properties |
aliases |
private static FileCache |
cache |
private static File |
home |
Constructor and Description |
---|
ConditionsReader() |
Modifier and Type | Method and Description |
---|---|
static void |
addAlias(String alias,
String target) |
abstract void |
close() |
(package private) static ConditionsReader |
create(ConditionsManager manager,
String detectorName,
int run)
Creates ConditionsReader to handle the specified detector and
run.
|
(package private) static ConditionsReader |
create(String detectorName,
int run)
Try to find the conditions associated with this detector.
|
static ConditionsReader |
createDummy() |
private static File |
downloadDetectorDescription(URL url) |
static List<String> |
getDetectorNames()
Get a list of available detectors
|
private static Properties |
loadAliases() |
abstract InputStream |
open(String name,
String type) |
private static String |
resolveAlias(String detectorName) |
protected boolean |
update(ConditionsManager manager,
String detectorName,
int run)
Called by
ConditionsManager.setDetector(java.lang.String, int) to tell this reader that
it needs to prepare itself for reading conditions for the specified
detector and run. |
private static Properties aliases
private static final File home
private static FileCache cache
protected boolean update(ConditionsManager manager, String detectorName, int run) throws IOException
ConditionsManager.setDetector(java.lang.String, int)
to tell this reader that
it needs to prepare itself for reading conditions for the specified
detector and run.
The implementation provided by this class returns false if the
specified detector name is equal to the name of the current detector
known to the specified ConditionsManager
, and throws
IllegalArgumentException if it is not. Subclasses need to
override this method if conditions might be different for different runs
with the same detector.
IllegalArgumentException
- if this ConditionsReader cannot
handle the specified detector/run.IOException
- if the reader fails to update for any other reason.public static ConditionsReader createDummy()
private static String resolveAlias(String detectorName) throws IOException
IOException
static ConditionsReader create(String detectorName, int run) throws ConditionsManager.ConditionsNotFoundException
static ConditionsReader create(ConditionsManager manager, String detectorName, int run) throws ConditionsManager.ConditionsNotFoundException
ConditionsManager.ConditionsNotFoundException
- if creation of the reader fails for
any reason.public abstract InputStream open(String name, String type) throws IOException
IOException
public abstract void close() throws IOException
IOException
private static Properties loadAliases()
private static File downloadDetectorDescription(URL url) throws IOException
IOException
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.