org.gcube.contentmanagement.baselayer.streamutils
Interface CountExceedsStream

All Superinterfaces:
FinishingActionStream
All Known Implementing Classes:
CountExceedsActionInputStream, CountExceedsActionOutputStream

public interface CountExceedsStream
extends FinishingActionStream

This class defines an FinishingActionStream, where in addition, also an Action is triggered everytime the count of read or written or skipped bytes exceeds a defined value.


Method Summary
 long getCountThreshold()
          Returns the defined threshold of the count
 FinishingAction getExceedsAction()
          Returns the action that will be performed to finish
 void performExceedsAction()
          Performs the action for the event of exceeding the defined count
 void setCountThreshold(long countThreshold)
          Sets the threshold on which the action should happen
 void setExceedsAction(FinishingAction exceedsAction)
          Sets the action that should be finished when the count is exceeded
 
Methods inherited from interface org.gcube.contentmanagement.baselayer.streamutils.FinishingActionStream
exceptionBeforeFinishing, finish, getCount, getFinishingAction, getWrappedStream, incrementCount, resetCount, resetExceptionBeforeFinishing, setFinishingAction, setWrappedStream
 

Method Detail

performExceedsAction

void performExceedsAction()
                          throws java.io.IOException
Performs the action for the event of exceeding the defined count

Throws:
java.io.IOException - if something goes wrong on the underlying stream

getCountThreshold

long getCountThreshold()
Returns the defined threshold of the count

Returns:
the threshold

setCountThreshold

void setCountThreshold(long countThreshold)
Sets the threshold on which the action should happen

Parameters:
countThreshold - the threshold

getExceedsAction

FinishingAction getExceedsAction()
Returns the action that will be performed to finish

Returns:
the action

setExceedsAction

void setExceedsAction(FinishingAction exceedsAction)
Sets the action that should be finished when the count is exceeded

Parameters:
exceedsAction - the action