|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.log.LogWriter
tuwien.auto.calimero.log.LogStreamWriter
tuwien.auto.calimero.log.LogNetWriter
public class LogNetWriter
A LogNetWriter is used to log information over a socket network connection.
A destination host is supplied on creation of this log writer, a Socket
TCP
connection is opened and used for further logging. After close()
ing the log
writer, it cannot be connected again.
For output on the socket the platform's default character set is used.
Socket
Field Summary | |
---|---|
protected java.net.Socket |
s
Socket connection used as logging destination. |
Fields inherited from class tuwien.auto.calimero.log.LogStreamWriter |
---|
c, formatOutput, lineSep |
Constructor Summary | |
---|---|
LogNetWriter(LogLevel level,
java.lang.String host,
int port)
Like LogNetWriter(String, int) with the ability to set the filter log
level for information logged by LogNetWriter. |
|
LogNetWriter(java.lang.String host,
int port)
Creates a log writer and opens a socket connection to destination host
and port . |
Method Summary | |
---|---|
void |
close()
Closes the LogWriter and all its resources. |
java.lang.String |
getHostAddress()
Returns the remote host IP address of this log writer, or "" if the connection was closed. |
java.lang.String |
getHostName()
Returns the remote host name of this log writer, or "" if the connection was closed. |
int |
getPort()
Returns the destination port of this log writer, or 0 if the connection was closed. |
Methods inherited from class tuwien.auto.calimero.log.LogStreamWriter |
---|
flush, formatOutput, logAllowed, setOutput, write, write |
Methods inherited from class tuwien.auto.calimero.log.LogWriter |
---|
getErrorHandler, getLogLevel, setErrorHandler, setLogLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.net.Socket s
Constructor Detail |
---|
public LogNetWriter(LogLevel level, java.lang.String host, int port) throws KNXLogException
LogNetWriter(String, int)
with the ability to set the filter log
level for information logged by LogNetWriter.
level
- log level used by this LogWriter to filter log informationhost
- destination host name or IP address in textual presentation; if
null
or an empty string is specified, an address of the
loopback interface is usedport
- destination port, 0 <= port <= 65535
KNXLogException
- if IP address of host could not be determined or socket
binding / connecting failedpublic LogNetWriter(java.lang.String host, int port) throws KNXLogException
host
and port
.
host
- destination host name or IP address in textual presentation; if
null
or an empty string is specified, an address of the
loopback interface is usedport
- destination port, 0 <= port <= 65535
KNXLogException
- if IP address of host could not be determined or socket
binding / connecting failedSocket
Method Detail |
---|
public void close()
LogWriter
If necessary, all output is flushes before.
close
in class LogStreamWriter
public final java.lang.String getHostAddress()
InetAddress.getHostAddress()
public final java.lang.String getHostName()
Note that this might involve a reverse name lookup. It is possible that only the IP address string is returned.
InetAddress.getHostName()
public final int getPort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |