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
public class DatagramSocketManager extends AbstractSocketManager
Socket Manager for UDP connections.
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.net.AbstractSocketManager
host, inetAddress, port
-
Fields inherited from class org.apache.logging.log4j.core.appender.OutputStreamManager
byteBuffer, layout
-
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DatagramSocketManager(String name, OutputStream os, InetAddress inetAddress, String host, int port, Layout<? extends Serializable> layout, int bufferSize)
The Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getContentFormat()
Gets this DatagramSocketManager's content format.static DatagramSocketManager
getSocketManager(String host, int port, Layout<? extends Serializable> layout, int bufferSize)
Obtain a SocketManager.-
Methods 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, writeToDestination
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
close, getCount, getLoggerContext, getManager, getName, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
-
-
-
Constructor Detail
-
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 connection.os
- The OutputStream.inetAddress
-host
- The host to connect to.port
- The port on the host.layout
- The layoutbufferSize
- The buffer size
-
-
Method Detail
-
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
public Map<String,String> getContentFormat()
Gets this DatagramSocketManager's content format. Specified by:- Key: "protocol" Value: "udp"
- Key: "direction" Value: "out"
- Overrides:
getContentFormat
in classAbstractSocketManager
- Returns:
- Map of content format keys supporting DatagramSocketManager
-
-