Class 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
    • Constructor Detail

      • PingCommand

        public PingCommand()
    • 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)
        Specified by:
        createPort in class com.optimaize.anythingworks.client.rest.RestBaseCommand<org.nameapi.client.services.system.ping.RestPort,​Void,​String>