A collection of non-Vaadin, non-Liferay utilities.
To build this library use Maven and Java 8:
First compile the project and build an executable java archive:
mvn clean package
Note that you will need java 8. The JAR file will be created in the /target folder:
|-target
|---core-utils-lib-1.0.0-SNAPSHOT.jar
|---...
This is a library and the most common way to use this library in particular is by including it in your pom.xml as a dependency:
<dependency>
<groupId>life.qbic</groupId>
<artifactId>core-utils-lib</artifactId>
<version>X.Y.Z</version>
</dependency>
Finding QBiC service instances from within an application is as easy as this:
// Example in Groovy
def serviceList = []
def serviceRegistryUrl = new Url("https://host-name-of-registry:<port>/v1")
def connector = new ConsulConnector(serviceRegistryUrl)
connector.withCloseable {
ConsulServiceFactory factory = new ConsulServiceFactory(it)
serviceList.addAll(factory.getServicesOfType(ServiceType.SAMPLE_TRACKING))
}
// Example in Java
List serviceList = new ArrayList<>()
Url serviceRegistryUrl = new URL("https://host-name-of-registry:<port>/v1")
try (ConsulConnector connector = new ConsulConnector(serviceRegistryUrl)) {
ConsulServiceFactory factory = new ConsulServiceFactory(connector)
serviceList.addAll(factory.getServicesOfType(ServiceType.SAMPLE_TRACKING))
}
This work is licensed under the MIT license.
Note: This work uses the Micronaut Framework and derivatives from the Micronaut framework family, its which are licensed under Apache 2.0.