[ 
https://issues.apache.org/jira/browse/NIFI-4975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435318#comment-16435318
 ] 

ASF GitHub Bot commented on NIFI-4975:
--------------------------------------

Github user MikeThomsen commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2546#discussion_r181035977
  
    --- Diff: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/gridfs/AbstractGridFSProcessor.java
 ---
    @@ -0,0 +1,111 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.nifi.processors.mongodb.gridfs;
    +
    +import com.mongodb.client.gridfs.GridFSBucket;
    +import com.mongodb.client.gridfs.GridFSBuckets;
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.components.Validator;
    +import org.apache.nifi.expression.ExpressionLanguageScope;
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.Relationship;
    +import org.apache.nifi.processor.util.StandardValidators;
    +import org.apache.nifi.processors.mongodb.AbstractMongoProcessor;
    +import org.apache.nifi.util.StringUtils;
    +import org.bson.types.ObjectId;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +public abstract class AbstractGridFSProcessor extends 
AbstractMongoProcessor {
    +
    +    static final PropertyDescriptor BUCKET_NAME = new 
PropertyDescriptor.Builder()
    +        .name("gridfs-bucket-name")
    +        .displayName("Bucket Name")
    +        .description("The GridFS bucket where the files will be stored. If 
left blank, it will use the default value 'fs' " +
    +                "that the MongoDB client driver uses.")
    +        
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
    +        .required(false)
    +        .addValidator(Validator.VALID)
    +        .build();
    +
    +    static final PropertyDescriptor FILE_NAME = new 
PropertyDescriptor.Builder()
    +        .name("gridfs-file-name")
    +        .displayName("File Name")
    +        .description("The name of the file in the bucket that is the 
target of this processor.")
    +        
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
    +        .required(false)
    +        .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
    +        .build();
    +
    +    static final Relationship REL_FAILURE = new Relationship.Builder()
    +        .name("failure")
    +        .description("When there is a failure processing the flowfile, it 
goes to this relationship.")
    +        .build();
    +
    +    static final Relationship REL_SUCCESS = new Relationship.Builder()
    +        .name("success")
    +        .description("When the operation success, the flowfile is sent to 
this relationship.")
    --- End diff --
    
    Done.


> Add support for MongoDB GridFS
> ------------------------------
>
>                 Key: NIFI-4975
>                 URL: https://issues.apache.org/jira/browse/NIFI-4975
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Mike Thomsen
>            Assignee: Mike Thomsen
>            Priority: Major
>
> [An overview |https://docs.mongodb.com/manual/core/gridfs/]of what GridFS is.
> Basic CRUD processors for handling GridFS should be added to the MongoDB NAR.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to