Oracle® Enterprise Data Quality for Product Data Java API Interface Guide Release 5.6.2 Part Number E23725-02 |
|
|
View PDF |
This interface is the provided to access the availability of the Oracle DataLens Servers.
The PingClient
class is used as an interface to the Oracle DataLens Server. This class provides a simple method that returns true if an Oracle DataLens Server is available for processing data and false if it is not.
Import the PingClient
with the following line:
import com.onerealm.solx.api.client.PingClient;
This is a simple test to check the server availability. This can be used prior to sending data to the server for processing.
// Create the Server Api object and point to the server PingClient pingApi = new PingClient(serverName, serverPort); boolean available = pingApi.pingServer("JavaAPI");
This is essentially the same code as in the previous section, just that we are going through a list of Oracle DataLens Servers in a Production Oracle DataLens Server Group and returning the first server that responds.
Iterator iter = serverList.iterator(); while (iter.hasNext()) { String serverNameStr = (String)iter.next(); if (new PingClient(serverName, serverPort).pingServer(userName)) { return serverNameStr; } }