Subscribe Orion without receive old entities - fiware

There is some way to subscribe to Orion (e.g. Car entity), without receive the old entities?
Example:
Orion has -> Car A, Car B.
I do onchange subscription and Orion sends me at same time:
Car A notification and Car B notification.
We need the following:
Orion has -> Car A, Car B.
I do onchange subscription but don't receive nothing at this moment. If in a future Orion receives Car B, or changes some attribute of Car A or Car B, then send the notification.
Is that possible?

The behaviour is explained in the the user manual:
You may wonder why accumulator-server.py is getting this message if you don't actually do any update. This is because the Orion Context Broker considers the transition from "non existing subscription" to "subscribed" as a change.
We understand that for some uses cases this is not convenient. However, behaving in the opossite way ruins another uses cases which need to know the "inicial state" before starting getting notifications corresponding to actual changes. The best solution to make everybody happy is to make this configurable, so each client can chose what it prefers. This feature is currently in our roadmap (see this issue in github.com).
While this gets implemented in Orion, in your case maybe a possible workaround is just ignore the first received nofitication belonging to a subscription (you can identify the subscription to which one notification belongs by the subscriptionId field in the notification payload). All the following notifications beloning to that subscription will correspond to actual changes.
EDIT: the posibility of avoiding initial notification has been finally implemented at Orion. Details are at this section of the documentation. It is now in the master branch (so if you use fiware/orion:latest docker you will get it) and will be include in next Orion version (2.2.0).

Related

Can I send a notification in the creation and deletion of an entity?

I want to be notified when an entity is created or deleted.
Does Orion support subscribing to the creation and deletion of entities?
Yes it does, in Orion Context Broker - NGSIv2 - you have got the following alteration triggers:
entityUpdate: notification is sent whenever a entity covered by the subscription is updated (no matter if the entity actually changed or not)
entityChange: notification is sent whenever a entity covered by the subscription is updated and it actually changes (or if it is not an actual update, but forcedUpdate option is used in the update request)
entityCreate: notification is sent whenever a entity covered by the subscription is created
entityDelete: notification is sent whenever a entity covered by the subscription is deleted
Complete documentation:
https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md#subscriptions-based-in-alteration-type
Best.

In Ews push notification mode, I am getting unwanted unsaved Appointment. How to get rid of them?

I am using Exchange Web Services' push notification mode. I noticed that when I "New an appointment" in Exchange, if I click "attachment" button, it jumps to Attachement page, and push a "Item" notification into the SOAP servlet right away, without me "Save" the appointment. I guess this is probably how it works. But then I need to identify this "Item" as unfinished in my code, such that I can ignore it until I received another notification when the appointment is actually saved. So far, I've tried a number of properties such as isDraft, isDirty, getAppointmentState and etc to identify this "unsaved" appointment, but none of them worked.
So my questions are:
Can I config the exchange server such that it stops pushing notification for "unsaved" appointment?
Failing to do (1), how can I identify the "unsaved" appointment? Which property to check?
Thanks in advance,
Ling
Notifications are basically just telling you that an Item has been created on the server and based on way the UI action is taking place the client is creating an item to cater for the UI interaction so you will get a notification regardless. There is no such concept as a draft appointment and then next notification you get for that appointment should be an update. Multiple notification for an appointment is something that your code you should expect and deal with if you synchronization process is going to work reliably.
One thing you can try is to look at the item that is being created with a MAPI editor like OutlookSpy or MFCMapi as that will tell you if there is a specific extended property that you maybe able to use.

EWS create appointment without getting a streaming notification

