Package com.helger.as2lib.util.dump
Class HTTPOutgoingDumperStreamBased
- java.lang.Object
-
- com.helger.as2lib.util.dump.HTTPOutgoingDumperStreamBased
-
- All Implemented Interfaces:
IHTTPOutgoingDumper,AutoCloseable
- Direct Known Subclasses:
HTTPOutgoingDumperFileBased
public class HTTPOutgoingDumperStreamBased extends Object implements IHTTPOutgoingDumper
Abstract outgoing HTTP dumper using anOutputStreamfor operations.- Since:
- 3.1.0
- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description HTTPOutgoingDumperStreamBased(OutputStream aOS)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the dumper.voiddumpHeader(String sName, String sValue)Get notified on a single outgoing HTTP headers.voiddumpPayload(byte[] aBytes, int nOfs, int nLen)Dump a single payload byte.voiddumpPayload(int nByte)Dump a single payload byte.voidfinishedHeaders()Called after all headers were emitted.voidfinishedPayload()Called after the payload was emitted.protected OutputStreamgetWrappedOS()booleanisDumpComment()booleanisDumpHeader()booleanisDumpPayload()HTTPOutgoingDumperStreamBasedsetDumpComment(boolean bDumpComment)HTTPOutgoingDumperStreamBasedsetDumpHeader(boolean bDumpHeader)HTTPOutgoingDumperStreamBasedsetDumpPayload(boolean bDumpPayload)voidstart(String sURL, AS2Message aMsg)Called when a new outgoing connection is initiated.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.as2lib.util.dump.IHTTPOutgoingDumper
getDumpOS
-
-
-
-
Constructor Detail
-
HTTPOutgoingDumperStreamBased
public HTTPOutgoingDumperStreamBased(@Nonnull @WillCloseWhenClosed OutputStream aOS)
- Parameters:
aOS- The output stream to dump to. May not benull.
-
-
Method Detail
-
getWrappedOS
@Nonnull protected final OutputStream getWrappedOS()
-
isDumpComment
public final boolean isDumpComment()
-
setDumpComment
@Nonnull public final HTTPOutgoingDumperStreamBased setDumpComment(boolean bDumpComment)
-
isDumpHeader
public final boolean isDumpHeader()
-
setDumpHeader
@Nonnull public final HTTPOutgoingDumperStreamBased setDumpHeader(boolean bDumpHeader)
-
isDumpPayload
public final boolean isDumpPayload()
-
setDumpPayload
@Nonnull public final HTTPOutgoingDumperStreamBased setDumpPayload(boolean bDumpPayload)
-
start
public void start(@Nonnull String sURL, @Nonnull AS2Message aMsg)
Description copied from interface:IHTTPOutgoingDumperCalled when a new outgoing connection is initiated.- Specified by:
startin interfaceIHTTPOutgoingDumper- Parameters:
sURL- The URL to which a connection is established.aMsg- The message to be dumped. Nevernull.
-
dumpHeader
public void dumpHeader(@Nonnull String sName, @Nonnull String sValue)
Description copied from interface:IHTTPOutgoingDumperGet notified on a single outgoing HTTP headers. For HTTP headers usually the ISO-8859-1 charset is used.- Specified by:
dumpHeaderin interfaceIHTTPOutgoingDumper- Parameters:
sName- HTTP header name. Nevernull.sValue- HTTP header value. Nevernull.
-
finishedHeaders
public void finishedHeaders()
Description copied from interface:IHTTPOutgoingDumperCalled after all headers were emitted.- Specified by:
finishedHeadersin interfaceIHTTPOutgoingDumper
-
dumpPayload
public void dumpPayload(int nByte)
Description copied from interface:IHTTPOutgoingDumperDump a single payload byte. May not throw an IOException!- Specified by:
dumpPayloadin interfaceIHTTPOutgoingDumper- Parameters:
nByte- Current byte
-
dumpPayload
public void dumpPayload(@Nonnull byte[] aBytes, @Nonnegative int nOfs, @Nonnegative int nLen)
Description copied from interface:IHTTPOutgoingDumperDump a single payload byte. May not throw an IOException!- Specified by:
dumpPayloadin interfaceIHTTPOutgoingDumper- Parameters:
aBytes- bytesnOfs- Offset into the arraynLen- Number of bytes to write
-
finishedPayload
public void finishedPayload()
Description copied from interface:IHTTPOutgoingDumperCalled after the payload was emitted.- Specified by:
finishedPayloadin interfaceIHTTPOutgoingDumper
-
close
public void close()
Description copied from interface:IHTTPOutgoingDumperClose the dumper.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIHTTPOutgoingDumper
-
-