Skip to content

Commit

Permalink
Merge branch 'master' into task/jdk_17
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega authored Feb 7, 2024
2 parents 0309d30 + 3c8d596 commit 386d643
Show file tree
Hide file tree
Showing 3 changed files with 17 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-common][cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0
- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.1 to 1.17 in Dockerfile (#2297,#2304)
- [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339)
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ private void addProperty(JsonObject jsonObj, String name, Object property) {
jsonObj.addProperty(name, (Boolean) property);
break;
case DATE_CLASSNAME:
simpleDateFormat = new SimpleDateFormat(DATE_PATTERN);
jsonObj.addProperty(name, simpleDateFormat.format((Date) property));
// All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate)
Date date = (Date) property;
jsonObj.addProperty(name, date.getTime());
break;
case GREGORIAN_CALENDAR_CLASSNAME:
simpleDateFormat = new SimpleDateFormat(DATE_PATTERN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Let's see both configuration options:

###### Entity data in CB:

service = vehicles
service-path = /4wheels
entity-type = Car
service = vehicles
service-path = /4wheels
entity-type = Car

If the Feature table for type "Car" is `https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars`, the subscription with custom notif would be:

Expand Down Expand Up @@ -115,22 +115,22 @@ Note that to avoid using the name mappings to modify the unique field value of `

###### result

Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars
Table's unique field: licensePlate
Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars
Table's unique field: licensePlate

[Top](#top)

##### Using Cygnus name mappings

###### Agent.conf file:

agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services
agent.arcgis-sink.enable_name_mappings = true
agent.arcgis-sink.arcgis_service_url = https://arcgis.com/{hash}/arcgis/rest/services
agent.arcgis-sink.enable_name_mappings = true
###### Entity data:

service = vehicles
service-path = /4wheels
entity-type = Car
service = vehicles
service-path = /4wheels
entity-type = Car

The name mappings configuration would be:

Expand All @@ -156,8 +156,8 @@ The name mappings configuration would be:

###### result

Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars
Table's unique field: licensePlate
Feature table url: https://arcgis.com/{hash}/arcgis/rest/services/vehicles/cars
Table's unique field: licensePlate

[Top](#top)

Expand Down Expand Up @@ -297,7 +297,7 @@ Note that `speed` attribute is not required in the name mappings file as it matc
From https://doc.arcgis.com/en/data-pipelines/latest/process/output-feature-layer.htm
> ... Date fields are stored in feature layers using the format milliseconds from epoch and the coordinated universal time (UTC) time zone. The values will be displayed differently depending on where you are viewing the data. For example, querying the feature service REST end point will return values in milliseconds from epoch, such as 1667411518878....
So, to persist a `esriFieldTypeDate` field in the Feature Layer, cygnus has to receive an attribute "Number" from the CB with the milliseconds from epoch.
So, all NGSI DateTime are persisted like a `esriFieldTypeDate` field in the Feature Layer, because arcgis sink transform NGSI DateTime into the milliseconds from epoch.

## <a name="section3"></a>Programmers guide
### <a name="section3.1"></a>`NGSIArcgisFeatureTableSink` class
Expand Down

0 comments on commit 386d643

Please sign in to comment.