mirror of
https://github.com/apache/nifi.git
synced 2025-02-07 10:38:33 +00:00
NIFI-11222 Added deprecation log for MongoDB URI Processor property
This closes #7212 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
42a5daa136
commit
e22b6a93c7
@ -44,6 +44,7 @@ import org.apache.nifi.components.AllowableValue;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.components.ValidationContext;
|
||||
import org.apache.nifi.components.ValidationResult;
|
||||
import org.apache.nifi.deprecation.log.DeprecationLoggerFactory;
|
||||
import org.apache.nifi.expression.ExpressionLanguageScope;
|
||||
import org.apache.nifi.flowfile.FlowFile;
|
||||
import org.apache.nifi.mongodb.MongoDBClientService;
|
||||
@ -373,6 +374,11 @@ public abstract class AbstractMongoProcessor extends AbstractProcessor {
|
||||
boolean clientIsSet = context.getProperty(CLIENT_SERVICE).isSet();
|
||||
boolean uriIsSet = context.getProperty(URI).isSet();
|
||||
|
||||
if (uriIsSet) {
|
||||
DeprecationLoggerFactory.getLogger(getClass()).warn("The MongoDB URI and other client " +
|
||||
"connection properties should be replaced with an implementation of the MongoClientService");
|
||||
}
|
||||
|
||||
if (clientIsSet && uriIsSet) {
|
||||
String msg = "The client service and URI fields cannot be set at the same time.";
|
||||
retVal.add(new ValidationResult.Builder().valid(false).explanation(msg).build());
|
||||
|
@ -159,6 +159,7 @@ public class PutMongo extends AbstractMongoProcessor {
|
||||
@Override
|
||||
protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) {
|
||||
List<ValidationResult> problems = new ArrayList<>();
|
||||
problems.addAll(super.customValidate(validationContext));
|
||||
|
||||
if (validationContext.getProperty(MODE).getValue().equals(MODE_INSERT)) {
|
||||
return problems;
|
||||
|
Loading…
x
Reference in New Issue
Block a user