|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.buffer.NetworkBuffer
public final class NetworkBuffer
A network buffer temporarily stores KNX network messages.
Reasons to do this might be to lower the response time when answering frequently occurring application queries, leading to a better runtime performance. Another use would be to enable user polled applications.
A network buffer contains one or more Configuration
s, each of it maintains a
setting how to handle, i.e. filter and buffer, certain messages. In other words, a
network buffer obtains knowledge of buffering messages by adding configurations.
A configuration works with filters set by the user for that configuration. A filter -
depending on its filter type - either applies individual filter rules on incoming
messages (Configuration.NetworkFilter
) or answers requests from users or
components working with that configuration (Configuration.RequestFilter
).
If a created configuration is activated and no network filter is set, a default filter
is used, which simply accepts all cEMI L-Data.
If no request filter is set, no buffer lookup is done on requests, instead the request
is forwarded directly to the KNX network.
In general, one network buffer is created for one KNX installation, to easier distinguish between different installations. Nevertheless, this is not enforced in any way; a new configuration also might just always use a new network buffer.
Field Summary | |
---|---|
static java.lang.String |
LOG_SERVICE
Name of the log service used for network buffer logging. |
Method Summary | |
---|---|
static NetworkBuffer |
createBuffer(java.lang.String installationID)
Creates a new network buffer for a KNX installation. |
Configuration |
createConfiguration(KNXNetworkLink link)
Creates a new configuration for this network buffer. |
static Configuration |
createConfiguration(KNXNetworkLink link,
java.lang.String installationID)
Creates a new configuration for the network buffer identified by the installation ID. |
static NetworkBuffer[] |
getAllBuffers()
Returns all network buffers currently in use. |
static NetworkBuffer |
getBuffer(java.lang.String installationID)
Returns the network buffer for the given installation ID. |
Configuration |
getConfiguration(KNXNetworkLink bufferedLink)
Gets the configuration which provides the buffered link. |
java.lang.String |
getInstallationID()
Returns the installation identifier of this network buffer. |
static void |
removeBuffer(java.lang.String installationID)
Removes a network buffer, and all configurations of that buffer. |
void |
removeConfiguration(Configuration c)
Removes a configuration from this network buffer. |
static void |
removeConfiguration(Configuration c,
java.lang.String installationID)
Removes a configuration from the network buffer identified by the installation ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOG_SERVICE
Method Detail |
---|
public static NetworkBuffer createBuffer(java.lang.String installationID)
To identify the buffer an unique installation identifier can be given through
installationID
.
If null
or an empty string is supplied for the installation ID, a
new default ID is generated of the form "Installation [ID]", where [ID] is an
unique incrementing number. Note, the installation ID string is treated case
sensitive.
installationID
- installation identifier for the network buffer, or
null
public Configuration createConfiguration(KNXNetworkLink link)
If the supplied link
gets closed, the created configuration will get
deactivated (see Configuration.activate(boolean)
), and the buffered link
of the configuration, obtained with Configuration.getBufferedLink()
, will
get closed as well.
link
- KNX network link communicating with the KNX network
public static Configuration createConfiguration(KNXNetworkLink link, java.lang.String installationID)
The configuration is added to the network buffer specified by the installation ID.
If a network buffer with the supplied installation ID does not exist, it will be
created. If null
or an empty string is supplied for the installation
ID, a new default ID is generated (see createBuffer(String)
.
If the supplied link
gets closed, the created configuration will get
deactivated (see Configuration.activate(boolean)
), and the buffered link
of the configuration, obtained with Configuration.getBufferedLink()
, will
get closed as well.
link
- KNX network link communicating with the KNX networkinstallationID
- installation identifier for the network buffer, or
null
public static NetworkBuffer[] getAllBuffers()
public static NetworkBuffer getBuffer(java.lang.String installationID)
installationID
- installation ID for the network buffer
null
if no buffer foundpublic Configuration getConfiguration(KNXNetworkLink bufferedLink)
If the network link is not a buffered link or not found in the current
configurations of this network buffer, null
is returned.
bufferedLink
- the buffered link to get the configuration for
null
public java.lang.String getInstallationID()
public static void removeBuffer(java.lang.String installationID)
For every Configuration
contained in the buffer,
(tuwien.auto.calimero.buffer.Configuration)
is called.
installationID
- installation ID of the network buffer to removepublic void removeConfiguration(Configuration c)
The configuration is deactivated and will not receive any further events or incoming messages from the base network link supplied at creation of that configuration.
c
- the configuration to removepublic static void removeConfiguration(Configuration c, java.lang.String installationID)
If installationID
is null
, all network buffers are
searched for the configuration c
.
If the network buffer is found containing the specified configuration,
(tuwien.auto.calimero.buffer.Configuration)
is called on that buffer.
c
- the configuration to removeinstallationID
- installation identifier for the network buffer, or
null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |