A Java client query API library for MYA (JLab's EPICS Archiver).
The Jeffeson Lab EPICS archiver is named MYA, and was designed with command line and C++ APIs. This library provides a native Java API for querying MYA. If you are looking for a quick and easy way to obtain MYA data see: Public MYA Web Service, which is built using this API plus myquery.
- Grab project
git clone https://github.com/JeffersonLab/jmyapi
cd jmyapi
- Launch Compose
docker compose up
- Run hello app
gradlew hello
The library requires a Java 8+ JVM and standard library at run time, plus has a dependency on the MariaDB database driver.
You can obtain the jmyapi jar file from the Maven Central repository (or Sonatype Backing Store) directly or from a Maven friendly build tool with the following coordinates (Gradle example shown):
implementation 'org.jlab:jmyapi:<version>'
Check the Release Notes to see what has changed in each version.
jmyapi/src/test/java/org/jlab/mya/HelloWorld.java
Lines 27 to 47 in 36e9f0b
A deployments.properties file must be included in the runtime classpath to indicate the host names of MYA servers. A template for the properties can be found here.
A credentials.properties file must be included in the runtime classpath to indicate the MariaDB username and password to use. A template for the properties can be found here.
Note: An alternative is to use a JNDI DataSource via the PooledNexus instead of using the OnDemandNexus with a credentials file. A PooledNexus is often used with an application server such as Tomcat. See DataSource Notes.
If the environment variable JMYAPI_USE_PROXY=true
then the proxy hostnames defined in deployments.properties will be used instead of the normal hostnames. This is specifically used when running jmyapi on a localhost workstation with mya inside a docker bridged network.
This project is built with Java 17 (compiled to Java 8 bytecode), and uses the Gradle 7 build tool to automatically download dependencies and build the project from source:
git clone https://github.com/JeffersonLab/jmyapi
cd jmyapi
gradlew build
Note: If you do not already have Gradle installed, it will be installed automatically by the wrapper script included in the source
Note: Jefferson Lab has an intercepting proxy
You can use the pre-configured .devcontainer else Install and Build directly on a local workstation.
The unit tests run automatically upon build. Integration tests are separate and require a docker compose environment (MariaDB database).
- Launch Docker:
docker compose up
- Run integration tests (on localhost forwarded ports):
gradlew localIntegrationTest
gradlew integrationTest
- Bump the version number in the VERSION file and commit and push to GitHub (using Semantic Versioning).
- The CD GitHub Action should run automatically invoking:
- The Create release GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details.
- The Publish artifact GitHub Action to create a deployment artifact on maven central.
- The Publish docs GitHub Action to create javadocs.