Skip to content
Snippets Groups Projects
Commit f691b7cc authored by Fabian Seidl's avatar Fabian Seidl
Browse files

fixed minor issues as renaming, removing import due to review remarks

parent 098b8ebd
No related branches found
No related tags found
1 merge request!416Resolve "Refactor how PNDs are implemented in the code"
......@@ -30,9 +30,7 @@ import (
apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac"
tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology"
//TODO: check if both of 'app' are necessary?
"code.fbi.h-da.de/danet/gosdn/controller/app"
apps "code.fbi.h-da.de/danet/gosdn/controller/app"
"code.fbi.h-da.de/danet/gosdn/controller/config"
"code.fbi.h-da.de/danet/gosdn/controller/conflict"
......@@ -134,7 +132,7 @@ func initialize() error {
routeService: routeService,
eventService: eventService,
pluginService: pluginService,
appService: apps.NewAppService(apps.NewAppStore()),
appService: app.NewAppService(app.NewAppStore()),
stopChan: make(chan os.Signal, 1),
pluginRegistryClient: pluginRegistryClient,
}
......@@ -149,7 +147,7 @@ func initialize() error {
}
c.networkElementWatcher = nucleus.NewNetworkElementWatcher(c.mneService, c.eventService)
c.networkElementWatcher.SubToNetworkElements(config.GetGnmiSubscriptionPaths(), nil)
c.networkElementWatcher.SubscribeToNetworkElements(config.GetGnmiSubscriptionPaths(), nil)
if err := ensureDefaultRoleExists(); err != nil {
return err
......
......@@ -48,10 +48,10 @@ func NewNetworkElementWatcher(mneService networkelement.Service, eventService ev
}
}
// SubToNetworkElements subscribes to every available network element in each network domain according to provided SubscribeOptions.
// SubscribeToNetworkElements subscribes to every available network element in each network domain according to provided SubscribeOptions.
// Paths should be provided in the following format [][]string{{"system", "config", "hostname"}}
// SubscribeOptions can be nil. Use nil for a fixed, pre-defined set of gNMI subscription options (streaming in sample mode each second).
func (n *NetworkElementWatcher) SubToNetworkElements(paths [][]string, opts *gnmi.SubscribeOptions) {
func (n *NetworkElementWatcher) SubscribeToNetworkElements(paths [][]string, opts *gnmi.SubscribeOptions) {
if opts == nil {
opts = &gnmi.SubscribeOptions{
Mode: gNMISubscribeMode,
......@@ -68,11 +68,11 @@ func (n *NetworkElementWatcher) SubToNetworkElements(paths [][]string, opts *gnm
}
for _, mne := range mnes {
n.subscribeToPndNetworkElements(mne, opts)
n.subscribeToNetworkElement(mne, opts)
}
}
func (n *NetworkElementWatcher) subscribeToPndNetworkElements(mne networkelement.NetworkElement, opts *gnmi.SubscribeOptions) {
func (n *NetworkElementWatcher) subscribeToNetworkElement(mne networkelement.NetworkElement, opts *gnmi.SubscribeOptions) {
subID := uuid.New()
stopContext, cancel := context.WithCancel(context.Background())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment