Class PingCommand
- java.lang.Object
-
- com.optimaize.command4j.commands.BaseCommand<A,R>
-
- com.optimaize.anythingworks.client.rest.RestBaseCommand<T,A,R>
-
- org.nameapi.client.services.NameApiBaseCommand<org.nameapi.client.services.system.ping.RestPort,Void,String>
-
- org.nameapi.client.services.system.ping.PingCommand
-
- All Implemented Interfaces:
com.optimaize.command4j.Command<Void,String>,com.optimaize.command4j.commands.CombinableCommand<Void,String>
public class PingCommand extends NameApiBaseCommand<org.nameapi.client.services.system.ping.RestPort,Void,String>
The ping command simply pings the server and, on success, gets a "pong" back.Ping can be used either manually or by code to check for service availability and response time.
The command passes through all interceptors (authentication, load balancing etc.) to a target server that actually executes nameapi requests. All standard behavior applies including request prioritization and request limits per contract. The only difference is that the minimal response time used on free accounts is not applied.
- Author:
- eike, andrej
-
-
Field Summary
-
Fields inherited from class org.nameapi.client.services.NameApiBaseCommand
CLIENT_VERSION
-
-
Constructor Summary
Constructors Constructor Description PingCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcall(com.google.common.base.Optional<Void> arg, com.optimaize.command4j.ExecutionContext ec)protected Callable<org.nameapi.client.services.system.ping.RestPort>createPort(com.optimaize.command4j.ExecutionContext ec)-
Methods inherited from class org.nameapi.client.services.NameApiBaseCommand
getApiKey, getContext, makeClient
-
Methods inherited from class com.optimaize.anythingworks.client.rest.RestBaseCommand
createCacheKey, getHost, getPort, getPortUrlFactory, makeBaseUrl
-
-
-
-
Method Detail
-
call
public String call(@NotNull com.google.common.base.Optional<Void> arg, @NotNull com.optimaize.command4j.ExecutionContext ec) throws Exception
- Throws:
Exception
-
createPort
@NotNull protected Callable<org.nameapi.client.services.system.ping.RestPort> createPort(@NotNull com.optimaize.command4j.ExecutionContext ec)
-
-