tuwien.auto.calimero.link
Interface KNXNetworkMonitor

All Known Implementing Classes:
KNXNetworkMonitorFT12, KNXNetworkMonitorIP

public interface KNXNetworkMonitor

KNX network monitor link.

A KNX network monitor is a link to a KNX network to receive KNX bus monitor indications. These indications are provided to users of the monitor link.

The link enables transparency of the type of connection protocol used to monitor a KNX network, as well as an abstraction of the particular physical KNX medium used for messaging in the KNX network.

A KNX monitor link relies on an underlying intermediate connection technology and protocol (e.g. KNXnet/IP, KNXnetIPConnection) to access KNX networks, the necessary access options are specified at creation of a dedicated monitor.

The name returned by getName() is used by a link as name of its log service.


Method Summary
 void addMonitorListener(LinkListener l)
          Adds the specified event listener l to receive events from this network monitor.
 void close()
          Ends monitoring the KNX network and closes the network monitor.
 KNXMediumSettings getKNXMedium()
          Returns the KNX medium settings used by this monitor link.
 java.lang.String getName()
          Returns the name of the monitor, a short textual representation to identify a network monitor.
 boolean isOpen()
          Checks for open monitor link.
 void removeMonitorListener(LinkListener l)
          Removes the specified event listener l, so it does no longer receive events from this network monitor.
 void setDecodeRawFrames(boolean decode)
          Sets whether the monitor should decode the raw frame on medium contained in received KNX bus monitor messages.
 void setKNXMedium(KNXMediumSettings settings)
          Supplies medium information necessary for KNX communication.
 

Method Detail

addMonitorListener

void addMonitorListener(LinkListener l)
Adds the specified event listener l to receive events from this network monitor.

If l was already added as listener, no action is performed.

Parameters:
l - the listener to add

close

void close()
Ends monitoring the KNX network and closes the network monitor.

All registered monitor listeners get notified.
If no communication access was established in the first place, no action is performed.


getKNXMedium

KNXMediumSettings getKNXMedium()
Returns the KNX medium settings used by this monitor link.

The returned object is a reference to the one used by this link (not a copy).

Returns:
medium settings for KNX network

getName

java.lang.String getName()
Returns the name of the monitor, a short textual representation to identify a network monitor.

The name is unique for monitors with different remote endpoints.
The returned name is used by the monitor for the name of its log service. Supply getName() for LogManager.getLogService(String) for example to get the associated log service.

By default, "monitor " + address/ID of the remote endpoint is returned.
After closing the monitor, the returned name might differ, e.g. get reset to some arbitrary default name.

Returns:
monitor name as string

isOpen

boolean isOpen()
Checks for open monitor link.

After a call to close() or after the underlying protocol initiated the end of the communication, this method always returns false.

Returns:
true if this network monitor is open, false on closed

removeMonitorListener

void removeMonitorListener(LinkListener l)
Removes the specified event listener l, so it does no longer receive events from this network monitor.

If l was not added in the first place, no action is performed.

Parameters:
l - the listener to remove

setDecodeRawFrames

void setDecodeRawFrames(boolean decode)
Sets whether the monitor should decode the raw frame on medium contained in received KNX bus monitor messages.

A decoded raw frame is of type RawFrame and can be retrieved using MonitorFrameEvent.getRawFrame() within a link listener registered for this monitor.

Parameters:
decode - true to enable decoding, false to skip decoding

setKNXMedium

void setKNXMedium(KNXMediumSettings settings)
Supplies medium information necessary for KNX communication.

These informations are differing between KNX media and depend on the KNX network this link is communicating with.
The settings medium type has to match the medium type supplied to the link in the first place.
The settings object is not copied internally to allow subsequent changes to medium settings by the user which should take effect immediately.

Parameters:
settings - medium settings to use, the expected subtype is according to the KNX network medium