NIFI-396 updated the javadocs of ProcessSession to reflect that a FlowFileAccessExcpetion will be thrown if an Input/Output Stream is attempted to be accessed after the callback is executed.

This commit is contained in:
Bobby Owolabi 2015-03-19 01:18:22 -04:00
parent e2760f8c98
commit cd183be441
1 changed files with 31 additions and 9 deletions

View File

@ -485,6 +485,9 @@ public interface ProcessSession {
* Executes the given callback against the contents corresponding to the * Executes the given callback against the contents corresponding to the
* given FlowFile. * given FlowFile.
* *
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
* will not be accessible once this method has completed its execution.
*
* @param source * @param source
* @param reader * @param reader
* @throws IllegalStateException if detected that this method is being * @throws IllegalStateException if detected that this method is being
@ -498,9 +501,11 @@ public interface ProcessSession {
* destroyed, and the session is automatically rolled back and what is left * destroyed, and the session is automatically rolled back and what is left
* of the FlowFile is destroyed. * of the FlowFile is destroyed.
* @throws FlowFileAccessException if some IO problem occurs accessing * @throws FlowFileAccessException if some IO problem occurs accessing
* FlowFile content * FlowFile content; if an attempt is made to access the InputStream
* provided to the given InputStreamCallback after this method completed its
* execution
*/ */
void read(FlowFile source, InputStreamCallback reader); void read(FlowFile source, InputStreamCallback reader) throws FlowFileAccessException;
/** /**
* Combines the content of all given source FlowFiles into a single given * Combines the content of all given source FlowFiles into a single given
@ -560,7 +565,10 @@ public interface ProcessSession {
/** /**
* Executes the given callback against the content corresponding to the * Executes the given callback against the content corresponding to the
* given FlowFile * given FlowFile.
*
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
* will not be accessible once this method has completed its execution.
* *
* @param source * @param source
* @param writer * @param writer
@ -576,13 +584,19 @@ public interface ProcessSession {
* destroyed, and the session is automatically rolled back and what is left * destroyed, and the session is automatically rolled back and what is left
* of the FlowFile is destroyed. * of the FlowFile is destroyed.
* @throws FlowFileAccessException if some IO problem occurs accessing * @throws FlowFileAccessException if some IO problem occurs accessing
* FlowFile content * FlowFile content; if an attempt is made to access the OutputStream
* provided to the given OutputStreamCallaback after this method completed
* its execution
*/ */
FlowFile write(FlowFile source, OutputStreamCallback writer); FlowFile write(FlowFile source, OutputStreamCallback writer) throws FlowFileAccessException;
/** /**
* Executes the given callback against the content corresponding to the * Executes the given callback against the content corresponding to the
* given flow file * given flow file.
*
* <i>Note</i>: The InputStream & OutputStream provided to the given
* StreamCallback will not be accessible once this method has completed its
* execution.
* *
* @param source * @param source
* @param writer * @param writer
@ -598,20 +612,28 @@ public interface ProcessSession {
* destroyed, and the session is automatically rolled back and what is left * destroyed, and the session is automatically rolled back and what is left
* of the FlowFile is destroyed. * of the FlowFile is destroyed.
* @throws FlowFileAccessException if some IO problem occurs accessing * @throws FlowFileAccessException if some IO problem occurs accessing
* FlowFile content * FlowFile content; if an attempt is made to access the InputStream or
* OutputStream provided to the given StreamCallback after this method
* completed its execution
*/ */
FlowFile write(FlowFile source, StreamCallback writer); FlowFile write(FlowFile source, StreamCallback writer) throws FlowFileAccessException;
/** /**
* Executes the given callback against the content corresponding to the * Executes the given callback against the content corresponding to the
* given FlowFile, such that any data written to the OutputStream of the * given FlowFile, such that any data written to the OutputStream of the
* content will be appended to the end of FlowFile. * content will be appended to the end of FlowFile.
* *
* <i>Note</i>: The OutputStream provided to the given OutputStreamCallback
* will not be accessible once this method has completed its execution.
*
* @param source * @param source
* @param writer * @param writer
* @return * @return
* @throws FlowFileAccessException if an attempt is made to access the
* OutputStream provided to the given OutputStreamCallaback after this method
* completed its execution
*/ */
FlowFile append(FlowFile source, OutputStreamCallback writer); FlowFile append(FlowFile source, OutputStreamCallback writer) throws FlowFileAccessException;
/** /**
* Writes to the given FlowFile all content from the given content path. * Writes to the given FlowFile all content from the given content path.