enum SyslogProtocolHandler extends Enum<SyslogProtocolHandler> implements TCPProtocolHandler, UDPProtocolHandler
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
private static int |
INIT_MSG_LEN |
private static Logger |
LOG |
private static int |
MAX_MSG_LEN |
private static int |
MAX_MSG_PREFIX |
private static int |
MSG_PROMPT_LEN |
Modifier and Type | Method and Description |
---|---|
private static int |
indexOfXML(byte[] buf,
int offset,
int maxIndex) |
private static boolean |
isAuditMessage(byte[] buf,
int index) |
private static boolean |
isIHEYr4(byte[] buf,
int index) |
private static boolean |
isXMLDecl(byte[] buf,
int index) |
void |
onAccept(Connection conn,
Socket s) |
private void |
onMessage(byte[] data,
int offset,
int length,
Connection conn,
InetAddress from) |
void |
onReceive(Connection conn,
DatagramPacket packet) |
private static String |
prompt(byte[] data,
int maxLen) |
private int |
readMessage(InputStream in,
byte[] data,
int len) |
private int |
readMessageLength(InputStream in,
Socket s) |
static SyslogProtocolHandler |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SyslogProtocolHandler[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SyslogProtocolHandler INSTANCE
private static final int INIT_MSG_LEN
private static final int MAX_MSG_LEN
private static final int MAX_MSG_PREFIX
private static final int MSG_PROMPT_LEN
public static SyslogProtocolHandler[] values()
for (SyslogProtocolHandler c : SyslogProtocolHandler.values()) System.out.println(c);
public static SyslogProtocolHandler valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void onAccept(Connection conn, Socket s) throws IOException
onAccept
in interface TCPProtocolHandler
IOException
private int readMessageLength(InputStream in, Socket s) throws IOException
IOException
private int readMessage(InputStream in, byte[] data, int len) throws IOException
IOException
public void onReceive(Connection conn, DatagramPacket packet)
onReceive
in interface UDPProtocolHandler
private void onMessage(byte[] data, int offset, int length, Connection conn, InetAddress from)
private static int indexOfXML(byte[] buf, int offset, int maxIndex)
private static boolean isXMLDecl(byte[] buf, int index)
private static boolean isAuditMessage(byte[] buf, int index)
private static boolean isIHEYr4(byte[] buf, int index)
Copyright © 2017 dcm4che.org. All rights reserved.