Package com.helger.phase4.dump
Class AS4OutgoingDumperFileBased
java.lang.Object
com.helger.phase4.dump.AbstractAS4OutgoingDumperWithHeaders<AS4OutgoingDumperFileBased>
com.helger.phase4.dump.AS4OutgoingDumperFileBased
- All Implemented Interfaces:
com.helger.base.trait.IGenericImplTrait<AS4OutgoingDumperFileBased>,IAS4OutgoingDumper
public class AS4OutgoingDumperFileBased
extends AbstractAS4OutgoingDumperWithHeaders<AS4OutgoingDumperFileBased>
File based implementation of
IAS4OutgoingDumper.- Since:
- 0.9.3
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default relative path for outgoing messages.Fields inherited from class com.helger.phase4.dump.AbstractAS4OutgoingDumperWithHeaders
DEFAULT_INCLUDE_HEADERS -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AS4OutgoingDumperFileBased(@NonNull IAS4OutgoingDumperFileProvider aFileProvider) Constructor with a custom file provider. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull AS4OutgoingDumperFileBasedcreateForDirectory(@NonNull File aBaseDirectory) Create a new instance for the provided directory.protected final @NonNull IAS4OutgoingDumperFileProviderprotected OutputStreamopenOutputStream(@NonNull EAS4MessageMode eMsgMode, @Nullable IAS4IncomingMessageMetadata aIncomingMessageMetadata, @Nullable IAS4IncomingMessageState aIncomingState, @NonNull @Nonempty String sMessageID, @Nullable com.helger.http.header.HttpHeaderMap aCustomHeaders, int nTry) Create the output stream to which the data should be dumped.Methods inherited from class com.helger.phase4.dump.AbstractAS4OutgoingDumperWithHeaders
isIncludeHeaders, onBeginRequest, onEndRequest, setIncludeHeadersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.base.trait.IGenericImplTrait
thisAsT
-
Field Details
-
DEFAULT_BASE_PATH
The default relative path for outgoing messages.- See Also:
-
-
Constructor Details
-
AS4OutgoingDumperFileBased
public AS4OutgoingDumperFileBased()Default constructor. Writes the files to the AS4 configured data path +DEFAULT_BASE_PATH.- See Also:
-
AS4OutgoingDumperFileBased
Constructor with a custom file provider.- Parameters:
aFileProvider- The file provider that defines where to store the files. May not benull.
-
-
Method Details
-
getFileProvider
-
openOutputStream
protected OutputStream openOutputStream(@NonNull EAS4MessageMode eMsgMode, @Nullable IAS4IncomingMessageMetadata aIncomingMessageMetadata, @Nullable IAS4IncomingMessageState aIncomingState, @Nonempty @NonNull @Nonempty String sMessageID, @Nullable com.helger.http.header.HttpHeaderMap aCustomHeaders, @Nonnegative int nTry) throws IOException Description copied from class:AbstractAS4OutgoingDumperWithHeadersCreate the output stream to which the data should be dumped.- Specified by:
openOutputStreamin classAbstractAS4OutgoingDumperWithHeaders<AS4OutgoingDumperFileBased>- Parameters:
eMsgMode- Are we dumping a request or a response? Nevernull. Added in v1.2.0.aIncomingMessageMetadata- The incoming message metadata. This is alwaysnullfor requests. This is always non-nullfor responses. Added in v1.2.0.aIncomingState- The incoming message processing state. This is alwaysnullfor requests. This is always non-nullfor responses. Added in v1.2.0.sMessageID- The AS4 message ID of the outgoing message. Neithernullnor empty.aCustomHeaders- The HTTP headers of the outgoing message. Nevernull.nTry- The index of the try. The first try has always index 0, the first retry has index 1, the second retry has index 2 etc. Always ≥ 0.- Returns:
- The output stream to dump to or
nullif no dumping should be performed. - Throws:
IOException- On IO error
-
createForDirectory
Create a new instance for the provided directory.- Parameters:
aBaseDirectory- The absolute directory to be used. May not benull.- Returns:
- The created dumper. Never
null. - Since:
- 0.10.2
-