I'm working on synchronization from our application to Exchange and back. I've set up a streamingnotification to the calendar of a room/resource defined in Exchange.
When I create an appointment in the calendar of the room I get a notification in my application, which is great. However, I also want to change this appointment from our application and send these changes to the calendar of the room in Exchange. That is no problem, but then I also receive a notification from Exchange. Basically Exchange is telling me that item 'x' has changed, when I'm the one who changed it, so I already know and don't want to process this change.
Is there a way to determine where the change originated from, or tell EWS to not send a streamingnotification when I edit an item?
Whenever you change an Item in EWS with UpdateItem the lasted ChangeKey is returned in the Response https://msdn.microsoft.com/en-us/library/office/dn605828(v=exchg.150).aspx . This property allows you to track when changes occur on the Item or to validate if no changes has occurred since the last modification.
The PidTagLastModifierEntryId property https://msdn.microsoft.com/en-us/library/gg672131(v=exchg.80).aspx will tell you who last modified an appointment.

Urban Airship Delete Device ID / Token

I'm trying to completely unregister a device token using the Urban Airship API (http://docs.urbanairship.com/api/), previously registered via an iOS device. I am doing this because I would like to verify the complete remote notification registration process.
There is a GET device_id endpoint:
GET /api/device_tokens/<device_token>
I was hoping there would be an endpoint like:
DELETE /api/device_token/<device_token>
DELETE /api/device_tokens (+send json data)
Maybe what I'm looking for can be achieved some other way? Or maybe this is an incorrect flow? I believe the old interface/API had this capability which is why I assumed it still existed.
Right now I'm relying on the "last_registration" value (from the GET endpoint) to inform me that the device has been registered, but I would like some way to completely remove the registered device/token via the API.
Doesn't work that way. Apple is the one the assigns and manages the lifecycle of device tokens. Urban Airship is a provider that handles the management/storage/utilization of said device tokens. Apple, however, is the one that manages the lifecycle of the device token based on the device and its actions. The best thing is to simply listen to the feedback to determine if that device token is still active or not. Apple's documentation on the matter is available here.
In regards to the old API; there was indeed a way to mark the device as inactive. However, as stated above, Apple manages the device tokens status. So, if the DT was indeed 'active' despite a delete/inactivate call was made on that DT, Apple would simply re-activate that DT, rendering that endpoint pointless.

Problems with addSiteAccount1

I'm following the Quick Start Guide, as I've just received my credentials. I went through the coblogin and user (consumer) creation successfully. For test purposes, I was able to search and list sites and infos.
When I try to invoke addSiteAccount1 using the user session token for the consumer that I create, I get an HTTP 200 response and no apparent error, no exceptions or messages. The JSON response is basically the same as the one listed in the API documentation page, however there's no ID I can use to list transactions. I'm using a real login/password account information on Chase (site ID 643).
By the way, if I use random strings for credentialFields[0].value (username) and credentialFields[1].value (password), I get the same JSON response.
Please help me clarify what is not working here.
addSiteAccount1 API will give you a response which should contain "siteAccountId" field this is the identifier for that particular user's Chase bank site.
This siteAccountId will have itemIDs which resembles different 'container'(in Yodlee terminology) like, all saving and checking accounts comes under bank container,while credit card comes under credit's container similarly loan and mortgages are other containers.
Now even under a specific container you might have multiple accounts for e.g., Chase Bank container you might have 1 saving's account and 1 checking account, for each there will be an itemAccountId available. This uniquely identifies that specific account and you can pass this itemAccountId (which you can get from getItemSummariesForSite API) in executeUserSearchRequest API to get the transactions belongs to this specific account.
For further help here is the link for the API flow which will give you an idea about how and when to use different APIs.
OK, I think I got it working, but maybe some documentation clarification is needed. Provided that all mandatory parameters in the addSiteAccount1 are present and contain no errors, the method call will be successful for a given consumer.
I then visited the getAllSiteAccounts method, which would show me all account aggregation for that user/consumer. I was able to see all accounts added, some had a message like "REFRESH_COMPLETE" and others would have "AUTH_FAILED". It seems that once one adds an account, the Yodlee robots will try to login and then synchronize the data for a given account. Makes sense?
I was only able to verify if the bank credentials were OK by calling another method.