Package com.santaba.agent.groovyapi.ping
Class Ping
- java.lang.Object
-
- com.santaba.agent.groovyapi.ping.Ping
-
public class Ping extends java.lang.Object
A helper class to execute a ping operation.
As the java ping is not non-admin, there will use the sbproxy ping to implement it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Ping.PingResult
-
Constructor Summary
Constructors Constructor Description Ping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Ping.PingResult
exec(java.lang.String hostname, int pktsToSend, int timeoutInMs)
execute a ping operation with hostname, pktsToSend and timeoutInMs providedstatic Ping.PingResult
exec(java.net.InetAddress address, int pktsToSend, int timeoutInMs)
execute a ping operation with address, pktsToSend and timeoutInMs provided
-
-
-
Method Detail
-
exec
public static Ping.PingResult exec(java.net.InetAddress address, int pktsToSend, int timeoutInMs) throws java.lang.Exception
execute a ping operation with address, pktsToSend and timeoutInMs provided- Parameters:
address
- ping host addresspktsToSend
- send packet number, it needs more than 0 and less than 50, the pktsToSend relate to the timeoutInMS parametertimeoutInMs
- timeout time in millseconds, it needs more than 10000 ms and depends on the the pktsToSend parameter- Returns:
- When the ping execute ok, it will return PingResult object. When the ping execute failed, It will throw Exception, the detail information refer to the exception message
- Throws:
java.lang.Exception
-
exec
public static Ping.PingResult exec(java.lang.String hostname, int pktsToSend, int timeoutInMs) throws java.lang.Exception
execute a ping operation with hostname, pktsToSend and timeoutInMs provided- Parameters:
hostname
- ping host name or IP addresspktsToSend
- send packet number, it needs more than 0 and less than 50, the pktsToSend relate to the timeoutInMS parametertimeoutInMs
- timeout time in millseconds, it needs more than 10000 ms and depends on the the pktsToSend parameter- Returns:
- When the ping execute ok, it will return PingResult object. When the ping execute failed, It will throw Exception, the detail information refer to the exception message
- Throws:
java.lang.Exception
-
-