public final class DOFSystem
extends java.lang.Object
DOF.createSystem()
.DOFObject
Modifier and Type | Class and Description |
---|---|
static interface |
DOFSystem.ActivateInterestListener
Listener for
DOFInterestLevel.ACTIVATE -level interest (and higher) requests, used by Providers to react to interest being expressed by Requestor. |
static class |
DOFSystem.Config
This class contains configuration information required for a DOFSystem.
|
static interface |
DOFSystem.InterestOperationListener
This interface is used by Requestors to receive asynchronous interest completion for interest requests.
|
static interface |
DOFSystem.QueryOperationListener
The QueryOperationListener defines listener methods that provide notification
of objects and their provided interfaces being added and removed from the system.
|
static interface |
DOFSystem.RouteListener
Objects implement the RouteListener interface to receive information about routes being added and removed.
|
static interface |
DOFSystem.State
This class represents the instantaneous state of the system at a given time.
|
static interface |
DOFSystem.StateListener
This interface can be implemented to provide a listener for the state of a
DOFSystem . |
Modifier and Type | Method and Description |
---|---|
void |
addActivateInterestListener(DOFSystem.ActivateInterestListener listener)
Used by a Provider to add an
DOFSystem.ActivateInterestListener to be notified of interest requests. |
void |
addRouteListener(DOFSystem.RouteListener listener)
Add a route listener to this system.
|
void |
addStateListener(DOFSystem.StateListener listener)
Add a new state listener to the system.
|
DOFOperation.Interest |
beginInterest(DOFInterfaceID interfaceID,
DOFInterestLevel level)
Used by a Requestor to request interest with an indefinite duration in a given interface and any object.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterestLevel level)
Used by a Requestor to request interest with an indefinite duration in a given object and any interface.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level)
Used by a Requestor to request interest with an indefinite duration in a given object and interface combination.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level,
DOFOperation.Control control,
int timeout,
DOFSystem.InterestOperationListener operationListener,
java.lang.Object context)
Used by a Requestor to request interest in a given object and interface combination specifying a DOFOperation.Control.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level,
int timeout)
Used by a Requestor to request interest in a given object and interface combination.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level,
int timeout,
DOFSystem.InterestOperationListener operationListener)
Used by a Requestor to request interest in a given object and interface combination.
|
DOFOperation.Interest |
beginInterest(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level,
int timeout,
DOFSystem.InterestOperationListener operationListener,
java.lang.Object context)
Used by a Requestor to request interest in a given object and interface combination.
|
DOFOperation.Provide |
beginProvide(DOFInterface iface,
DOFObject.Provider provider)
Used by a Provider to begin providing the specified interface indefinitely (equivalent to specifying a timeout of
DOF.TIMEOUT_NEVER ) on all objects. |
DOFOperation.Provide |
beginProvide(DOFInterface iface,
int timeout,
DOFObject.Provider provider)
Used by a Provider to begin providing the specified interface on all objects.
|
DOFOperation.Provide |
beginProvide(DOFInterface iface,
int timeout,
DOFObject.Provider provider,
java.lang.Object context)
Used by a Provider to begin providing the specified interface on all objects.
|
DOFOperation.Query |
beginQuery(DOFObjectID oid,
DOFInterfaceID iid,
DOFSystem.QueryOperationListener operationListener)
Used by a Requestor to begin an asynchronous query with an indefinite duration for the availability of objects which provide interfaces that match the specified query.
|
DOFOperation.Query |
beginQuery(DOFObjectID oid,
DOFInterfaceID iid,
int timeout,
DOFSystem.QueryOperationListener operationListener)
Used by a Requestor to begin an asynchronous query for the availability of objects which provide interfaces that match the specified query.
|
DOFOperation.Query |
beginQuery(DOFObjectID oid,
DOFInterfaceID iid,
int timeout,
DOFSystem.QueryOperationListener operationListener,
java.lang.Object context)
Used by a Requestor to begin an asynchronous query with an indefinite duration for the availability of objects which provide interfaces that match the specified query.
|
DOFOperation.Query |
beginQuery(DOFQuery query,
DOFSystem.QueryOperationListener operationListener)
Used by a Requestor to begin an asynchronous query with an indefinite duration for the availability of objects
which provide interfaces that match the specified query.
|
DOFOperation.Query |
beginQuery(DOFQuery query,
int timeout,
DOFSystem.QueryOperationListener operationListener)
Used by a Requestor to begin an asynchronous query for the availability of objects which provide interfaces that match the specified query.
|
DOFOperation.Query |
beginQuery(DOFQuery query,
int timeout,
DOFSystem.QueryOperationListener operationListener,
java.lang.Object context)
Used by a Requestor to begin an asynchronous query for the availability of objects which provide interfaces that match the specified query.
|
DOFObject |
createObject(DOFObjectID objectID)
Create a DOFObject with the specified object identifier.
|
DOFRegistration |
createRegistration(DOFObjectID oid,
DOFInterface.Event event,
DOFOperation.Control control,
DOFRegistration.Listener listener)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFOperation.Control and context, to be notified of events and associated value(s). |
DOFRegistration |
createRegistration(DOFObjectID oid,
DOFInterface.Event event,
DOFOperation.Control control,
DOFRegistration.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFOperation.Control and context, to be notified of events and associated value(s). |
DOFRegistration |
createRegistration(DOFObjectID oid,
DOFInterface.Event event,
DOFRegistration.Listener listener)
Used by a Requestor to begin and maintain an event registration, as specified using a context, to be notified of events and associated value(s).
|
DOFRegistration |
createRegistration(DOFObjectID oid,
DOFInterface.Event event,
DOFRegistration.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain an event registration, as specified using a context, to be notified of events and associated value(s).
|
DOFRegistration |
createRegistration(DOFQuery query,
DOFInterface.Event event,
DOFOperation.Control control,
DOFRegistration.Listener listener)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFQuery , DOFOperation.Control , and a context, to be notified of events and associated value(s). |
DOFRegistration |
createRegistration(DOFQuery query,
DOFInterface.Event event,
DOFOperation.Control control,
DOFRegistration.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFQuery , DOFOperation.Control , and a context, to be notified of events and associated value(s). |
DOFRegistration |
createRegistration(DOFQuery query,
DOFInterface.Event event,
DOFRegistration.Listener listener)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFQuery and a context, to be notified of events and associated value(s). |
DOFRegistration |
createRegistration(DOFQuery query,
DOFInterface.Event event,
DOFRegistration.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain an event registration, as specified using a
DOFQuery and a context, to be notified of events and associated value(s). |
DOFSubscription |
createSubscription(DOFObjectID oid,
DOFInterface.Property property,
int minPeriod,
DOFOperation.Control control,
DOFSubscription.Listener listener)
Used by a Requestor to begin and maintain a subscription, as specified using a
DOFOperation.Control and a context, to be notified of changes to a
property's value. |
DOFSubscription |
createSubscription(DOFObjectID oid,
DOFInterface.Property property,
int minPeriod,
DOFOperation.Control control,
DOFSubscription.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain a subscription, as specified using a
DOFOperation.Control and a context, to be notified of changes to a
property's value. |
DOFSubscription |
createSubscription(DOFObjectID oid,
DOFInterface.Property property,
int minPeriod,
DOFSubscription.Listener listener)
Used by a Requestor to begin and maintain a subscription, as specified using a context, to be notified of changes to a
property's value.
|
DOFSubscription |
createSubscription(DOFObjectID oid,
DOFInterface.Property property,
int minPeriod,
DOFSubscription.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain a subscription, as specified using a context, to be notified of changes to a
property's value.
|
DOFSubscription |
createSubscription(DOFQuery query,
DOFInterface.Property property,
int minPeriod,
DOFOperation.Control control,
DOFSubscription.Listener listener)
Used by a Requestor to begin and maintain a subscription, as specified using a
DOFQuery , DOFOperation.Control , and a context, to be notified of changes to a
property's value. |
DOFSubscription |
createSubscription(DOFQuery query,
DOFInterface.Property property,
int minPeriod,
DOFOperation.Control control,
DOFSubscription.Listener listener,
java.lang.Object context)
Used by a Requestor to begin and maintain a subscription, as specified using a
DOFQuery , DOFOperation.Control , and a context, to be notified of changes to a
property's value. |
DOFSubscription |
createSubscription(DOFQuery query,
DOFInterface.Property property,
int minPeriod,
DOFSubscription.Listener listener)
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 |
createSubscription(DOFQuery query,
DOFInterface.Property property,
int minPeriod,
DOFSubscription.Listener listener,
java.lang.Object context)
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. |
void |
destroy()
Destroys a DOFSystem.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<DOFInterfaceID> |
getProviderInterfaces(DOFObjectID objectID)
Used by a Requestor (typically) to get all the interfaces currently provided by the specified object in this System.
|
DOFRouteInfo |
getProviderRoute(DOFObjectID objectID,
DOFInterfaceID interfaceID)
Return current route information for the best, compatible provider (if any).
|
int |
getRemoteDomainID(DOFSecurityScope scope)
Get the remote domain identifier of the given scope with the system domain as a parent.
|
DOFSystem.State |
getState()
Get the current instantaneous state of the system.
|
int |
hashCode() |
boolean |
isInterestRequested(DOFObjectID objectID,
DOFInterfaceID interfaceID,
DOFInterestLevel level)
Used by a Provider to determine if interest being requested for the specified object and interface.
|
java.util.List<DOFObjectID> |
query(DOFObjectID oid,
DOFInterfaceID iid)
Used by a Requestor to query for the set of currently available objects, which provide interfaces that match the specified query.
|
java.util.List<DOFObjectID> |
query(DOFQuery query)
Used by a Requestor to query for the set of currently available objects, which provide interfaces that match the specified query.
|
void |
removeActivateInterestListener(DOFSystem.ActivateInterestListener listener)
Used by a Provider to remove an
DOFSystem.ActivateInterestListener . |
void |
removeRouteListener(DOFSystem.RouteListener listener)
Remove a route listener for this system.
|
void |
removeStateListener(DOFSystem.StateListener listener)
Remove a state listener from the system.
|
void |
waitAuthorized(int timeout)
Wait until a system is authorized or the timeout is up.
|
DOFObject |
waitProvider(DOFInterfaceID interfaceID,
int timeout)
Used by a Requestor to block the caller and wait until the first available provider becomes available that provides the specified interface.
|
DOFObject |
waitProvider(DOFObjectID objectID,
DOFInterfaceID interfaceID,
int timeout)
Used by a Requestor to block the caller and wait until a provider becomes available with a matching object identifier and that provides the specified interface.
|
DOFObject |
waitProvider(DOFObjectID objectID,
java.util.List<DOFInterfaceID> interfaceIDs,
int timeout)
Used by a Requestor to block the caller and wait until a provider becomes available with a matching identifier and that provides all of the specified interfaces.
|
DOFObject |
waitProvider(java.util.List<DOFInterfaceID> interfaceIDs,
int timeout)
Used by a Requestor to block the caller and wait until the first provider becomes available that provides all of the specified interfaces.
|
public void destroy()
DOF.destroy()
. Any attempt to use a destroyed DOFSystem will result in undefined
behavior.DOF.createSystem()
public DOFSystem.State getState()
public void waitAuthorized(int timeout) throws DOFException
timeout
- The time in milliseconds to wait for the system to authorize.DOFException
- If the system fails to authorize in the given timeout.public java.util.Collection<DOFInterfaceID> getProviderInterfaces(DOFObjectID objectID)
objectID
- The object identifier. This must not be null.public DOFRouteInfo getProviderRoute(DOFObjectID objectID, DOFInterfaceID interfaceID)
objectID
- The object identifier. This must not be null and should not be the Broadcast ID.interfaceID
- The interface identifier. This must not be null and should not be the Wildcard ID.public DOFObject waitProvider(DOFInterfaceID interfaceID, int timeout) throws DOFErrorException
DOFSystem.QueryOperationListener
. Since it is a blocking call, only one value
is returned. Therefore, only the first provide that matches the specified interface is returned.
In this call, DOFQuery.MatchStyle.BASE
is used.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers.interfaceID
- The interface identifier. This must not be null and must be a specific interface ID (not the Wildcard ID).timeout
- Maximum time to wait, in milliseconds, for the provider to become available. Must be >= 0.DOFObject
that must be destroyed when no longer needed.DOFErrorException
- If the provider cannot be returned in the time specified.DOFObject.destroy()
public DOFObject waitProvider(DOFObjectID objectID, DOFInterfaceID interfaceID, int timeout) throws DOFErrorException
DOFSystem.QueryOperationListener
. Since it is a blocking call, only one value
is returned. Therefore, only the first provide that matches the specified interface is returned.
waitProvider uses the same logic as DOFQuery.MatchStyle.AT_LEAST
unless DOFObjectID.BROADCAST
is passed.
In that case, DOFQuery.MatchStyle.BASE
is used.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers.objectID
- The object identifier. This must not be null and must not be multicast. The Broadcast ID may be used to indicate the first available provider should be returned.interfaceID
- The interface identifier. This must not be null and must be a specific interface ID (not the Wildcard ID).timeout
- Maximum time to wait, in milliseconds, for the provider to become available. Must be >= 0.DOFObject
that must be destroyed when no longer needed.DOFErrorException
- If the provider cannot be returned in the time specified.DOFObject.destroy()
public DOFObject waitProvider(java.util.List<DOFInterfaceID> interfaceIDs, int timeout) throws DOFErrorException
DOFSystem.QueryOperationListener
. Since it is a blocking call, only one value
is returned. Therefore, only the first provide that matches one of the specified interfaces is returned.
In this call, DOFQuery.MatchStyle.BASE
is used.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers.interfaceIDs
- A list of interface identifiers. This must not be null or empty and may not contain null nor the Wildcard ID.timeout
- Maximum time to wait, in milliseconds, for the provider to become available. Must be >= 0.DOFObject
that must be destroyed when no longer needed.DOFErrorException
- If the provider cannot be returned in the time specified.DOFObject.destroy()
public DOFObject waitProvider(DOFObjectID objectID, java.util.List<DOFInterfaceID> interfaceIDs, int timeout) throws DOFErrorException
DOFSystem.QueryOperationListener
. Since it is a blocking call, only one value
is returned. Therefore, only the first provide that matches one of the specified interfaces is returned.
waitProvider uses the same logic as DOFQuery.MatchStyle.AT_LEAST
unless DOFObjectID.BROADCAST
is passed.
In that case, DOFQuery.MatchStyle.BASE
is used.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers.objectID
- The object identifier. This must not be null and must not be multicast. The Broadcast ID may be used to indicate the first available provider should be returned.interfaceIDs
- A list of interface identifiers. This must not be null or empty and may not contain null nor the Wildcard ID.timeout
- Maximum time to wait, in milliseconds, for the provider to become available. Must be >= 0.DOFObject
that must be destroyed when no longer needed.DOFErrorException
- If the provider cannot be returned in the time specified.DOFObject.destroy()
public java.util.List<DOFObjectID> query(DOFObjectID oid, DOFInterfaceID iid)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those already found through interest).
oid
- Object ID to match. May be null.iid
- Interface ID to match. May be null.beginQuery(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterfaceID, org.opendof.core.oal.DOFSystem.QueryOperationListener)
public java.util.List<DOFObjectID> query(DOFQuery query)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those already found through interest).query
- The query to match. If null, then the query matches all provides compatible with the system.beginQuery(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterfaceID, org.opendof.core.oal.DOFSystem.QueryOperationListener)
public DOFOperation.Query beginQuery(DOFObjectID oid, DOFInterfaceID iid, DOFSystem.QueryOperationListener operationListener)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).
oid
- Object ID to match. May be null.iid
- Interface ID to match. May be null.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.public DOFOperation.Query beginQuery(DOFObjectID oid, DOFInterfaceID iid, int timeout, DOFSystem.QueryOperationListener operationListener)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).
oid
- Object ID to match. May be null.iid
- Interface ID to match. May be null.timeout
- How long in milliseconds that the query should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.public DOFOperation.Query beginQuery(DOFObjectID oid, DOFInterfaceID iid, int timeout, DOFSystem.QueryOperationListener operationListener, java.lang.Object context)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).
oid
- Object ID to match. May be null.iid
- Interface ID to match. May be null.timeout
- How long in milliseconds that the query should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.context
- Application context for the query. The context is returned with the operation when a operationListener is called.
A value of null represents 'no context', but will be handled just like a non-null value.public DOFOperation.Query beginQuery(DOFQuery query, DOFSystem.QueryOperationListener operationListener)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).query
- The query to match. If null, then the query matches all provides compatible with the system.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.public DOFOperation.Query beginQuery(DOFQuery query, int timeout, DOFSystem.QueryOperationListener operationListener)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).query
- The query to match. If null, then the query matches all provides compatible with the system.timeout
- How long in milliseconds that the query should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.public DOFOperation.Query beginQuery(DOFQuery query, int timeout, DOFSystem.QueryOperationListener operationListener, java.lang.Object context)
beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
. Interest goes out on the network and looks for matching
providers. query, on the other hand, searches through the local set of known providers (those found through interest).query
- The query to match. If null, then the query matches all provides compatible with the system.timeout
- How long in milliseconds that the query should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. This must not be null, or no notifications can be received.context
- Application context for the query. The context is returned with the operation when a operationListener is called.
A value of null represents 'no context', but will be handled just like a non-null value.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterestLevel level)
Note: Since this is the same as specifying DOFInterfaceID.WILDCARD
only use this method for WATCH and
ACTIVATE levels of interest.
objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.level
- The level of interest. This must not be null.public DOFOperation.Interest beginInterest(DOFInterfaceID interfaceID, DOFInterestLevel level)
Note: Since this is the same as specifying DOFObjectID.BROADCAST
only use this method for WATCH and
ACTIVATE levels of interest.
interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level)
objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level, int timeout)
DOFOperation.waitComplete()
can be called on the returned operation to wait for it to complete.objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.timeout
- How long in milliseconds that the interest should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level, int timeout, DOFSystem.InterestOperationListener operationListener)
objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.timeout
- How long in milliseconds that the interest should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. A null value means no operationListener will be called.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level, int timeout, DOFSystem.InterestOperationListener operationListener, java.lang.Object context)
objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.timeout
- How long in milliseconds that the interest should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. A null value means no operationListener will be called.context
- Application context for the query. The context is returned with the operation when a operationListener is called.
A value of null represents 'no context', but will be handled just like a non-null value.public DOFOperation.Interest beginInterest(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level, DOFOperation.Control control, int timeout, DOFSystem.InterestOperationListener operationListener, java.lang.Object context)
objectID
- The identifier of the object. This must not be null. This may not be BROADCAST for the CONNECT-level interest.interfaceID
- The interface of interest. This must not be null. This may not be WILDCARD for the CONNECT-level interest.level
- The level of interest. This must not be null.control
- The DOFOperation.Control
to use for the request. May be null, which indicates default Control.timeout
- How long in milliseconds that the interest should remain active. During this period, the operationListener will be
called as matching providers become available. Must be >= 0.operationListener
- The operationListener for receiving asynchronous notification. A null value means no operationListener will be called.context
- Application context for the query. The context is returned with the operation when a operationListener is called.
A value of null represents 'no context', but will be handled just like a non-null value.public DOFOperation.Provide beginProvide(DOFInterface iface, DOFObject.Provider provider)
DOF.TIMEOUT_NEVER
) on all objects.
To quit providing use DOFOperation.cancel()
.
The Provider will only respond to Get, Set, Invoke, and Define requests. That is, the provider will not respond to any interest-based activity.
You will interact with this Provider only from a Requestor that has no interest, meaning a Requestor that will flood its requests.
NOTE: Since all object IDs are accepted, all attributes are accepted too. In a secure deployment, make sure that where the
DOFPermission.Binding.ACTION_PROVIDE
action is specified, no objectID is specified and
DOFPermission.Binding.Builder.setAllAttributesAllowed(boolean)
is true. This will allow
the provider to work as an "All Objects" provider.iface
- The interface to be provided. This must not be null.provider
- The listener to handle requests on this interface. Null = no desired listener (may be used for "marker interfaces"/no provider implementation).public DOFOperation.Provide beginProvide(DOFInterface iface, int timeout, DOFObject.Provider provider)
DOFPermission.Binding.ACTION_PROVIDE
action is specified, no objectID is specified and
DOFPermission.Binding.Builder.setAllAttributesAllowed(boolean)
is true. This will allow
the provider to work as an "All Objects" provider.iface
- The interface to be provided. This must not be null.timeout
- Time, in milliseconds, for the provide to remain active. Must be >= 0. Use
DOF.TIMEOUT_NEVER
to provide indefinitely. Then use DOFOperation.cancel()
to quit providing.
If used in conjunction with DOFObject.beginSession(org.opendof.core.oal.DOFInterface, org.opendof.core.oal.DOFInterfaceID)
, use DOF.TIMEOUT_NEVER.provider
- The listener to handle requests on this interface. Null = no desired listener (may be used for "marker interfaces"/no provider implementation).public DOFOperation.Provide beginProvide(DOFInterface iface, int timeout, DOFObject.Provider provider, java.lang.Object context)
DOFPermission.Binding.ACTION_PROVIDE
action is specified, no objectID is specified and
DOFPermission.Binding.Builder.setAllAttributesAllowed(boolean)
is true. This will allow
the provider to work as an "All Objects" provider.iface
- The interface to be provided. This must not be null.timeout
- Time, in milliseconds, for the provide to remain active. Must be >= 0. Use
DOF.TIMEOUT_NEVER
to provide indefinitely. Then use DOFOperation.cancel()
to quit providing.
If used in conjunction with DOFObject.beginSession(org.opendof.core.oal.DOFInterface, org.opendof.core.oal.DOFInterfaceID)
, use DOF.TIMEOUT_NEVER.provider
- The listener to handle requests on this interface. Null = no desired listener (may be used for "marker interfaces"/no provider implementation).context
- A user-definable object that will be passed back in listeners as part of the DOFOperation.public DOFObject createObject(DOFObjectID objectID)
waitProvider(org.opendof.core.oal.DOFInterfaceID, int)
instead.objectID
- The object identifier for the object to create. This must not be null.DOFObject.destroy()
public void addActivateInterestListener(DOFSystem.ActivateInterestListener listener)
DOFSystem.ActivateInterestListener
to be notified of interest requests.listener
- The interest listener to add. This must not be null.public void removeActivateInterestListener(DOFSystem.ActivateInterestListener listener)
DOFSystem.ActivateInterestListener
.listener
- The listener to remove. Must not be null.public void addRouteListener(DOFSystem.RouteListener listener)
DOFSystem.RouteListener
will immediately begin receiving provide updates.
Adding a listener that has already been added has no effect.listener
- The listener. This must not be null.public void removeRouteListener(DOFSystem.RouteListener listener)
DOFSystem.RouteListener
will soon stop receiving provide updates. Removing
a listener that has not been added or has already been removed has no effect.listener
- The listener to remove. This must not be null.public boolean isInterestRequested(DOFObjectID objectID, DOFInterfaceID interfaceID, DOFInterestLevel level)
objectID
- The object ID. This must not be null. The Broadcast ID only matches interest where the Broadcast ID was used to express interest.interfaceID
- The interface identifier. This may be null meaning any. The Wildcard ID only matches interest where the Wildcard ID was used to express interest.level
- The level of interest. This must not be null. Current interest at or above the specified level will give an affirmative result.public int getRemoteDomainID(DOFSecurityScope scope)
scope
- The scope.public DOFSubscription createSubscription(DOFObjectID oid, DOFInterface.Property property, int minPeriod, DOFSubscription.Listener listener, java.lang.Object context) throws DOFErrorException
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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast subscriptions in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.property
- The property. Must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFObjectID oid, DOFInterface.Property property, int minPeriod, DOFSubscription.Listener listener) throws DOFErrorException
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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast subscriptions in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.property
- The property. Must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFObjectID oid, DOFInterface.Property property, int minPeriod, DOFOperation.Control control, DOFSubscription.Listener listener, java.lang.Object context) throws DOFErrorException
DOFOperation.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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast subscriptions in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.property
- The property. Must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.control
- The control to use for the request.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFObjectID oid, DOFInterface.Property property, int minPeriod, DOFOperation.Control control, DOFSubscription.Listener listener) throws DOFErrorException
DOFOperation.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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast subscriptions in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.property
- The property. Must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.control
- The control to use for the request.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFQuery query, DOFInterface.Property property, int minPeriod, DOFSubscription.Listener listener, java.lang.Object context) throws DOFErrorException
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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.property
- The property. Must not be null.query
- The query to use to find the provider. This must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFQuery query, DOFInterface.Property property, int minPeriod, DOFSubscription.Listener listener) throws DOFErrorException
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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.property
- The property. Must not be null.query
- The query to use to find the provider. This must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFQuery query, DOFInterface.Property property, int minPeriod, DOFOperation.Control control, DOFSubscription.Listener listener, java.lang.Object context) throws DOFErrorException
DOFQuery
, DOFOperation.Control
, 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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.property
- The property. Must not be null.query
- The query to use to find the provider. This must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.control
- The control to use for the request.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFSubscription createSubscription(DOFQuery query, DOFInterface.Property property, int minPeriod, DOFOperation.Control control, DOFSubscription.Listener listener) throws DOFErrorException
DOFQuery
, DOFOperation.Control
, 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(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.property
- The property. Must not be null.query
- The query to use to find the provider. This must not be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications. Must be >= 0.control
- The control to use for the request.listener
- Listener to receive state-changed and value-changed notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation. Exception errorCode is:
public DOFRegistration createRegistration(DOFObjectID oid, DOFInterface.Event event, DOFRegistration.Listener listener, java.lang.Object context) throws DOFErrorException
DOFObjectID.BROADCAST
, DOFRegistration will register for all matching providers at the time the registration is created.
Otherwise, it will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast registrations in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.event
- The event. Must not be null.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFObjectID oid, DOFInterface.Event event, DOFRegistration.Listener listener) throws DOFErrorException
DOFObjectID.BROADCAST
, DOFRegistration will register for all matching providers at the time the registration is created.
Otherwise, it will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast registrations in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.event
- The event. Must not be null.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFObjectID oid, DOFInterface.Event event, DOFOperation.Control control, DOFRegistration.Listener listener, java.lang.Object context) throws DOFErrorException
DOFOperation.Control
and context, to be notified of events and associated value(s).
If oid is DOFObjectID.BROADCAST
, DOFRegistration will register for all matching providers at the time the registration is created.
Otherwise, it will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast registrations in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.event
- The event. Must not be null.control
- The control to use for the request.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFObjectID oid, DOFInterface.Event event, DOFOperation.Control control, DOFRegistration.Listener listener) throws DOFErrorException
DOFOperation.Control
and context, to be notified of events and associated value(s).
If oid is DOFObjectID.BROADCAST
, DOFRegistration will register for all matching providers at the time the registration is created.
Otherwise, it will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
for unicast registrations in order to determine the primary provider.
If no interest is specified, then no non-local providers will be found.oid
- The identifier of the object. This must not be null. May be DOFObjectID.BROADCAST.event
- The event. Must not be null.control
- The control to use for the request.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFQuery query, DOFInterface.Event event, DOFRegistration.Listener listener, java.lang.Object context) throws DOFErrorException
DOFQuery
and a context, to be notified of events and associated value(s).
DOFRegistration will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.event
- The event. Must not be null.query
- The query to use to find the provider. This must not be null.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFQuery query, DOFInterface.Event event, DOFRegistration.Listener listener) throws DOFErrorException
DOFQuery
and a context, to be notified of events and associated value(s).
DOFRegistration will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.event
- The event. Must not be null.query
- The query to use to find the provider. This must not be null.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFQuery query, DOFInterface.Event event, DOFOperation.Control control, DOFRegistration.Listener listener, java.lang.Object context) throws DOFErrorException
DOFQuery
, DOFOperation.Control
, and a context, to be notified of events and associated value(s).
DOFRegistration will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.event
- The event. Must not be null.query
- The query to use to find the provider. This must not be null.control
- The control to use for the request.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).context
- An optional, user-definable object that will be passed back in listeners as a member of
DOFOperation. May be null.DOFErrorException
- If parameters fail validation.public DOFRegistration createRegistration(DOFQuery query, DOFInterface.Event event, DOFOperation.Control control, DOFRegistration.Listener listener) throws DOFErrorException
DOFQuery
, DOFOperation.Control
, and a context, to be notified of events and associated value(s).
DOFRegistration will select one matching provider and register for its matching event.
If there is no matching provider, then DOFRegistration will wait for one.
If the provider goes away, then the search will resume for a matching provider.
To cancel the registration, call DOFRegistration.destroy()
.
NOTE: The listener should be notified very soon through the DOFRegistration.Listener.stateChanged(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFRegistration.State)
method that
the registration is active, but until an event actually occurs, DOFRegistration.Listener.eventSignaled(org.opendof.core.oal.DOFRegistration, org.opendof.core.oal.DOFObjectID, java.util.List<org.opendof.core.oal.DOFValue>)
won't be called.
NOTE: An application must first express interest by calling beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.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.event
- The event. Must not be null.query
- The query to use to find the provider. This must not be null.control
- The control to use for the request.listener
- Listener to receive state-changed and event-occurred notifications. Should not be null (or notifications cannot be received).DOFErrorException
- If parameters fail validation.public void addStateListener(DOFSystem.StateListener listener)
listener
- The new listenerpublic void removeStateListener(DOFSystem.StateListener listener)
listener
- The listener to remove.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object