Skip to content
Stable

This component is complete and can be used. The interfaces will be supported until the function is removed from the project via the deprecation process. There will be ongoing extensions to this function, but it will be done to ensure backward compatibility as far as possible. If there is a need to break backward compatibility, this will be discussed and reviewed in the community, with a documented timeline.

Platform Operation Services

The platform operation services provide the APIs for querying the OMAG Server Platform and discovering information about the OMAG Servers that it is hosting. Its client is called PlatformServicesClientand it is located in the platform-services-client module.

Each Java client has multiple constructors. The constructors set up the connection to the OMAG Server Platform. The parameters are passed in different combinations to control security and logging.

  • platformName - the descriptive name of the OMAG Server Platform for error logging.
  • platformURLRoot - the platform url root of the OMAG Server Platform.
  • auditLog - logging destination for audit log messages.
  • userId - this is the optional userId that is embedded in all REST calls. Think of it as the client's user Id rather than the userId of the end user.
  • password - this is the password that goes with the client's userId. The userId and password should both be supplied or neither.
  • maxPageSize - controls the maximum number of results that can be returned on any call. If this is not set, the max page size is controlled platform-side.
  • restClient - inside the java client is a REST API connector that manages the marshalling and de-marshalling of the requests into the HTTP protocol used by REST. Normally this connector is created by the client, but this parameter enables an externally created connector to be used instead.

The constructor may throw InvalidParameterException if there is an issue setting up the client-side components based on the supplied parameters. Pick the constructor that matches the parameters you have. For example, if you call the constructor that supports the client's userId and password and you pass null in these parameters, the exception is thrown.

Below is an example of the code used to construct the PlatformServicesClient.

Example: Creating a platform services client
1
PlatformServicesClient platformServicesClient = new PlatformServicesClient("MyPlatform", platformURLRoot);

Platform origin

Once the client is created, use it to call the API it offers which is documented using Javadoc. For example, the code below queries the platform origin. This indicates the release of Egeria that is running in the platform.

Example: Retrieving the platform origin
1
String platformOrigin = platformServicesClient.getPlatformOrigin(clientUserId);

Registered services

It is also possible to list the registered services that are available in the platform.

Example: Retrieving the registered services
1
2
3
4
List<RegisteredOMAGService> registeredOMASs = platformServicesClient.getAccessServices(clientUserId);
List<RegisteredOMAGService> registeredOMESs = platformServicesClient.getEngineServices(clientUserId);
List<RegisteredOMAGService> registeredOMISs = platformServicesClient.getIntegrationServices(clientUserId);
List<RegisteredOMAGService> registeredOMVSs = platformServicesClient.getViewServices(clientUserId);

Each entry in RegisteredOMAGService details:

  • serviceId - the component identifier used by the service when it registers with the audit log.
  • serviceName - the name of the service.
  • serviceDevelopmentStatus - the status of the service.
  • serviceURLMarker - the unique string used in this service's REST API path names.
  • serviceDescription - the description of the service.
  • serviceWiki - the page in Egeria's documentation that provides more detail of the service.

Known servers

The known servers are those servers that have run on the platform since it started. The getKnownServers method returns a list of server names which is useful for stepping through each of the servers in a for loop.

Example: Retrieving the list of known servers
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
List<String> serverList = platformServicesClient.getKnownServers(clientUserId);

if (serverList != null)
{
    for (String serverName : serverList)
    {
        if (serverName != null)
        {
           /*
            * Add code here
            */
       }
    }
}

Active servers

The active servers are those servers running on the platform. The getActiveServers returns a list of names of the servers running when the request was made.

Example: Retrieving the list of active servers
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
List<String> serverList = platformServicesClient.getActiveServers(clientUserId);

if (serverList != null)
{
    for (String serverName : serverList)
    {
        if (serverName != null)
        {
            /*
             * Add code here
             */
        }
    }
}

Once you have the serverName, you can query the status of an OMAG Server running on the platform:

Example: Retrieving a server's status
1
ServerStatus platformServerStatus = platformServicesClient.getServerStatus(clientUserId, serverName);

The platformServerStatus returned includes:

  • serverName - Name of the server.
  • isActive - Boolean flag indicating whether it is active (running) on the server.
  • serverStartTime - The most recent date/time that the server started.
  • serverEndTime - The most recent date/time that the server stopped.
  • serverHistory - The list of start and stop times for the previous restarts of the server.

This helps to ascertain when the server was available.

Back to top