public class SnapshotSubscriber
extends java.lang.Object
DOF.Log#addListener.| Modifier and Type | Class and Description |
|---|---|
static class |
SnapshotSubscriber.DuplicateSubscribeException
Exception indicating that a subscribe has already been started for the specified DOFObjectID and DOFInterfaceID combination.
|
| Constructor and Description |
|---|
SnapshotSubscriber(org.opendof.core.oal.DOFSystem system)
The DOFSystem instance allows this component to use OpenDOF to facilitate network communications.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(SnapshotListener listener)
Adds a listener, which will receive snapshotReceived events as they arrive.
|
void |
close()
Terminate and close this instance.
|
void |
removeListener(SnapshotListener listener)
Removes a previously added listener.
|
void |
start(org.opendof.core.oal.DOFObjectID oid,
org.opendof.core.oal.DOFInterfaceID iid,
int minPeriod)
Begins snapshot collection for a specified object and interface with a minimum update frequency.
|
void |
stop(org.opendof.core.oal.DOFObjectID oid,
org.opendof.core.oal.DOFInterfaceID iid)
Stops collecting snapshot data for the specified object and interface.
|
public SnapshotSubscriber(org.opendof.core.oal.DOFSystem system)
system - The DOFSystem instance allowing this class to use OpenDOF to facilitate network communications. Must not be null.public void close()
public void start(org.opendof.core.oal.DOFObjectID oid,
org.opendof.core.oal.DOFInterfaceID iid,
int minPeriod)
throws SnapshotSubscriber.DuplicateSubscribeException
oid - The object for which a snapshot is desired. Must not be null.iid - The interface for which a snapshot is desired. Must not be null.minPeriod - The minimum period at which updates should be received. Must not be negative.
Updates will be received as determined by the provider (whether faster or slower), but this provides a way to indicate the desired frequency.SnapshotSubscriber.DuplicateSubscribeException - Thrown if a subscription already exists with an identical oid and iid.public void stop(org.opendof.core.oal.DOFObjectID oid,
org.opendof.core.oal.DOFInterfaceID iid)
oid - The object for which a snapshot is no longer desired. Must not be null.iid - The interface for which a snapshot is no longer desired. Must not be null.public void addListener(SnapshotListener listener)
listener - The listener to be added.public void removeListener(SnapshotListener listener)
listener - The listener to be removed.