Package com.tangosol.discovery
Class PingRequest
java.lang.Object
com.tangosol.discovery.PingRequest
Make a ping request to a Coherence proxy server.
 
Example: java com.tangosol.discovery.PingRequest -host proxyhost.mycompany.com -port 9000 -list
If the list option is specified, the program returns a hash value and a list of the IP socket addresses of the members of the proxy service in the Coherence cluster. For example: Addresses-hash: 1974466772 Address-list: [192.110.1.12:9910, 192:110:1:22:9990] Coherence proxy service ping succeeded Otherwise, the program returns the following message, indicating the proxy server is healthy: Coherence proxy service ping succeeded If the ping request fails, it returns error. For example: An exception occurred while executing the PingRequest: java.net.ConnectException: Connection refused Coherence proxy service ping failed If the ping request is sent to an older version of Coherence proxy server that does not support the returning of a list of IP socket addresses, the ping request is successful, but there is no list returned: Coherence proxy service ping succeeded
command options:
- host the host of the proxy server to send the ping request
- port the listen port of the proxy server
- name the proxy service name
- cluster the cluster name
- timeout (optional) the timeout (in seconds) of the ping request, default 30s
- list (optional) return a list of the address:port of the members in the proxy service, seperated by ','
Example: java com.tangosol.discovery.PingRequest -host proxyhost.mycompany.com -port 9000 -list
If the list option is specified, the program returns a hash value and a list of the IP socket addresses of the members of the proxy service in the Coherence cluster. For example: Addresses-hash: 1974466772 Address-list: [192.110.1.12:9910, 192:110:1:22:9990] Coherence proxy service ping succeeded Otherwise, the program returns the following message, indicating the proxy server is healthy: Coherence proxy service ping succeeded If the ping request fails, it returns error. For example: An exception occurred while executing the PingRequest: java.net.ConnectException: Connection refused Coherence proxy service ping failed If the ping request is sent to an older version of Coherence proxy server that does not support the returning of a list of IP socket addresses, the ping request is successful, but there is no list returned: Coherence proxy service ping succeeded
- Since:
- Coherence 12.2.1
- Author:
- lh 2014.04.17
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionPingRequest(String sHost, int nPort, String sName, String sCluster, int cTimeout, boolean fList) Construct the PingRequest.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidIssue a proxy server ping request.static longmakeCheckSumHash(byte[] input) Given a byte array, return its checksum hash.protected static voidReport error and display the command-line instructions.booleannsLookup()booleanping()Run the PingRequest.static CollectionreadCollection(DataInputStream inputStream) Read a POF Collection of strings.protected static voidDisplay the command-line instructions.
- 
Field Details- 
COMMAND_HELP- See Also:
 
- 
COMMAND_HOST- See Also:
 
- 
COMMAND_PORT- See Also:
 
- 
COMMAND_NAME- See Also:
 
- 
COMMAND_CLUSTER- See Also:
 
- 
COMMAND_TIMEOUT- See Also:
 
- 
COMMAND_LIST- See Also:
 
- 
DEFAULT_TIMEOUTpublic static final int DEFAULT_TIMEOUT- See Also:
 
- 
PING_SUCCEEDED- See Also:
 
- 
PING_FAILED- See Also:
 
- 
VALID_COMMANDS
 
- 
- 
Constructor Details- 
PingRequestpublic PingRequest(String sHost, int nPort, String sName, String sCluster, int cTimeout, boolean fList) Construct the PingRequest.- Parameters:
- sHost- host of the proxy server
- nPort- listen port of the proxy service
- sName- the proxy service name
- sCluster- the cluster name
- cTimeout- ping timeout, in seconds
- fList- whether to return a list of the address:port of the proxy servers in the proxy service.
 
 
- 
- 
Method Details- 
mainIssue a proxy server ping request.- Parameters:
- asArg- command line parameter array
 
- 
missingArgumentsprotected static void missingArguments()Report error and display the command-line instructions.
- 
showInstructionsprotected static void showInstructions()Display the command-line instructions.
- 
pingRun the PingRequest.- Returns:
- true if the ping is successful; false otherwise.
- Throws:
- IOException- if an I/O error occurs while reading from the socket stream
 
- 
makeCheckSumHashpublic static long makeCheckSumHash(byte[] input) Given a byte array, return its checksum hash.- Parameters:
- input- input byte array to make checksum from
- Returns:
- the checksum hash of the input data
 
- 
readCollectionRead a POF Collection of strings.- Parameters:
- inputStream- socket input stream
- Returns:
- Collection read
- Throws:
- IOException- if an I/O error occurs while reading from the socket stream
 
- 
nsLookup- Throws:
- IOException
 
 
-