Used by a Requestor to begin and maintain a subscription, as specified using a
Control
and a context, to be notified of changes to a
property's value.
If oid is
DOFObjectID.BROADCAST
, DOFSubscription will subscribe to all matching providers at the time the subscription is created.
Otherwise, it 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)
for unicast subscriptions in order to determine the primary provider.
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( DOFObjectID oid, DOFInterfaceProperty property, int minPeriod, DOFOperationControl control, DOFSubscriptionListener listener )
Parameters
- oid
- Type: org.opendof.core.oalDOFObjectID
The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST. - 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. - control
- Type: org.opendof.core.oalDOFOperationControl
The control to use for the request. - listener
- Type: org.opendof.core.oalDOFSubscriptionListener
Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).
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