Kieker 1.9

kieker.tools.bridge.connector.tcp
Class TCPClientConnector

java.lang.Object
  extended by kieker.tools.bridge.connector.AbstractConnector
      extended by kieker.tools.bridge.connector.tcp.TCPClientConnector
All Implemented Interfaces:
IServiceConnector

public class TCPClientConnector
extends AbstractConnector

Connects to a remote record source.

Since:
1.8
Author:
Reiner Jung

Field Summary
static String HOSTNAME
          Property name for the host name of the record source.
static String PORT
          Property name for the port of the record source.
 
Constructor Summary
TCPClientConnector(Configuration configuration, ConcurrentMap<Integer,LookupEntity> lookupEntityMap)
          Create a TCPClientConnector.
 
Method Summary
 void close()
          Closes the data stream and socket.
 IMonitoringRecord deserializeNextRecord()
          De-serialize an object reading from the input stream.
 void initialize()
          Create the connection to a remote service providing records.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOSTNAME

public static final String HOSTNAME
Property name for the host name of the record source.


PORT

public static final String PORT
Property name for the port of the record source.

Constructor Detail

TCPClientConnector

public TCPClientConnector(Configuration configuration,
                          ConcurrentMap<Integer,LookupEntity> lookupEntityMap)
Create a TCPClientConnector.

Parameters:
configuration - Kieker configuration including setup for connectors
lookupEntityMap - IMonitoringRecord constructor and TYPES-array to id map
Method Detail

initialize

public void initialize()
                throws ConnectorDataTransmissionException
Create the connection to a remote service providing records.

Throws:
ConnectorDataTransmissionException - if the given host or IP cannot be found, or an IOException occurs

close

public void close()
           throws ConnectorDataTransmissionException
Closes the data stream and socket.

Throws:
ConnectorDataTransmissionException - if an IOException occurs during the close operation

deserializeNextRecord

public IMonitoringRecord deserializeNextRecord()
                                        throws ConnectorDataTransmissionException,
                                               ConnectorEndOfDataException
De-serialize an object reading from the input stream.

Returns:
the de-serialized IMonitoringRecord object or null if the stream was terminated by the client.
Throws:
ConnectorDataTransmissionException - when a record is received that ID is unknown or the deserialization fails
ConnectorEndOfDataException - when the other end hung up or the data stream ends of another reason

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net