Class NetTracer
- java.lang.Object
-
- de.christofreichardt.diagnosis.AbstractTracer
-
- de.christofreichardt.diagnosis.net.NetTracer
-
public class NetTracer extends AbstractTracer
This particular tracer logs over the network.- Author:
- Christof Reichardt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.christofreichardt.diagnosis.AbstractTracer
AbstractTracer.Exception
-
-
Field Summary
Fields Modifier and Type Field Description protected StringhostNamethe host name of the debug serverprotected SocketpizzaConnectionthe pizza connection to the debug serverprotected intportNothe debug server's port numberstatic intTIMEOUTThe timeout when connecting to the remote logging server in milliseconds-
Fields inherited from class de.christofreichardt.diagnosis.AbstractTracer
VERSION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the associatedTracePrintStream.StringgetHostName()Returns the hostname used to connect to the remote logging server.intgetPortNo()Returns the port number used to connect to the remote logging server.voidopen()Opens the associatedTracePrintStreamby wrapping the socket streams.protected voidreadConfiguration(XPath xpath, Node node)Reads the configuration for this particular tracer instance by evaluating the given node with the given xpath engine.protected voidsendUserCredentials()Collects some user credentials and sends them over the network.voidsetHostName(String hostName)Sets the hostname used to connect to the remote logging server.voidsetPortNo(int portNo)Sets the port number used to connect to the remote logging server.-
Methods inherited from class de.christofreichardt.diagnosis.AbstractTracer
clearCurrentTracingContext, entry, entry, entry, formatStreamErrorState, formatVersionInfo, getBufferedOutputStream, getBufferSize, getLevel, getName, getNullPrintStream, getThreadMap, getTracePrintStream, initCurrentTracingContext, initCurrentTracingContext, isAutoflush, isOnline, isOpened, logException, logMessage, out, out, setAutoflush, setBufferedOutputStream, setBufferSize, setOpened, setTracePrintStream, wayout
-
-
-
-
Field Detail
-
TIMEOUT
public static final int TIMEOUT
The timeout when connecting to the remote logging server in milliseconds- See Also:
- Constant Field Values
-
portNo
protected int portNo
the debug server's port number
-
hostName
protected String hostName
the host name of the debug server
-
pizzaConnection
protected Socket pizzaConnection
the pizza connection to the debug server
-
-
Constructor Detail
-
NetTracer
public NetTracer(String name)
Constructor expects the name of the tracer. That name will be sent over the network when connecting to remote logging server.- Parameters:
name- the name of the tracer
-
-
Method Detail
-
getPortNo
public int getPortNo()
Returns the port number used to connect to the remote logging server.- Returns:
- the portNo
-
setPortNo
public void setPortNo(int portNo)
Sets the port number used to connect to the remote logging server.- Parameters:
portNo- the portNo to set
-
getHostName
public String getHostName()
Returns the hostname used to connect to the remote logging server.- Returns:
- the hostName
-
setHostName
public void setHostName(String hostName)
Sets the hostname used to connect to the remote logging server.- Parameters:
hostName- the hostName to set
-
readConfiguration
protected void readConfiguration(XPath xpath, Node node) throws XPathExpressionException, AbstractTracer.Exception
Description copied from class:AbstractTracerReads the configuration for this particular tracer instance by evaluating the given node with the given xpath engine.- Overrides:
readConfigurationin classAbstractTracer- Parameters:
xpath- the xpath enginenode- the config node- Throws:
XPathExpressionException- indicates xpath problemsAbstractTracer.Exception- indicates problems when configuring certain tracer instances
-
open
public void open()
Opens the associatedTracePrintStreamby wrapping the socket streams.- Specified by:
openin classAbstractTracer
-
close
public void close()
Closes the associatedTracePrintStream.- Specified by:
closein classAbstractTracer
-
sendUserCredentials
protected void sendUserCredentials() throws UnknownHostExceptionCollects some user credentials and sends them over the network.- Throws:
UnknownHostException- if the local host name could not be resolved into an address
-
-