Package uk.ac.gda.epics.archiverclient
Class EpicsArchiverClient
java.lang.Object
uk.ac.gda.epics.archiverclient.EpicsArchiverClient
- All Implemented Interfaces:
Findable
Provides access to the EPICS Archiver REST API. Can be used to retrieve the whole record for a given PV, filtered by start and finish dates and times if required, or to
retrieve individual PV values for a given date and time.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Get the object name.getOptionalValueForPv(String pvName, int year, int month, int day, int hour, int minute, int second) Queries the EPICS archiver API for a specific PV's value on a specific date and time.getOptionalValueForPv(String pvName, String dateTime) Queries the EPICS archiver API for a specific PV's value on a specific date and time.getOptionalValueForPv(String pvName, LocalDateTime dateTime) Queries the EPICS archiver API for a specific PV's value on a specific date and time.getRecordForPv(String pvName) Queries the EPICS archiver API for a specific PV name and returns all data.getRecordForPv(String pvName, LocalDateTime from) Queries the EPICS archiver API for a specific PV name and returns all date after the starting time-stamp.getRecordForPv(String pvName, LocalDateTime from, LocalDateTime to) Queries the EPICS archiver API for a specific PV name and returns all data between the start and end time-stamps.doublegetValueForPv(String pvName, int year, int month, int day, int hour, int minute, int second) Queries the EPICS archiver API for a specific PV's value on a specific date and time.doublegetValueForPv(String pvName, String dateTime) Queries the EPICS archiver API for a specific PV's value on a specific date and time.doublegetValueForPv(String pvName, LocalDateTime dateTime) Queries the EPICS archiver API for a specific PV's value on a specific date and time.voidSet or change the name of the object (as defined in XML).
-
Constructor Details
-
EpicsArchiverClient
-
-
Method Details
-
setName
Description copied from interface:FindableSet or change the name of the object (as defined in XML). -
getName
Description copied from interface:FindableGet the object name. Used by Castor to check if the object name has been set before calling theFindable.setName(String)method. -
getRecordForPv
public Optional<EpicsArchiverRecord> getRecordForPv(String pvName) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV name and returns all data.- Parameters:
pvName- - The name of the PV you wish to query the archiver for.- Returns:
- An
EpicsArchiverRecordrepresenting the archived data for the queried PV. - Throws:
EpicsArchiverClientException
-
getRecordForPv
public Optional<EpicsArchiverRecord> getRecordForPv(String pvName, LocalDateTime from) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV name and returns all date after the starting time-stamp.- Parameters:
pvName- - The name of the PV you wish to query the archiver for.from- - The starting date and time from which you would like data.- Returns:
- An
EpicsArchiverRecordrepresenting the archived data for the queried PV. - Throws:
EpicsArchiverClientException
-
getRecordForPv
public Optional<EpicsArchiverRecord> getRecordForPv(String pvName, LocalDateTime from, LocalDateTime to) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV name and returns all data between the start and end time-stamps.- Parameters:
pvName- - The name of the PV you wish to query the archiver for.from- - The starting date and time from which you would like data.to- - The end date and time to which you would like data.- Returns:
- An
EpicsArchiverRecordrepresenting the archived data for the queried PV. - Throws:
EpicsArchiverClientException
-
getOptionalValueForPv
public Optional<Double> getOptionalValueForPv(String pvName, LocalDateTime dateTime) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV's value on a specific date and time.- Parameters:
pvName- - The name of the PV you wish to query the archiver for.dateTime- - The date and time for which you would like the PV value.- Returns:
- An
OptionalofDoublerepresenting the value. - Throws:
EpicsArchiverClientException
-
getOptionalValueForPv
public Optional<Double> getOptionalValueForPv(String pvName, int year, int month, int day, int hour, int minute, int second) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV's value on a specific date and time.- Parameters:
pvName- - The name of the PV you wish to query the archiver foryear- - The year for which you would like the PV value.month- - The month for which you would like the PV value.day- - The day of the month for which you would like the PV value.hour- - The hour of the day for which you would like the PV value.minute- - The minute of the hour for which you would like the PV value.second- - The year for which you would like the PV value.- Returns:
- An
OptionalDoublerepresenting the value. - Throws:
EpicsArchiverClientException
-
getOptionalValueForPv
public Optional<Double> getOptionalValueForPv(String pvName, String dateTime) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV's value on a specific date and time.- Parameters:
pvName- - The name of the PV you wish to query the archiver fordateTime- - The date and time for which you would like the PV value, as a string in the format "yyyy-MM-dd HH:mm:ss".- Returns:
- An
OptionalofDoublerepresenting the value. - Throws:
EpicsArchiverClientException
-
getValueForPv
public double getValueForPv(String pvName, LocalDateTime dateTime) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV's value on a specific date and time. Throws an exception if not found. Using getOptionalValueForPv is probably preferable, these are intended for use over RMI (Optionalis not serializable, or for people who with to use the client from the Jython console and don't want to deal with Optional.- Parameters:
pvName- - The name of the PV you wish to query the archiver for.dateTime- - The date and time for which you would like the PV value.- Returns:
- A double representing the value.
- Throws:
EpicsArchiverClientException
-
getValueForPv
public double getValueForPv(String pvName, int year, int month, int day, int hour, int minute, int second) throws EpicsArchiverClientException Queries the EPICS archiver API for a specific PV's value on a specific date and time. Throws an exception if not found. Using getOptionalValueForPv is probably preferable, these are intended for use over RMI (Optionalis not serializable, or for people who with to use the client from the Jython console and don't want to deal with Optional.- Parameters:
pvName- - The name of the PV you wish to query the archiver foryear- - The year for which you would like the PV value.month- - The month for which you would like the PV value.day- - The day of the month for which you would like the PV value.hour- - The hour of the day for which you would like the PV value.minute- - The minute of the hour for which you would like the PV value.second- - The year for which you would like the PV value.- Returns:
- A double representing the value.
- Throws:
EpicsArchiverClientException
-
getValueForPv
Queries the EPICS archiver API for a specific PV's value on a specific date and time. Throws an exception if not found. Using getOptionalValueForPv is probably preferable, these are intended for use over RMI (Optionalis not serializable, or for people who with to use the client from the Jython console and don't want to deal with Optional.- Parameters:
pvName- - The name of the PV you wish to query the archiver fordateTime- - The date and time for which you would like the PV value, as a string in the format "yyyy-MM-dd HH:mm:ss".- Returns:
- A double representing the value.
- Throws:
EpicsArchiverClientException
-