-
Notifications
You must be signed in to change notification settings - Fork 1
16 provide mapping UI for c8y hub events outbound #32
16 provide mapping UI for c8y hub events outbound #32
Conversation
…nted new task which checks for events matching the mapping and converting to ADAMOS events.
Currently testing on pmt-training tenant. Conversion is working fine. Still todo is testing if flattening of attributes works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
@Value("${C8Y.tenant}") | ||
private String tenant; | ||
|
||
public EventRulesService() {} | ||
|
||
private Map<String, Date> lastUpdateDatesCache = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use Instant instead of Date
https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html
@Scheduled(fixedRate = 60000) | ||
public void consumeC8YEvent() { | ||
public void startListenersForEventMappings() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this renaming is appropriate anymore as we decided to not start listeners.
default: | ||
return ""; | ||
|
||
public void listenForMapping(EventMapping mapping, List<ManagedObjectRepresentation> selectedDevices) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above, we are not listening.
mappings: IEventMapping[] = [ | ||
{ | ||
c8yEventType: "c8y_Position", | ||
c8yFragments: ["foo", "bar"], | ||
c8yDevices: ["2318011", "2318012", "44297003"], | ||
enabled: false, | ||
name: "Test", | ||
id: "d982b35d-b932-432c-8cda-a604daac9137", | ||
adamosEventType: "adamos:runstate:event:resource:stackLight:*:update:1", | ||
}, | ||
{ | ||
c8yEventType: "c8y_Whatever", | ||
c8yFragments: ["hans", "wurst"], | ||
c8yDevices: ["2318011", "2318012", "44297003"], | ||
enabled: false, | ||
name: "Test2", | ||
id: "d982b35d-b932-432c-8cda-a604daac9138", | ||
adamosEventType: "adamos:runstate:event:resource:stackLight:*:update:2", | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why hardcoded values here?
No description provided.