Interface MimeBodyPartRecorder
-
- All Known Implementing Classes:
ThreadLocalMimeBodyPartRecorder
public interface MimeBodyPartRecorder
Records the usage of images which are meant to be embedded in a MIME email.Any
track(javax.activation.DataSource)
call has to be done within the closure given torecord(java.util.concurrent.Callable)
. Nested#record(java.util.concurrent.Callable)
should be supported in the way that they start a new, isolated recording whilst remembering the outer tracking calls.A
MimeBodyPartRecorder
implementation has to be thread-safe but is not required to share its state amongst threads. That is, even if a recorder instance is shared amongst threads, atrack(javax.activation.DataSource)
call from a different thread than the one setting up therecord(java.util.concurrent.Callable)
, will not necessarily be tracked.- Since:
- 5.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description boolean
isRecording()
default <T> com.atlassian.fugue.Pair<com.atlassian.fugue.Maybe<T>,Iterable<MimeBodyPartReference>>
record(Callable<T> callback)
Deprecated.since 7.0.1.<T> io.atlassian.fugue.Pair<Optional<T>,Iterable<MimeBodyPartReference>>
startRecording(Callable<T> callback)
Activate the recorder so that it can recordtrackSource(DataSource)
calls.default com.atlassian.fugue.Maybe<MimeBodyPartReference>
track(javax.activation.DataSource source)
Deprecated.since 7.0.1.Optional<MimeBodyPartReference>
trackSource(javax.activation.DataSource source)
Track the given image source.
-
-
-
Method Detail
-
record
@Deprecated default <T> com.atlassian.fugue.Pair<com.atlassian.fugue.Maybe<T>,Iterable<MimeBodyPartReference>> record(Callable<T> callback) throws Exception
Deprecated.since 7.0.1. UsestartRecording(Callable)
Activate the recorder so that it can recordtrack(javax.activation.DataSource)
calls.- Type Parameters:
T
- the return type of the callback- Parameters:
callback
- the code eligible for recording- Returns:
- a pair of the result of the callback and the recorded references of the embeddable images
- Throws:
Exception
- if the callback escapes
-
startRecording
<T> io.atlassian.fugue.Pair<Optional<T>,Iterable<MimeBodyPartReference>> startRecording(Callable<T> callback) throws Exception
Activate the recorder so that it can recordtrackSource(DataSource)
calls.- Type Parameters:
T
- the return type of the callback- Parameters:
callback
- the code eligible for recording- Returns:
- a pair of the result of the callback and the recorded references of the embeddable images
- Throws:
Exception
- if the callback escapes- Since:
- 7.0.1
-
isRecording
boolean isRecording()
- Returns:
- true if the current thread is being recorded.
-
track
@Deprecated default com.atlassian.fugue.Maybe<MimeBodyPartReference> track(javax.activation.DataSource source)
Deprecated.since 7.0.1. UsetrackSource(DataSource)
Track the given image source.- Parameters:
source
- aDataSource
encapsulating the access to the image data- Returns:
- maybe a reference to the given image, will be empty if the recorder is not recording
-
trackSource
Optional<MimeBodyPartReference> trackSource(javax.activation.DataSource source)
Track the given image source.- Parameters:
source
- aDataSource
encapsulating the access to the image data- Returns:
- maybe a reference to the given image, will be empty if the recorder is not recording
- Since:
- 7.0.1
-
-