Skip to content

Commit

Permalink
Merge branch 'master' into NIFI-259
Browse files Browse the repository at this point in the history
  • Loading branch information
markap14 committed Jan 21, 2016
2 parents d696391 + 0d7edcb commit f6ec437
Show file tree
Hide file tree
Showing 77 changed files with 3,516 additions and 880 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,60 +211,28 @@ public interface FlowFileQueue {
DropFlowFileStatus cancelDropFlowFileRequest(String requestIdentifier);

/**
* <p>
* Initiates a request to obtain a listing of FlowFiles in this queue. This method returns a
* ListFlowFileStatus that can be used to obtain information about the FlowFiles that exist
* within the queue. Additionally, the ListFlowFileStatus provides a request identifier that
* can then be passed to the {@link #getListFlowFileStatus(String)}. The listing of FlowFiles
* will be returned ordered by the position of the FlowFile in the queue.
* </p>
*
* @param requestIdentifier the identifier of the List FlowFile Request
* @param maxResults the maximum number of FlowFileSummary objects to add to the ListFlowFileStatus
*
* @return the status for the request
*
* @throws IllegalStateException if either the source or the destination of the connection to which this queue belongs
* is currently running.
*/
ListFlowFileStatus listFlowFiles(String requestIdentifier, int maxResults);

/**
* Initiates a request to obtain a listing of FlowFiles in this queue. This method returns a
* ListFlowFileStatus that can be used to obtain information about the FlowFiles that exist
* within the queue. Additionally, the ListFlowFileStatus provides a request identifier that
* can then be passed to the {@link #getListFlowFileStatus(String)}
* <p>
* Note that if maxResults is larger than the size of the "active queue" (i.e., the un-swapped queued,
* FlowFiles that are swapped out will not be returned.)
* </p>
*
* @param requestIdentifier the identifier of the List FlowFile Request
* @param maxResults the maximum number of FlowFileSummary objects to add to the ListFlowFileStatus
* @param sortColumn specifies which column to sort on
* @param direction specifies which direction to sort the FlowFiles
*
* @return the status for the request
*
* @throws IllegalStateException if either the source or the destination of the connection to which this queue belongs
* is currently running.
*/
ListFlowFileStatus listFlowFiles(String requestIdentifier, int maxResults, SortColumn sortColumn, SortDirection direction);

/**
* Initiates a request to obtain a listing of FlowFiles in this queue. This method returns a
* ListFlowFileStatus that can be used to obtain information about the FlowFiles that exist
* within the queue. Additionally, the ListFlowFileStatus provides a request identifier that
* can then be passed to the {@link #getListFlowFileStatus(String)}
*
* @param requestIdentifier the identifier of the List FlowFile Request
* @param maxResults the maximum number of FlowFileSummary objects to add to the ListFlowFileStatus
* @param query an Expression Language expression that will be evaluated against all FlowFiles. Only FlowFiles that satisfy the expression will
* be included in the results. The expression must be a valid expression and return a Boolean type
* @param sortColumn specifies which column to sort on
* @param direction specifies which direction to sort the FlowFiles
*
* @return the status for the request
*
* @throws IllegalStateException if either the source or the destination of the connection to which this queue belongs
* is currently running.
* @throws IllegalArgumentException if query is not a valid Expression Language expression or does not return a boolean type
*/
ListFlowFileStatus listFlowFiles(String requestIdentifier, int maxResults, String query, SortColumn sortColumn, SortDirection direction);
ListFlowFileStatus listFlowFiles(String requestIdentifier, int maxResults);

/**
* Returns the current status of a List FlowFile Request that was initiated via the {@link #listFlowFiles(String)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ public interface ListFlowFileStatus {
*/
long getLastUpdated();

/**
* @return the column on which the listing is sorted
*/
SortColumn getSortColumn();

/**
* @return the direction in which the FlowFiles are sorted
*/
SortDirection getSortDirection();

/**
* @return the current state of the operation
*/
Expand All @@ -77,14 +67,4 @@ public interface ListFlowFileStatus {
* @return the percentage (an integer between 0 and 100, inclusive) of how close the request is to being completed
*/
int getCompletionPercentage();

/**
* @return the total number of steps that are required in order to finish the listing
*/
int getTotalStepCount();

/**
* @return the total number of steps that have already been completed. The value returned will be >= 0 and <= the result of calling {@link #getTotalStepCount()}.
*/
int getCompletedStepCount();
}
60 changes: 59 additions & 1 deletion nifi-assembly/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,38 @@ For details see http://www.abeautifulsite.net/
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

This product bundles 'jsoup' which is available under the MIT License.
For details see http://jsoup.org/

jsoup License
The jsoup code-base (include source and compiled packages) are distributed under the open source MIT license as described below.

The MIT License
Copyright © 2009 - 2013 Jonathan Hedley (jonathan@hedley.net)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.



This product bundles 'json2.js' which is available in the 'public domain'.
For details see https://github.com/douglascrockford/JSON-js

Expand Down Expand Up @@ -1052,4 +1084,30 @@ information can be found here: http://www.adobe.com/devnet/xmp/library/eula-xmp-
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
THE POSSIBILITY OF SUCH DAMAGE.


This product bundles 'Jsoup' which is available under "The MIT license". More
information can be found here: http://jsoup.org/license

The MIT License

Copyright (c) 2009-2015, Jonathan Hedley <jonathan@hedley.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
5 changes: 5 additions & 0 deletions nifi-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ language governing permissions and limitations under the License. -->
<artifactId>nifi-http-context-map-nar</artifactId>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-html-nar</artifactId>
<type>nar</type>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-kite-nar</artifactId>
Expand Down
Binary file added nifi-docs/src/main/asciidoc/images/iconDetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions nifi-docs/src/main/asciidoc/user-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,19 +1260,23 @@ image:iconNotSecure.png["Not Secure"]



[[Queue_Listing]]
=== Listing FlowFiles in a Queue
[[Queue_Interaction]]
=== Queue Interaction

The FlowFiles enqueued in a Connection can be viewed when necessary. The Queue listing is opened via a menu item in
a Connection's context menu. This option is only available when the source and destination of the Connection have
been stopped and all active threads have completed. The listing will return the top 100 FlowFiles according to
the currently sorted column.
a Connection's context menu. The listing will return the top 100 FlowFiles in the active queue according to the
configured priority. The listing can be performed even if the source and destination are actively running.

Additionally, details for a Flowfile in the listing can be viewed by clicking on the Details icon (
image:iconDetails.png["Details"]
) in the left most column. From here, the FlowFile details and attributes are available as well buttons for
downloading or viewing the content. Viewing the content is only available if the nifi.content.viewer.url has been configured.
If the source or destination of the Connection are actively running, there is a chance that the desired FlowFile will
no longer be in the active queue.

The FlowFiles enqueued in a Connection can also be deleted when necessary. The removal of the FlowFiles is initiated
via a menu item in the Connection's context menu. This action can also be performed if the source and destination
are actively running.


[[Summary_Page]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<configuration>
<excludes combine.children="append">
<exclude>src/test/resources/hello.txt</exclude>
<exclude>src/test/resources/mock-aws-credentials.properties</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* 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.aws;
import org.apache.nifi.annotation.lifecycle.OnScheduled;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.controller.ControllerService;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processors.aws.credentials.provider.service.AWSCredentialsProviderService;

import com.amazonaws.AmazonWebServiceClient;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;

/**
* Base class for aws processors that uses AWSCredentialsProvider interface for creating aws clients.
*
* @param <ClientType> client type
*
* @see <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
*/
public abstract class AbstractAWSCredentialsProviderProcessor<ClientType extends AmazonWebServiceClient>
extends AbstractAWSProcessor<ClientType> {

/**
* AWS credentials provider service
*
* @see <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
*/
public static final PropertyDescriptor AWS_CREDENTIALS_PROVIDER_SERVICE = new PropertyDescriptor.Builder()
.name("AWS Credentials Provider service")
.description("The Controller Service that is used to obtain aws credentials provider")
.required(false)
.identifiesControllerService(AWSCredentialsProviderService.class)
.build();

/**
* This method checks if {#link {@link #AWS_CREDENTIALS_PROVIDER_SERVICE} is available and if it
* is, uses the credentials provider, otherwise it invokes the {@link AbstractAWSProcessor#onScheduled(ProcessContext)}
* which uses static AWSCredentials for the aws processors
*/
@OnScheduled
public void onScheduled(ProcessContext context) {
ControllerService service = context.getProperty(AWS_CREDENTIALS_PROVIDER_SERVICE).asControllerService();
if (service != null) {
getLogger().debug("Using aws credentials provider service for creating client");
onScheduledUsingControllerService(context);
} else {
getLogger().debug("Using aws credentials for creating client");
super.onScheduled(context);
}
}

/**
* Create aws client using credentials provider
* @param context the process context
*/
protected void onScheduledUsingControllerService(ProcessContext context) {
final ClientType awsClient = createClient(context, getCredentialsProvider(context), createConfiguration(context));
this.client = awsClient;
super.intializeRegionAndEndpoint(context);

}

/**
* Get credentials provider using the {@link AWSCredentialsProviderService}
* @param context the process context
* @return AWSCredentialsProvider the credential provider
* @see <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
*/
protected AWSCredentialsProvider getCredentialsProvider(final ProcessContext context) {

final AWSCredentialsProviderService awsCredentialsProviderService =
context.getProperty(AWS_CREDENTIALS_PROVIDER_SERVICE).asControllerService(AWSCredentialsProviderService.class);

return awsCredentialsProviderService.getCredentialsProvider();

}

/**
* Abstract method to create aws client using credetials provider. This is the preferred method
* for creating aws clients
* @param context process context
* @param credentialsProvider aws credentials provider
* @param config aws client configuraiton
* @return ClientType the client
*/
protected abstract ClientType createClient(final ProcessContext context, final AWSCredentialsProvider credentialsProvider, final ClientConfiguration config);
}
Loading

0 comments on commit f6ec437

Please sign in to comment.