Create a device in main application
Host: HOST address of ELSAG Server
Port: ESLAG connection port (default: 8080) will be provided by integrator
Username: Username with API access provided by integrator
Password: Password for username
ExtraValue: path to API on server (api/ElsagLiveAlarms/) may not need depending on ELSAG server configuration.
<add key="ApiRetrievalSleepPeriod" value="6000" /> <add key="APiRetrievalLimit" value="100" /> <add key="UseElsagPagingSystem" value="true" /> <add key="ElsagApiCallTimeOutInSecs" value="60000" /> <add key="UseHttps" value="true" /> <add key="PathToAlarmQueuedFileStorage" value="" /> <!-- Stores in designated folder under file backup.json--> <add key="UseBISForCreatingAlarms" value="false" /> <add key="BIS_IPAddress" value="" /> <add key="LogReturnedData" value="false" />
- ApiRetrievalSleepPeriod - period in which the end point is called.
- APiRetrievalLimit - how many alarms should be returned in one go.
- UseElsagPagingSystem - Whether the live alarms from Elsag are retrieved using a their paging system of not. See their docs for this (should be in the repo).
- ElsagApiCallTimeOutInSecs - timeout before the api call is aborted
- UseHttps - if the endpoint uses http then set this to false
- PathToAlarmQueuedFileStorage - this is the file path to where the backup alarm queue will be created as a json file called Backup.json.
-UseBISForCreatingAlarms - if the BIS is to be used for creating the alarms then set this to true. If this is the case then the IP address MUST be filled in within the BIS_IPAddress
-BIS_IPAddress - full address of the BIS - e.g https://localhost:5001
-LogReturnedData - turns on logging to see what data is being called for and what is returned - all before its gets changed into a model.
The service backs up the queue of alarms that, during runtime, are held as a cache queue in memory. The queue is populated from the results of each API call to the ELSAG endpoint. The queue is sequentially worked through and each alarm is made into an event/alarm on the system.
The service allow alarms to be retrieved either via ELSAGs paging method or via a timed pull. If the paging system is used then on the initial request, the response will indicate the next page to obtain from the ELSAG epi. This is then called and further alarms obtained. When the paging method returns null/no alarms then it is complete. The system should then sleep for the designated sleep period before retrying.
Where the timed approach is used, then a call is made to the endpoint requesting the last n seconds of alarms. n being the number of second deemed required. The next call will calculate how long since the last call was made and returned data, then this amount of time is used to get the next set of alarms.
The system will iterate through the alarms stored and create events/alarms as already mentioned. Once an event has been made then a new request is made to the ELSAG endpoint to request the accompanying image. This request for an image will be attempted 10 times. After this the image will be abandoned. Once an image is received it will be stored in the file store as eventId.Datetime.jpg, under the groupid, eventid, event recordId.