-
Notifications
You must be signed in to change notification settings - Fork 13
Service providers
SHV use concept of so called providers
. Provider can provide values of shv node/device which are not known to node, but has strong relationship to it, for example: history, configuration, visualization, etc. Provider can attach dir to SHV node to provide extra functionality (nodes, methods) if they are not provided by SHV node itself.
-
foo@bar~:/path
-foo
provider on broker with IDbar
call -
foo~:/path
- anonymous first up-treefoo
provider call, do not use in production environment, since first up-tree provider might change when some provider connectivity is lost
path
is extended by caller node mount-path. Broker root node service
is searched for path
. If path is not found request is sent to parent broker then to its parent, etc. until it is found.
+- shv
| +- my
| +- device
+- config
| +- my
| +- device
| +- gps
+- history
...
-
config~:/device.conf
my config, absolute path:config/my/device/device.conf
-
config~:/gps/device.conf
my configgps
node, absolute path:config/my/device/gps/device.conf
sites~:/_files/anca.conf
Each node has right to read/write it's attached nodes. Requests are forwarded to service provider with access role 'wr'. Note, that service provider path cannot be absolute, it is always relative to caller node mount point.
same as relative path, but path is not extended by prepending caller node mount path
Use-case: Reading attached nodes of other node
-
service@broker123|:/path
- provider at broker with ID ==broker123
call -
service|:/path
- anonymous first upstream provider call, do not use in production environment, since first up-tree provider might change when some provider connectivity is lost
If service provider path is absolute, then roles of calling sub-broker are used to resolve access rights.
- Anonymous service providers calls (without
broker-id
specified) can be ambiguous in case that some service provider in hierarchy will disconnect from its broker.- This can be solved if all the brokers on the way will resolve request regardless the service provider is connected or not. Each broker has mount table, so it knows if particular service should be present or not.
- Other solution is to have
.broker@super-id|:/app/providedServices()
implemented but this moves discovery logic to the client. - There is one use-case for this. ServiceProviders replicate its sub-tree from master, so it does not matter which one will answer to the RPC request, since responses should be always the same. But I'm still not sure if this should be enough to introduce the feature. Rather not for now.
-
broker-id
of first super-broker can be discovered by call:.broker/app/masterBrokerId()
on current broker. Calling.broker@master-id|:/app/masterBrokerId()
on discovered broker will return ID of themaster-id
broker master one.
-
foo@bar>:/path/to/the/node
-foo
provider will be called on first down-tree broker with id ==bar
- Slave broker have to somehow translate path from request to it's address space.
- path:
history@mpkbroker>:/shv/pol/ols/mpk/tram/sig/zoneA/anca1
-
mpkbroker
sub-broker is mounted atshv/pol/ols/mpk
-
mpkbroker
sub-broker exportsshv/mpk
- resolved path on
mpkbroker
sub-broker:history/mpk/tram/sig/zoneA/anca1
-
Down-tree calls might be replaced by .local
virtual directory in future