Class MongoDBKnowledgeBase.MongoDBKnowledgeBaseDescriptor

java.lang.Object
hudson.model.Descriptor<KnowledgeBase>
com.sonyericsson.jenkins.plugins.bfa.db.KnowledgeBase.KnowledgeBaseDescriptor
com.sonyericsson.jenkins.plugins.bfa.db.MongoDBKnowledgeBase.MongoDBKnowledgeBaseDescriptor
All Implemented Interfaces:
Saveable, Loadable, OnMaster
Enclosing class:
MongoDBKnowledgeBase

@Extension public static class MongoDBKnowledgeBase.MongoDBKnowledgeBaseDescriptor extends KnowledgeBase.KnowledgeBaseDescriptor
Descriptor for MongoDBKnowledgeBase.
  • Constructor Details

    • MongoDBKnowledgeBaseDescriptor

      public MongoDBKnowledgeBaseDescriptor()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<KnowledgeBase>
    • getDefaultPort

      public int getDefaultPort()
      Convenience method for jelly.
      Returns:
      the default port.
    • doCheckHost

      public FormValidation doCheckHost(@QueryParameter("value") String value)
      Checks that the host name is not empty.
      Parameters:
      value - the pattern to check.
      Returns:
      FormValidation.ok() if everything is well.
    • doCheckPort

      public FormValidation doCheckPort(@QueryParameter("value") String value)
      Checks that the port number is not empty and is a number.
      Parameters:
      value - the port number to check.
      Returns:
      FormValidation.ok() if everything is well.
    • doCheckDbName

      public FormValidation doCheckDbName(@QueryParameter("value") String value)
      Checks that the database name is not empty.
      Parameters:
      value - the database name to check.
      Returns:
      FormValidation.ok() if everything is well.
    • doTestConnection

      @POST public FormValidation doTestConnection(@QueryParameter("host") String host, @QueryParameter("port") int port, @QueryParameter("dbName") String dbName, @QueryParameter("userName") String userName, @QueryParameter("password") String password, @QueryParameter("tls") boolean tls, @QueryParameter("retrywrites") boolean retryWrites)
      Tests if the provided parameters can connect to the Mongo database.
      Parameters:
      host - the host name.
      port - the port.
      dbName - the database name.
      userName - the user name.
      password - the password.
      tls - the tls option.
      retryWrites - the retry_writes option
      Returns:
      FormValidation.ok() if can be done, FormValidation.error(java.lang.String) otherwise.