Package com.boschrexroth.api
Interface Provider
- All Superinterfaces:
AutoCloseable
Provider interface to manage provider nodes
This interface extends AutoCloseable, indicating that resources held
by implementations of this interface should be properly released when no
longer needed, typically by calling the close() method.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the last error that occurred during a provider operation.Return the current registered node pathsgetRegisteredType(String address) Get the variant of a registered typeReturn the current rejected node pathsgetToken()Return the current token of the current request you can call this function during your onRead, onWrite, ...booleanReturns whether provider is connectedpublishEvent(Variant data, Variant eventInfo) Publishes an eventregisterNode(String address, ProviderNode node) Register a node callback to the datalayerregisterType(String address, String pathname) Register a type to the datalayerregisterTypeVariant(String address, Variant data) Register a type to the datalayersetTimeoutNode(ProviderNode node, long timeout) Set timeout for a node for asynchron requests (default value is 1000ms)start()Starts the provider.stop()Stop the providerunregisterNode(String address) Unregister a node from the datalayerunregisterType(String address) Unregister a type from the datalayerMethods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
getLastError
Result getLastError()Retrieves the last error that occurred during a provider operation.- Returns:
- A
Resultobject detailing the last error.
-
start
Result start()Starts the provider.- Returns:
- A
Resultobject detailing the last error.
-
stop
Result stop()Stop the provider- Returns:
- A
Resultobject detailing the last error.
-
isConnected
boolean isConnected()Returns whether provider is connected- Returns:
- status of connection
-
registerType
Register a type to the datalayer- Parameters:
address- Address of the node to register (no wildcards allowed)pathname- Path to flatbuffer bfbs- Returns:
- A
Resultobject detailing the last error.
-
registerTypeVariant
Register a type to the datalayer -
unregisterType
Unregister a type from the datalayer- Parameters:
address- Address of the node to register (wildcards allowed)- Returns:
- A
Resultobject detailing the last error.
-
getRegisteredType
Get the variant of a registered type- Parameters:
address- Address of the type to get type (no wildcards allowed)- Returns:
- A
Variantto stored type (VariantType.UNKNON see getLastError())
-
getToken
Variant getToken()Return the current token of the current request you can call this function during your onRead, onWrite, ... methods of your ProviderNodes. if there is no current request the method return an empty token- Returns:
- A
Variantas current token
-
registerNode
Register a node callback to the datalayer- Parameters:
address- Address of the node to register (wildcards allowed)node- AProviderNodeto register- Returns:
- A
Resultobject detailing the last error.
-
unregisterNode
Unregister a node from the datalayer- Parameters:
address- Address of the node to register (wildcards allowed)- Returns:
- A
Resultobject detailing the last error.
-
setTimeoutNode
Set timeout for a node for asynchron requests (default value is 1000ms)- Parameters:
node- Node to set timeout fortimeout- Timeout in milliseconds for this node- Returns:
- A
Resultobject detailing the last error.
-
getRegisteredNodePaths
Variant getRegisteredNodePaths()Return the current registered node paths- Returns:
- A
Variantwhich includes the registered node paths after this function see.getLastError()
-
getRejectedNodePaths
Variant getRejectedNodePaths()Return the current rejected node paths- Returns:
- A
Variantwhich includes the rejected node paths after this function see.getLastError()
-
publishEvent
Publishes an event
-