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
- Enclosing class:
- MongoDBKnowledgeBase
@Extension
public static class MongoDBKnowledgeBase.MongoDBKnowledgeBaseDescriptor
extends KnowledgeBase.KnowledgeBaseDescriptor
Descriptor for
MongoDBKnowledgeBase
.-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoCheckDbName
(String value) Checks that the database name is not empty.doCheckHost
(String value) Checks that the host name is not empty.doCheckPort
(String value) Checks that the port number is not empty and is a number.doTestConnection
(String host, int port, String dbName, String userName, String password, boolean tls, boolean retryWrites) Tests if the provided parameters can connect to the Mongo database.int
Convenience method for jelly.Methods inherited from class com.sonyericsson.jenkins.plugins.bfa.db.KnowledgeBase.KnowledgeBaseDescriptor
all
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
MongoDBKnowledgeBaseDescriptor
public MongoDBKnowledgeBaseDescriptor()
-
-
Method Details
-
getDisplayName
- Overrides:
getDisplayName
in classDescriptor<KnowledgeBase>
-
getDefaultPort
public int getDefaultPort()Convenience method for jelly.- Returns:
- the default port.
-
doCheckHost
Checks that the host name is not empty.- Parameters:
value
- the pattern to check.- Returns:
FormValidation.ok()
if everything is well.
-
doCheckPort
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
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.
-