Skip to content

Commit

Permalink
Merge pull request #2382 from telefonicaid/fix/get_service_subservice…
Browse files Browse the repository at this point in the history
…_from_event

get service and subservice from event using enableNamemapping flag
  • Loading branch information
fgalan authored Jun 11, 2024
2 parents 5907e65 + 34d9be8 commit 7d1c652
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- [cygnus-arcgis] Get service and subservice using enableNameMappings flag config
- [cygnus-arcgis] Insert null attribute as is in feature table (#2376)
- [cygnus-arcgis] force null geometry when invalid geo:json format or type is found instead of Point(0,0) (#2379)
Original file line number Diff line number Diff line change
Expand Up @@ -482,21 +482,9 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError {

LOGGER.debug("[NGSIArcgisAggregator] aggregate - Selected context ->" + contextElement);

// get the getRecvTimeTs headers
Map<String, String> headers = event.getHeaders();

for (Entry<String, String> entry : headers.entrySet()) {
LOGGER.debug("Header entry key --> " + entry.getKey().toString() + ", value --> "
+ entry.getValue().toString());
if (entry.getKey() != null
&& NGSIConstants.FLUME_HEADER_MAPPED_SERVICE.equals(entry.getKey().toString())) {
service = entry.getValue().toString();
} else if (entry.getKey() != null
&& NGSIConstants.FLUME_HEADER_MAPPED_SERVICE_PATH.equals(entry.getKey().toString())) {
subService = entry.getValue().toString();
}
} // for

service = event.getServiceForNaming(enableNameMappings);
subService = event.getServicePathForNaming(enableNameMappings);

// Compose full url
featureTableUrl = argisServiceUrl + "/" + service + "/" + subService;
featureTableUrl = featureTableUrl.replaceAll("([^:])\\/\\/", "$1/");
Expand Down

0 comments on commit 7d1c652

Please sign in to comment.