Class JettyAdminServer

  • All Implemented Interfaces:
    AdminServer

    public class JettyAdminServer
    extends java.lang.Object
    implements AdminServer
    This class encapsulates a Jetty server for running Commands. Given the default settings, start a ZooKeeper server and visit http://hostname:8080/commands for links to all registered commands. Visiting http://hostname:8080/commands/commandname will execute the associated Command and return the result in the body of the response. Any keyword arguments to the command are specified with URL parameters (e.g., http://localhost:8080/commands/set_trace_mask?traceMask=306).
    See Also:
    Commands, CommandOutputter
    • Constructor Detail

      • JettyAdminServer

        public JettyAdminServer​(java.lang.String address,
                                int port,
                                int timeout,
                                java.lang.String commandUrl,
                                int httpVersion,
                                boolean portUnification,
                                boolean forceHttps)
                         throws java.io.IOException,
                                java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
    • Method Detail

      • setZooKeeperServer

        public void setZooKeeperServer​(ZooKeeperServer zkServer)
        Set the ZooKeeperServer that will be used to run Commands. It is not necessary to set the ZK server before calling AdminServer.start(), and the ZK server can be set to null when, e.g., that server is being shut down. If the ZK server is not set or set to null, the AdminServer will still be able to issue Commands, but they will return an error until a ZK server is set.
        Specified by:
        setZooKeeperServer in interface AdminServer