Class GerritManagement

    • Constructor Detail

      • GerritManagement

        public GerritManagement()
    • Method Detail

      • getDiagnostics

        public Diagnostics getDiagnostics()
        A sub page displaying some diagnostic views.
        Returns:
        the diagnostics page.
      • getServer

        @StaplerDispatchable
        public GerritServer getServer​(String encodedServerName)
        Used when redirected to a server.
        Parameters:
        encodedServerName - the server name encoded by URLEncoder.encode(name,"UTF-8").
        Returns:
        the GerritServer object.
      • getServerStatuses

        @JavaScriptMethod
        public net.sf.json.JSONObject getServerStatuses()
        Used when getting server status from JavaScript.
        Returns:
        the json array of server status.
      • doAddNewServer

        public GerritServer doAddNewServer​(org.kohsuke.stapler.StaplerRequest req,
                                           org.kohsuke.stapler.StaplerResponse rsp)
                                    throws IOException
        Add a new server.
        Parameters:
        req - the StaplerRequest
        rsp - the StaplerResponse
        Returns:
        the new GerritServer
        Throws:
        IOException - when error sending redirect back to the list of servers
      • getTarget

        public Object getTarget()
        Specified by:
        getTarget in interface org.kohsuke.stapler.StaplerProxy
      • get

        public static GerritManagement get()
        Returns this singleton.
        Returns:
        the single loaded instance if this class.
      • getPluginConfig

        @CheckForNull
        public static PluginConfig getPluginConfig()
        Get the plugin config.
        Returns:
        the plugin config.
      • getAdministrativeMonitor

        public GerritAdministrativeMonitor getAdministrativeMonitor()
        The AdministrativeMonitor related to Gerrit. convenience method for the jelly page.
        Returns:
        the monitor if it could be found, or null otherwise.
      • getServerNames

        public List<String> getServerNames()
        Convenience method for jelly. Get the list of Gerrit server names.
        Returns:
        the list of server names as a list.
      • doNameFreeCheck

        public FormValidation doNameFreeCheck​(@QueryParameter("value")
                                              String value)
        Checks whether server name already exists.
        Parameters:
        value - the value of the name field.
        Returns:
        ok or error.
      • doConfigSubmit

        public void doConfigSubmit​(org.kohsuke.stapler.StaplerRequest req,
                                   org.kohsuke.stapler.StaplerResponse rsp)
                            throws javax.servlet.ServletException,
                                   IOException,
                                   InterruptedException
        Saves the form to the configuration and disk.
        Parameters:
        req - StaplerRequest
        rsp - StaplerResponse
        Throws:
        javax.servlet.ServletException - if something unfortunate happens.
        IOException - if something unfortunate happens.
        InterruptedException - if something unfortunate happens.