Skip to content

Commit 9cd8985

Browse files
committed
Rename Read/Write Node API to Annotation API
(cf. AMWA-TV/is-13#19)
1 parent bf67e66 commit 9cd8985

22 files changed

+118
-95
lines changed

Development/cmake/NmosCppLibraries.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,12 @@ set(NMOS_IS13_SCHEMAS_HEADERS
695695
set(NMOS_IS13_V1_0_TAG v1.0-dev)
696696

697697
set(NMOS_IS13_V1_0_SCHEMAS_JSON
698+
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/annotationapi-base.json
699+
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/annotationapi-node-base.json
698700
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/error.json
699701
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/resource_core.json
700702
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/resource_core_patch.json
701703
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/resource_cores.json
702-
third_party/is-13/${NMOS_IS13_V1_0_TAG}/APIs/schemas/rwnodeapi-base.json
703704
)
704705

705706
set(NMOS_IS13_SCHEMAS_JSON_MATCH "third_party/is-13/([^/]+)/APIs/schemas/([^;]+)\\.json")
@@ -813,6 +814,7 @@ set(NMOS_CPP_CPPREST_DETAILS_HEADERS
813814
set(NMOS_CPP_NMOS_SOURCES
814815
nmos/activation_utils.cpp
815816
nmos/admin_ui.cpp
817+
nmos/annotation_api.cpp
816818
nmos/api_downgrade.cpp
817819
nmos/api_utils.cpp
818820
nmos/capabilities.cpp
@@ -864,7 +866,6 @@ set(NMOS_CPP_NMOS_SOURCES
864866
nmos/registry_server.cpp
865867
nmos/resource.cpp
866868
nmos/resources.cpp
867-
nmos/rwnode_api.cpp
868869
nmos/schemas_api.cpp
869870
nmos/sdp_utils.cpp
870871
nmos/server.cpp
@@ -879,6 +880,7 @@ set(NMOS_CPP_NMOS_HEADERS
879880
nmos/activation_mode.h
880881
nmos/activation_utils.h
881882
nmos/admin_ui.h
883+
nmos/annotation_api.h
882884
nmos/api_downgrade.h
883885
nmos/api_utils.h
884886
nmos/api_version.h
@@ -958,7 +960,6 @@ set(NMOS_CPP_NMOS_HEADERS
958960
nmos/registry_server.h
959961
nmos/resource.h
960962
nmos/resources.h
961-
nmos/rwnode_api.h
962963
nmos/schemas_api.h
963964
nmos/sdp_utils.h
964965
nmos/server.h

Development/cmake/NmosCppTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ set(NMOS_CPP_TEST_MDNS_TEST_HEADERS
3939
)
4040

4141
set(NMOS_CPP_TEST_NMOS_TEST_SOURCES
42+
nmos/test/annotation_api_test.cpp
4243
nmos/test/api_utils_test.cpp
4344
nmos/test/capabilities_test.cpp
4445
nmos/test/channels_test.cpp
4546
nmos/test/did_sdid_test.cpp
4647
nmos/test/event_type_test.cpp
4748
nmos/test/json_validator_test.cpp
4849
nmos/test/paging_utils_test.cpp
49-
nmos/test/rwnode_api_test.cpp
5050
nmos/test/query_api_test.cpp
5151
nmos/test/sdp_utils_test.cpp
5252
nmos/test/system_resources_test.cpp

Development/nmos-cpp-node/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
//"events_port": 3216,
136136
//"events_ws_port": 3217,
137137
//"channelmapping_port": 3215,
138-
//"rwnode_port": 3212,
138+
//"annotation_port": 3212,
139139
// system_port [node]: used to construct request URLs for the System API (if not discovered via DNS-SD)
140140
//"system_port": 10641,
141141

Development/nmos-cpp-node/node_implementation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,14 +1269,14 @@ nmos::channelmapping_activation_handler make_node_implementation_channelmapping_
12691269
};
12701270
}
12711271

1272-
// Example Read/Write Node API patch callback to update resource labels, descriptions and tags
1273-
nmos::rwnode_patch_merger make_node_implementation_rwnode_patch_merger(slog::base_gate& gate)
1272+
// Example Annotation API patch callback to update resource labels, descriptions and tags
1273+
nmos::annotation_patch_merger make_node_implementation_annotation_patch_merger(slog::base_gate& gate)
12741274
{
12751275
return [&gate](const nmos::resource& resource, web::json::value& value, const web::json::value& patch)
12761276
{
12771277
const std::pair<nmos::id, nmos::type> id_type{ resource.id, resource.type };
12781278
slog::log<slog::severities::info>(gate, SLOG_FLF) << nmos::stash_category(impl::categories::node_implementation) << "Updating " << id_type;
1279-
nmos::details::merge_rwnode_patch(value, patch);
1279+
nmos::details::merge_annotation_patch(value, patch);
12801280
};
12811281
}
12821282

@@ -1434,5 +1434,5 @@ nmos::experimental::node_implementation make_node_implementation(nmos::node_mode
14341434
.on_connection_activated(make_node_implementation_connection_activation_handler(model, gate))
14351435
.on_validate_channelmapping_output_map(make_node_implementation_map_validator()) // may be omitted if not required
14361436
.on_channelmapping_activated(make_node_implementation_channelmapping_activation_handler(gate))
1437-
.on_merge_rwnode_patch(make_node_implementation_rwnode_patch_merger(gate)); // may be omitted if not required
1437+
.on_merge_annotation_patch(make_node_implementation_annotation_patch_merger(gate)); // may be omitted if not required
14381438
}
Lines changed: 46 additions & 40 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@ namespace slog
88
class base_gate;
99
}
1010

11-
// Read/Write Node API implementation
11+
// Annotation API implementation
1212
// See https://specs.amwa.tv/is-13/branches/v1.0-dev/APIs/ReadWriteNodeAPI.html
1313
namespace nmos
1414
{
1515
struct model;
1616
struct resource;
1717

18-
// Read/Write Node API callbacks
18+
// Annotation API callbacks
1919

20-
// a rwnode_patch_merger validates the specified patch data for the specified IS-04 resource and updates the object to be merged
20+
// an annotation_patch_merger validates the specified patch data for the specified IS-04 resource and updates the object to be merged
2121
// or may throw std::runtime_error, which will be mapped to a 500 Internal Error status code with NMOS error "debug" information including the exception message
22-
// (the default patch merger, nmos::merge_rwnode_patch, implements the minimum requirements)
23-
typedef std::function<void(const nmos::resource& resource, web::json::value& value, const web::json::value& patch)> rwnode_patch_merger;
22+
// (the default patch merger, nmos::merge_annotation_patch, implements the minimum requirements)
23+
typedef std::function<void(const nmos::resource& resource, web::json::value& value, const web::json::value& patch)> annotation_patch_merger;
2424

25-
// Read/Write Node API factory functions
25+
// Annotation API factory functions
2626

2727
// callbacks from this function are called with the model locked, and may read but should not write directly to the model
28-
web::http::experimental::listener::api_router make_rwnode_api(nmos::model& model, rwnode_patch_merger merge_patch, slog::base_gate& gate);
28+
web::http::experimental::listener::api_router make_annotation_api(nmos::model& model, annotation_patch_merger merge_patch, slog::base_gate& gate);
2929

30-
// Helper functions for the Read/Write Node API callbacks
30+
// Helper functions for the Annotation API callbacks
3131

3232
namespace details
3333
{
34-
void merge_rwnode_patch(web::json::value& value, const web::json::value& patch);
34+
void merge_annotation_patch(web::json::value& value, const web::json::value& patch);
3535
}
3636

3737
// this function merges the patch into the value with few additional constraints
3838
// i.e. label, description and all tags are read/write except Group Hint and Asset Distinguishing Information
3939
// when reset using null, tags are removed, and label and description are set to the empty string
4040
// (this is the default patch merger)
41-
inline void merge_rwnode_patch(const nmos::resource& resource, web::json::value& value, const web::json::value& patch)
41+
inline void merge_annotation_patch(const nmos::resource& resource, web::json::value& value, const web::json::value& patch)
4242
{
43-
details::merge_rwnode_patch(value, patch);
43+
details::merge_annotation_patch(value, patch);
4444
}
4545
}
4646

Development/nmos/api_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ namespace nmos
5050
const route_pattern channelmapping_api = make_route_pattern(U("api"), U("channelmapping"));
5151
// IS-09 System API (originally specified in JT-NM TR-1001-1:2018 Annex A)
5252
const route_pattern system_api = make_route_pattern(U("api"), U("system"));
53-
// IS-13 Read/Write Node API
54-
const route_pattern rwnode_api = make_route_pattern(U("api"), U("rwnode"));
53+
// IS-13 Annotation API
54+
const route_pattern annotation_api = make_route_pattern(U("api"), U("annotation"));
5555

5656
// API version pattern
5757
const route_pattern version = make_route_pattern(U("version"), U("v[0-9]+\\.[0-9]+"));

Development/nmos/is13_schemas/is13_schemas.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ namespace nmos
99
{
1010
namespace v1_0_dev
1111
{
12+
extern const char* annotationapi_base;
13+
extern const char* annotationapi_node_base;
1214
extern const char* error;
1315
extern const char* resource_core;
1416
extern const char* resource_core_patch;
1517
extern const char* resource_cores;
16-
extern const char* rwnodeapi_base;
1718
}
1819
}
1920
}

Development/nmos/json_schema.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace nmos
142142
using namespace nmos::is13_schemas::v1_0_dev;
143143
const utility::string_t tag(_XPLATSTR("v1.0-dev"));
144144

145-
const web::uri rwnodeapi_resource_core_patch_request_uri = make_schema_uri(tag, _XPLATSTR("resource_core_patch.json"));
145+
const web::uri annotationapi_resource_core_patch_request_uri = make_schema_uri(tag, _XPLATSTR("resource_core_patch.json"));
146146
}
147147
}
148148
}
@@ -413,9 +413,9 @@ namespace nmos
413413
return is08_schemas::v1_0::map_activations_post_request_uri;
414414
}
415415

416-
web::uri make_rwnodeapi_resource_core_patch_request_schema_uri(const nmos::api_version& version)
416+
web::uri make_annotationapi_resource_core_patch_request_schema_uri(const nmos::api_version& version)
417417
{
418-
return is13_schemas::v1_0::rwnodeapi_resource_core_patch_request_uri;
418+
return is13_schemas::v1_0::annotationapi_resource_core_patch_request_uri;
419419
}
420420

421421
// load the json schema for the specified base URI

Development/nmos/json_schema.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace nmos
2929

3030
web::uri make_channelmappingapi_map_activations_post_request_schema_uri(const nmos::api_version& version);
3131

32-
web::uri make_rwnodeapi_resource_core_patch_request_schema_uri(const nmos::api_version& version);
32+
web::uri make_annotationapi_resource_core_patch_request_schema_uri(const nmos::api_version& version);
3333

3434
// load the json schema for the specified base URI
3535
web::json::value load_json_schema(const web::uri& id);

0 commit comments

Comments
 (0)