Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interfaces/astm-utm/Protocol
Submodule Protocol updated 1 files
+15 −0 utm.yaml
6 changes: 6 additions & 0 deletions interfaces/openapi-to-go-server/example/api/scd/types.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ type SubscriberToNotify struct {
// Subscription(s) prompting this notification.
Subscriptions []SubscriptionState `json:"subscriptions"`

// Created by the DSS based on creating client's ID (via access token)
Manager string `json:"manager"`

UssBaseUrl SubscriptionUssBaseURL `json:"uss_base_url"`
}

// Specification of a geographic area that a client is interested in on an ongoing basis (e.g., "planning area").
type Subscription struct {
Id SubscriptionID `json:"id"`

// Created by the DSS based on creating client's ID (via access token). Used internal to the DSS for restricting read, mutation and deletion operations to manager.
Manager string `json:"manager"`

// Version of the subscription that the DSS changes every time a USS changes the subscription. The DSS incrementing the notification_index does not constitute a change that triggers a new version. A USS must specify this version when modifying an existing subscription to ensure consistency in read-modify-write operations and distributed systems.
Version string `json:"version"`

Expand Down
6 changes: 6 additions & 0 deletions pkg/api/scdv1/types.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ type SubscriberToNotify struct {
// Subscription(s) prompting this notification.
Subscriptions []SubscriptionState `json:"subscriptions"`

// Created by the DSS based on creating client's ID (via access token)
Manager string `json:"manager"`

UssBaseUrl SubscriptionUssBaseURL `json:"uss_base_url"`
}

// Specification of a geographic area that a client is interested in on an ongoing basis (e.g., "planning area").
type Subscription struct {
Id SubscriptionID `json:"id"`

// Created by the DSS based on creating client's ID (via access token). Used internal to the DSS for restricting read, mutation and deletion operations to manager.
Manager string `json:"manager"`

// Version of the subscription that the DSS changes every time a USS changes the subscription. The DSS incrementing the notification_index does not constitute a change that triggers a new version. A USS must specify this version when modifying an existing subscription to ensure consistency in read-modify-write operations and distributed systems.
Version string `json:"version"`

Expand Down
1 change: 1 addition & 0 deletions pkg/scd/models/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Subscription struct {
func (s *Subscription) ToRest(dependentOperationalIntents []dssmodels.ID) (*restapi.Subscription, error) {
result := &restapi.Subscription{
Id: restapi.SubscriptionID(s.ID.String()),
Manager: s.Manager.String(),
Version: s.Version.String(),
NotificationIndex: restapi.SubscriptionNotificationIndex(s.NotificationIndex),
UssBaseUrl: restapi.SubscriptionUssBaseURL(s.USSBaseURL),
Expand Down
17 changes: 13 additions & 4 deletions pkg/scd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@ import (
func makeSubscribersToNotify(subscriptions []*scdmodels.Subscription) []restapi.SubscriberToNotify {
result := []restapi.SubscriberToNotify{}

subscriptionsByURL := map[string][]restapi.SubscriptionState{}
type uss struct {
manager string
baseUrl restapi.SubscriptionUssBaseURL
}
subscriptionsByUSS := map[uss][]restapi.SubscriptionState{}
for _, sub := range subscriptions {
subState := restapi.SubscriptionState{
SubscriptionId: restapi.SubscriptionID(sub.ID.String()),
NotificationIndex: restapi.SubscriptionNotificationIndex(sub.NotificationIndex),
}
subscriptionsByURL[sub.USSBaseURL] = append(subscriptionsByURL[sub.USSBaseURL], subState)
uss := uss{
manager: sub.Manager.String(),
baseUrl: restapi.SubscriptionUssBaseURL(sub.USSBaseURL),
}
subscriptionsByUSS[uss] = append(subscriptionsByUSS[uss], subState)
}
for url, states := range subscriptionsByURL {
for uss, states := range subscriptionsByUSS {
result = append(result, restapi.SubscriberToNotify{
UssBaseUrl: restapi.SubscriptionUssBaseURL(url),
Manager: uss.manager,
UssBaseUrl: uss.baseUrl,
Subscriptions: states,
})
}
Expand Down
Loading