Class AbstractSocketManager
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.AbstractManager
-
- org.apache.logging.log4j.core.appender.OutputStreamManager
-
- org.apache.logging.log4j.core.net.AbstractSocketManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ByteBufferDestination
- Direct Known Subclasses:
DatagramSocketManager,TcpSocketManager
public abstract class AbstractSocketManager extends OutputStreamManager
Abstract base class for managing sockets.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractManager
AbstractManager.AbstractFactoryData
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringhostThe name of the host.protected java.net.InetAddressinetAddressThe Internet address of the host.protected intportThe port on the host.-
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 Constructor Description AbstractSocketManager(java.lang.String name, java.io.OutputStream os, java.net.InetAddress inetAddress, java.lang.String host, int port, Layout<? extends java.io.Serializable> layout, boolean writeHeader, int bufferSize)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getContentFormat()Gets this AbstractSocketManager's content format.java.lang.StringgetHost()Gets the host.intgetPort()Gets the port.-
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, writeHeader, writeToDestination
-
Methods 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 Detail
-
AbstractSocketManager
public AbstractSocketManager(java.lang.String name, java.io.OutputStream os, java.net.InetAddress inetAddress, java.lang.String host, int port, Layout<? extends java.io.Serializable> layout, boolean writeHeader, int bufferSize)Constructs a new instance.- Parameters:
name- The unique name of this connection.os- The OutputStream to manage.inetAddress- The Internet address.host- The target host name.port- The target port number.bufferSize- The buffer size.
-
-
Method Detail
-
getContentFormat
public java.util.Map<java.lang.String,java.lang.String> getContentFormat()
Gets this AbstractSocketManager's content format. Specified by:- Key: "port" Value: provided "port" param
- Key: "address" Value: provided "address" param
- Overrides:
getContentFormatin classAbstractManager- Returns:
- Map of content format keys supporting AbstractSocketManager
-
getHost
public java.lang.String getHost()
Gets the host.- Returns:
- the host.
-
getPort
public int getPort()
Gets the port.- Returns:
- the port.
-
-