Used by a Requestor to begin and maintain a subscription, as specified using a
DOFQuery
and a context, to be notified of changes to a
property's value.
DOFSubscription will select one matching provider and subscribe to its matching property.
If there is no matching provider, then DOFSubscription will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the subscription, call
DOFSubscription.destroy()
.
NOTE: The Property's current value is always returned when the subscription is started.
NOTE: Intermediate changes that occur more frequently than minPeriod may be dropped to save bandwidth, but the
most current value of the Property is always returned.
NOTE: An application must first express interest by calling
beginInterest(DOFObjectID, DOFInterestLevel)
.
Interest goes out on the network and looks for matching providers. The query, on the other hand, searches through
the local set of known providers (those already found through interest).
If no interest is specified, then no non-local providers will be found.
Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax
C#
public DOFSubscription createSubscription( DOFQuery query, DOFInterfaceProperty property, int minPeriod, DOFSubscriptionListener listener, Object context )
Parameters
- query
- Type: org.opendof.core.oalDOFQuery
The query to use to find the provider. This must not be null. - property
- Type: org.opendof.core.oalDOFInterfaceProperty
The property. Must not be null. - minPeriod
- Type: SystemInt32
The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0. - listener
- Type: org.opendof.core.oalDOFSubscriptionListener
Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received). - context
- Type: SystemObject
An optional, user-definable object that will be passed back in listeners as a member of DOFOperation. May be null.
Return Value
Type: DOFSubscriptionThe DOFSubscription that may be used to destroy the subscription. Will not be null.
Exceptions
Exception | Condition |
---|---|
DOFErrorException |
If parameters fail validation. Exception errorCode is:
|
DOFErrorException |
See Also