|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.buffer.CommandFilter
public class CommandFilter
Predefined filter for filtering KNX messages of command based datapoints into the associated network buffer configuration and handling requests for this kind of messages.
Command based messages are buffered using a LDataObjectQueue
(an object of this
type is also expected when the request method or getNextIndication method is invoked).
Constructor Summary | |
---|---|
CommandFilter()
Creates a new command filter. |
Method Summary | |
---|---|
void |
accept(CEMI frame,
Configuration c)
Applies command based filter rules on frame. |
LDataObjectQueue.QueueItem |
getNextIndication()
Returns the next available indication. |
boolean |
hasNewIndication()
Returns whether new indications are available. |
void |
init(Configuration c)
Does all necessary filter initializations. |
CEMILData |
request(KNXAddress dst,
Configuration c)
Returns the next available indication for the specified KNX address. |
void |
setQueueListener(LDataObjectQueue.QueueListener l)
Sets the specified listener to receive notification of queue events of buffered queue objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandFilter()
Method Detail |
---|
public void accept(CEMI frame, Configuration c)
Criteria for accept:
LDataObjectQueue
with consuming read behavior and a maximum queue size of
10 items.
accept
in interface Configuration.NetworkFilter
frame
- cEMI frame to accept for bufferingc
- the configuration this filter belongs topublic LDataObjectQueue.QueueItem getNextIndication()
The items with the cEMI frame indications are returned in FIFO order according the
time they were supplied to the filter and buffered in the first place, i.e. an
earlier accepted frame is returned before an frame accepted at some later time.
Every item is only returned once by this method, after that it is no longer marked
as new and will not cause hasNewIndication()
to return true
for it.
If no indication is available, throws KNXIllegalStateException
.
Nevertheless, the queued item might be retrieved directly through the used cache
(which is obtained by Configuration.getCache()
). Whether or not an
returned item is completely consumed from the queue in the cache, i.e. removed from
the cache object in the cache, is specified in the LDataObjectQueue
containing the item at creation time (which is a task of the network filter).
Note, if the accessed queue in the cache was modified between the time the indication was added and this method call in such a way, that the original indication is not available anymore (for example by removal or emptied queue), that indication might be skipped or an empty QueueItem is returned.
public boolean hasNewIndication()
true
if at least one indication is available,
false
otherwisepublic void init(Configuration c)
Configuration.NetworkFilter
This method is invoked by the owning configuration.
init
in interface Configuration.NetworkFilter
c
- the configuration this filter is set forpublic CEMILData request(KNXAddress dst, Configuration c)
See getNextIndication()
for more details. In contrast to that method, this
method does not throw.
request
in interface Configuration.RequestFilter
dst
- address to request data forc
- the configuration this filter belongs to
null
otherwisepublic void setQueueListener(LDataObjectQueue.QueueListener l)
The listener will replace any previously set listener.
l
- the listener to set, use null
for no listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |