Page tree
Skip to end of metadata
Go to start of metadata

Methods

  • CRUD
    • get(serviceId)
    • add(Service)
    • update(serviceId, Service)
    • delete(serviceId)
  • Querying Catalog
    • getServices(page, perPage)
  • Search / Filtering
    • findService(path, operation, value)
    • findServices(path, operation, value, page, perPage)

Implementation

A Java-based implementation is available and can be used by applications as follows:

add following maven artifact into your project:

maven artifact
<dependency>
    <groupId>eu.linksmart.lc</groupId>
    <artifactId>service-catalog-client</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

In case, Maven is not a preferred build environment then service-catalog-client jar can be downloaded from LinkSmart® repository, to configure into build path of the application.

set URL of the catalog service by calling following static method of ServiceCatalog class:

ServiceCatalog.setURL("http://hostname:port/base_path");

use ServiceBuilder utility class to create Registration object to add into service catalog:

  • create service registration object from a json file
Registration registration = ServiceBuilder.createRegistration(String jsonFileName);
  • create a service registration for given ID & Name for protocol type REST
Registration registration = ServiceBuilder.createRegistration(String serverID, String serviceName, String URL);

Alternatively, the Registration instance can be instantiated and populated directly for required configuration and data values.

to add a service registration:

ServiceCatalog.add(registration);

to get a given Service:

Service service = ServiceCatalog.get(serviceID);

to update a given service:


ServiceCatalog.update(serviceID, registration);

to delete a given service:

ServiceCatalog.delete(serviceID);


to get registered services as SCatalog:

SCatalog catalog = ServiceCatalog.getServices(page, perPage);


to find a service for a given criteria:

Service service = ServiceCatalog.findService(path, criteria, value);

to find services for a given criteria:

SCatalog catalog = ServiceCatalog.findServices(path, criteria, value, page, perPage);
  • No labels