public static class ConnectionValidationSettings.Builder extends Object
| Constructor and Description |
|---|
Builder(String testConnectionPath,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage)
Allows creating a new instance of
ConnectionValidationSettings. |
| Modifier and Type | Method and Description |
|---|---|
ConnectionValidationSettings.Builder |
addValidation(String validationExpression) |
ConnectionValidationSettings.Builder |
addValidation(String validationExpression,
String errorTemplateExpression) |
ConnectionValidationSettings |
build() |
ConnectionValidationSettings.Builder |
httpMethod(org.mule.runtime.http.api.HttpConstants.Method httpMethod) |
ConnectionValidationSettings.Builder |
responseMediaType(org.mule.runtime.api.metadata.MediaType responseMediaType) |
ConnectionValidationSettings.Builder |
validStatusCodes(Integer... statusCode) |
public Builder(String testConnectionPath, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage)
ConnectionValidationSettings.testConnectionPath - a path relative to the connection base uri where the validation request will be made.expressionLanguage - the expression language to be used when executing the validation expressions.public ConnectionValidationSettings.Builder httpMethod(org.mule.runtime.http.api.HttpConstants.Method httpMethod)
httpMethod - the HTTP Method to use when executing this request against the server.public ConnectionValidationSettings.Builder validStatusCodes(Integer... statusCode)
statusCode - all the HTTP status codes for which this request is considered a success.public ConnectionValidationSettings.Builder addValidation(String validationExpression)
validationExpression - an expression to be executed on the request's response.
Must return true if the connection is valid or false if it is not.public ConnectionValidationSettings.Builder addValidation(String validationExpression, String errorTemplateExpression)
validationExpression - an expression to be executed on the request's response.
Must return true if the connection is valid or false if it is not.errorTemplateExpression - an expression to be executed when the validation is unsuccessful (When validationExpression returns false)
This expression must return an string and will be shown to the user as an error message.public ConnectionValidationSettings.Builder responseMediaType(org.mule.runtime.api.metadata.MediaType responseMediaType)
responseMediaType - The expected response media type. Will be used when evaluating the validation expressions.
If set this will override the media type returned in the content-type header by the server.
This media type should be set if the server does not provide a content-type header.public ConnectionValidationSettings build()
Copyright © 2021. All rights reserved.