Class DatagramSocketManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.OutputStreamManager
org.apache.logging.log4j.core.net.AbstractSocketManager
org.apache.logging.log4j.core.net.DatagramSocketManager
- All Implemented Interfaces:
AutoCloseable,ByteBufferDestination
Socket Manager for UDP connections.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractManager
AbstractManager.AbstractFactoryData -
Field Summary
Fields inherited from class org.apache.logging.log4j.core.net.AbstractSocketManager
host, inetAddress, portFields inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
byteBuffer, layoutFields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDatagramSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, int bufferSize) The Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets this DatagramSocketManager's content format.static DatagramSocketManagergetSocketManager(String host, int port, Layout<? extends Serializable> layout, int bufferSize) Obtain a SocketManager.Methods inherited from class org.apache.logging.log4j.core.net.AbstractSocketManager
getHost, getPortMethods inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
closeOutputStream, createOutputStream, drain, flush, flushBuffer, flushDestination, getByteBuffer, getManager, getOutputStream, hasOutputStream, isOpen, releaseSub, setOutputStream, skipFooter, write, write, write, write, writeBytes, writeBytes, writeFooter, writeHeader, writeToDestinationMethods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
close, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
Constructor Details
-
DatagramSocketManager
protected DatagramSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, int bufferSize) The Constructor.- Parameters:
name- the unique name of the connectionos- the OutputStreaminetAddress- the Internet Protocol (IP) addresshost- the host to connect toport- the port on the hostlayout- the layoutbufferSize- the buffer size
-
-
Method Details
-
getSocketManager
public static DatagramSocketManager getSocketManager(String host, int port, Layout<? extends Serializable> layout, int bufferSize) Obtain a SocketManager.- Parameters:
host- The host to connect to.port- The port on the host.layout- The layout.bufferSize- The buffer size.- Returns:
- A DatagramSocketManager.
-
getContentFormat
Gets this DatagramSocketManager's content format. Specified by:- Key: "protocol" Value: "udp"
- Key: "direction" Value: "out"
- Overrides:
getContentFormatin classAbstractSocketManager- Returns:
- Map of content format keys supporting DatagramSocketManager
-