Compare commits

...

176 Commits

Author SHA1 Message Date
Lynn Shi
95a07188d5 WIFI-4732 Default 5G backup channel is not applicable to all countries 2021-10-06 15:21:43 -04:00
norm-traxler
6839ff3e97 Merge pull request #159 from Telecominfraproject/WIFI-4422
[WIFI-4422] Performance improvements for gateway
2021-09-27 15:26:13 -04:00
norm-traxler
299f59767e Merge pull request #158 from Telecominfraproject/WIFI-4415
[WIFI-4415] remove unnecessary code
2021-09-27 15:23:43 -04:00
Thomas-Leung2021
936aeae135 [NETEXP-2957] fix failed test 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
5b3d05bc21 [NETEXP-2957] remove numRxData attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
ee3c62559a [NETEXP-2957] remove rxLastRssi attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
d3bb9f6e51 [NETEXP-2957] remove classificationName and channelBandwidth attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
a1ebf265f9 [NETEXP-2957] remove secondsSinceLastRecv attributes 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
64b1432251 [NETEXP-2957] remove rates attribute 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
ccb7680933 [WIFI-4415] remove unnecessary code 2021-09-27 13:33:48 -04:00
norm-traxler
e74570121c Merge pull request #157 from Telecominfraproject/WIFI-4415
[Wifi 4415] Add Gateway and backend support to turn LED on/off
2021-09-27 11:06:09 -04:00
Thomas Leung
b4b697376c Merged in NETEXP-2959 (pull request #10)
NETEXP-2959 Undo blinkLEDs api

Approved-by: mike.hansen
2021-09-24 17:37:14 -04:00
Thomas-Leung2021
b57fb2dd4f Merge branch 'NETEXP-2959' of bitbucket.org:connectustechnologies/wlan-cloud-services into NETEXP-2959 2021-09-24 17:35:42 -04:00
Thomas-Leung2021
d25c1d6167 [WIFI-4415] Undo blinkLEDs api 2021-09-24 17:34:52 -04:00
Thomas-Leung2021
57c2d7d6f4 [NETEXP-2959] update Equipment Profile when blinkAllLEDs changed 2021-09-24 17:21:08 -04:00
norm-traxler
faf0a3a385 Merge pull request #155 from Telecominfraproject/WIFI-4339
WIFI-4339 Moving the AP from one location to another with different C…
2021-09-24 14:59:49 -04:00
norm-traxler
a7a836440e Merge pull request #156 from Telecominfraproject/WIFI-4340
WIFI-4340 Configure Auto Channel Exclusions in RF Profile
2021-09-24 14:59:34 -04:00
Lynn Shi
999e597493 WIFI-4340 Configure Auto Channel Exclusions in RF Profile 2021-09-23 17:19:53 -04:00
Lynn Shi
5f4ed530fe WIFI-4339 Moving the AP from one location to another with different Country code does not trigger reg domain changes on AP 2021-09-23 16:09:08 -04:00
Mike Hansen
0dca8bb943 Merge pull request #154 from Telecominfraproject/WIFI-4152-bugfix-alarm-forCustomer
[WIFI-4152] Removing null entries from alarm Cassandra forCustomer
2021-09-15 13:55:21 -04:00
ralphlee
c8c7217d38 [WIFI-4152] Removing null entries from alarm Cassandra forCustomer 2021-09-15 13:48:47 -04:00
Mike Hansen
b41e35a536 Merge pull request #151 from Telecominfraproject/WIFI-3404
[WIFI-3404] Clean up unused schema definition in yaml files
2021-08-11 08:33:02 -04:00
Mike Hansen
64bd468ade Merge pull request #149 from Telecominfraproject/WIFI-3358
[WIFI-3358] remove more unused attributes in ClientMetrics
2021-08-11 08:32:01 -04:00
Mike Hansen
fe488e9d5f Merge pull request #148 from Telecominfraproject/WIFI-3403
[WIFI-3403] remove unused attributes in RadioStatistics
2021-08-11 08:31:01 -04:00
norm-traxler
a79778b083 Merge pull request #150 from Telecominfraproject/WIFI-3397
Fix to not remove the active sessions.
2021-08-10 22:18:54 -04:00
Thomas-Leung2021
d5b86d0c8d [WIFI-3404] Clean up unused schema definitions for RadioStatistics 2021-08-10 18:43:02 -04:00
Rahul Sharma
15698e99cb Fix to not remove the active sessions.
Also added some more logging
2021-08-10 18:29:47 -04:00
Thomas-Leung2021
e06c28e85a [WIFI-3404] Clean up unused schema definition in yaml files 2021-08-10 18:08:13 -04:00
Thomas-Leung2021
c307f59e8a [WIFI-3358] remove more unused attributes in ClientMetrics 2021-08-10 17:35:38 -04:00
Thomas-Leung2021
1e23a691d7 [WIFI-3403] remove unused attributes in RadioStatistics 2021-08-10 14:11:32 -04:00
Mike Hansen
015e662e68 Merge pull request #147 from Telecominfraproject/revert-146-revert-144-WIFI-3358
Revert "Revert "[WIFI 3358] Client Metrics report performance improvements""
2021-08-09 19:26:14 -04:00
Mike Hansen
9f3af6773b Revert "Revert "[WIFI 3358] Client Metrics report performance improvements"" 2021-08-09 19:26:00 -04:00
Mike Hansen
b7eedf6b8c Merge pull request #146 from Telecominfraproject/revert-144-WIFI-3358
Revert "[WIFI 3358] Client Metrics report performance improvements"
2021-08-09 19:14:01 -04:00
Mike Hansen
468e7bcddb Revert "[WIFI 3358] Client Metrics report performance improvements" 2021-08-09 19:13:50 -04:00
Mike Hansen
9b712d6fb5 Merge pull request #145 from Telecominfraproject/WIFI-3397
Adding more logging to find the cause of Remote-SSH sessions drop
2021-08-09 18:52:01 -04:00
Mike Hansen
99475d3f2f Merge pull request #144 from Telecominfraproject/WIFI-3358
[WIFI 3358] Client Metrics report performance improvements
2021-08-09 18:49:46 -04:00
Rahul Sharma
7216b08ac7 Adding more logging to find the cause of Remote-SSH sessions drop 2021-08-09 18:35:33 -04:00
Thomas-Leung2021
34da98b9a8 [WIFI-3358] remove unused methods in ClientRadioUtils.java 2021-08-09 17:20:21 -04:00
Thomas-Leung2021
65aeadeaa7 [WIFI-3358] remove WmmQueueStats.java 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
148a6762dc [WIFI-3358] remove McsType.java 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
178378f8b6 [WIFI-3358] remove McsStats.java 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
d0e6866345 [WIFI-3358] remove unused attributes in McsStats 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
a2b3e711ea [WIFI-3358] remove ClientQoEMetrics.java 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
b5f5c6d19f [WIFI-3358] remove unused attributes for SsidStatistics 2021-08-09 17:06:15 -04:00
Thomas-Leung2021
a5079d04a7 [WIFI-3358] remove unused attributes in ClientMetrics 2021-08-09 17:06:15 -04:00
Mike Hansen
35d89a1cf0 Merge pull request #143 from Telecominfraproject/WIFI-3358-id
[WIFI-3358] remove sessionId in ClientMetrics
2021-08-09 15:56:07 -04:00
Thomas-Leung2021
534ed3e9c0 [WIFI-3358] remove sessionId in ClientMetrics 2021-08-09 14:42:14 -04:00
Mike Hansen
a6ec1d6e7f Merge pull request #142 from Telecominfraproject/WIFI-3344
[WIFI-3344] remove ClientSessionMetricDetails
2021-08-04 19:35:16 -04:00
Thomas-Leung2021
a19fc425c2 [WIFI-3344] remove ClientSessionMetricDetails 2021-08-04 16:57:40 -04:00
Mike Hansen
fc8cab6a50 Merge pull request #141 from Telecominfraproject/NETEXP-2677
[NETEXP-2677] set clients disconnected in current client list when moving AP to another SP
2021-08-04 10:27:58 -04:00
Thomas-Leung2021
daabf38510 [NETEXP-2677] set clients disconnected in current client list when moving AP to another SP 2021-08-03 18:05:31 -04:00
Mike Hansen
78c4d3a862 Merge pull request #140 from Telecominfraproject/WIFI-3285
WIFI-3285 Use base channel as default value on 5G for backupChannelNu…
2021-08-03 18:04:42 -04:00
Lynn Shi
3f3e40d2dd WIFI-3285 Use base channel as default value on 5G for backupChannelNumber and manualBackupChannelNumber in Equipment Config 2021-08-03 14:08:29 -04:00
Mike Hansen
91877f5305 Merge pull request #139 from Telecominfraproject/WIFI-3259-portal-user-event-payload-fix
[WIFI-3259] Adding default constructor to PortalUserEventPayload for …
2021-07-29 10:10:39 -04:00
ralphlee
11314e3395 [WIFI-3259] Adding default constructor to PortalUserEventPayload for serialization, updated yamls 2021-07-28 12:58:46 -04:00
Mike Hansen
fa6795369c Merge pull request #138 from Telecominfraproject/NETEXP-1632-temp
fix missing RADIO_CHANNEL status
2021-07-27 08:41:07 -04:00
Thomas-Leung2021
e6e06d7b70 fix missing RADIO_CHANNEL status 2021-07-26 17:29:49 -04:00
Mike Hansen
1e15e3cd94 Merge pull request #137 from Telecominfraproject/WIFI-3218-add-null-checks-to-rrm-bulk-update
[WIFI-3218] Adding null checks to RrmBulkUpdateItem
2021-07-22 17:25:38 -04:00
ralphlee
02e03780db [WIFI-3218] Adding null checks to RrmBulkUpdateItem 2021-07-22 17:19:03 -04:00
Mike Hansen
aac34150b2 APs running into Backoff shows as connected
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-22 15:31:58 -04:00
Mike Hansen
3085c34cde Merge pull request #135 from Telecominfraproject/WIFI-3180-portal-user-search-case-insensitive
[WIFI-3180] Adding case insensitivity to Portal User API Search
2021-07-20 11:53:47 -04:00
Mike Hansen
35fd038113 [WIFI-3166] Session ID is a -ve number in opensyncgw logs and on UI logs
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-20 11:31:07 -04:00
ralphlee
7c387f1940 [WIFI-3180] Adding case insensitivity to Portal User API Search 2021-07-20 10:38:04 -04:00
Mike Hansen
abb9b59659 Gateway pushes the threshholds as empty which causes AP not to connect any client
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-20 10:02:59 -04:00
norm-traxler
7f0497754c Merge pull request #134 from Telecominfraproject/WIFI-3042-alarm-remote-fix
[WIFI-3042] Fix alarmCode get url parameter
2021-07-20 08:30:40 -04:00
Norm Traxler
82095510f7 [WIFI-3042] Fix alarmCode get url parameter 2021-07-20 08:23:58 -04:00
Mike Hansen
0afd414870 Merge pull request #133 from Telecominfraproject/change_sessionId_to_String
[WIFI-3166] Session ID is a -ve number in opensyncgw logs and on UI logs
2021-07-19 19:30:42 -04:00
Mike Hansen
772beab902 [WIFI-3166] Session ID is a -ve number in opensyncgw logs and on UI logs
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-19 19:10:37 -04:00
Mike Hansen
4a764db007 [WIFI-3166] Session ID is a -ve number in opensyncgw logs and on UI logs
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-19 18:03:13 -04:00
Mike Hansen
41add1922b Merge pull request #132 from Telecominfraproject/WIFI-3041
[WIFI-3041] move if statusment for custmerId check to a different location
2021-07-19 17:54:58 -04:00
Thomas-Leung2021
90ac57b988 [WIFI-3041] move if statement to make it more logical 2021-07-19 17:52:49 -04:00
Thomas-Leung2021
0cc90764c6 [WIFI-3041] move if statusment for custmerId check to a different location 2021-07-19 17:00:54 -04:00
Mike Hansen
1e277f5650 [WIFI-3165] Keep last stats received timestamp in gateway client session map
Adding API call to gateway controller

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-19 14:13:19 -04:00
Mike Hansen
716ba7e043 Merge pull request #131 from Telecominfraproject/WIFI-3041
[Wifi 3041] A disconnected Alarm is raised when a disconnected AP is moved out of a Customer Inventory.
2021-07-16 16:28:16 -04:00
Thomas-Leung2021
3d2f4db32a [WIFI-3041] remove unnecessary dependencies 2021-07-16 12:22:23 -04:00
Thomas-Leung2021
c75d44ff03 [WIFI-3041] create a new EquipmentCustomerChangedEvent to handle status and alarm migration 2021-07-16 10:44:23 -04:00
Mike Hansen
f9dbe12c8c Merge pull request #130 from Telecominfraproject/WIFI-3056-event-stats
[WIFI-3056] Add API to get system event statistics
2021-07-16 07:44:06 -04:00
Norm Traxler
910a2cbe0c [WIFI-3056] Add API to get system event statistics 2021-07-15 22:15:01 -04:00
Thomas-Leung2021
799b243cc4 [WIFI-3041] move alarms to new customerId if customerId changed 2021-07-15 16:45:07 -04:00
Mike Hansen
8834c33d90 Merge pull request #129 from Telecominfraproject/WIFI-3042-alarms-by-alarmcode
[WIFI-3042] Add Alarm endpoint for get alarms by AlarmCode
2021-07-15 09:26:20 -04:00
Norm Traxler
e9c54a892b [WIFI-3042] Add Alarm endpoint for get alarms by AlarmCode 2021-07-14 20:18:22 -04:00
Mike Hansen
8353dd375f Control LED off via Equipment AP profile
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-14 18:45:33 -04:00
Mike Hansen
46de84b28b Add NULL check in EquipmentController
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-14 18:00:10 -04:00
Mike Hansen
9edca1fd9d CloudBackend:
Control LED off via Equipment AP profile

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-14 17:30:06 -04:00
Mike Hansen
5714c9bf32 CloudBackend:
Control LED off via Equipment AP profile and Show LED status in EQUIPMENT_ADMIN status

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-07-14 16:03:39 -04:00
Mike Hansen
2b2e34a064 Merge pull request #128 from Telecominfraproject/WIFI-2987
[WIFI-2987] add protocol status when switching customer
2021-07-13 14:09:02 -04:00
Thomas-Leung2021
d7a75faf4c check when status is null 2021-07-13 12:10:04 -04:00
Thomas-Leung2021
5fd977f064 [WIFI-2987] add protocol status when switching customer 2021-07-12 14:47:36 -04:00
Mike Hansen
bafec1fdd8 Merge pull request #127 from Telecominfraproject/hotfix/wifi-2970
[WIFI-2970] add equipment admin status when switching customer
2021-07-09 10:52:49 -04:00
Thomas-Leung2021
6b046e0a7a [WIFI-2970] remove unnecessary comments 2021-07-09 10:48:40 -04:00
Thomas-Leung2021
fb6604cdf5 add required dependencies in tests for new changes in EquipmentController 2021-07-08 17:48:20 -04:00
Thomas-Leung2021
2c1c60344e add equipment admin status when switching customer 2021-07-08 17:47:26 -04:00
Mike Hansen
9e959e258f Merge pull request #126 from Telecominfraproject/WIFI-2932-Client-ip-event
[WIFI-2932] Change IP event ipAddress from byte[] to InetAddress
2021-07-06 10:21:04 -04:00
Norm Traxler
2410233046 [WIFI-2932] Change IP event ipAddress from byte[] to InetAddress 2021-07-05 17:58:01 -04:00
norm-traxler
a7f91a29f8 Merge pull request #125 from Telecominfraproject/updateAPI
Update APIs to reflect new map in EquipmentChannelStatusData
2021-06-28 16:23:39 -04:00
Thomas-Leung2021
80cd0abd58 Update APIs to reflect new map in EquipmentChannelStatusData 2021-06-28 11:50:49 -04:00
Mike Hansen
4555ff339b Merge pull request #124 from Telecominfraproject/feature/netexp-2237
add tx_power status
2021-06-25 13:07:27 -04:00
Thomas-Leung2021
04a13877d1 add tx_power status 2021-06-25 12:39:30 -04:00
Mike Hansen
e148bab291 Merge pull request #123 from Telecominfraproject/WIFI-2699-modify-GET-/portal/profile/equipmentCounts-to-support-child-profiles-for-the-count
WIFI-2699  Modify GET /portal/profile/equipmentCounts to support child profiles for the count
2021-06-24 10:09:38 -04:00
Thomas Currie
9ad3cec4af rework top level profile tracking, so as to not include any profiles that were not in the Set argument 2021-06-23 11:30:06 -04:00
Thomas Currie
dc0b838f83 complete the test case cleanup 2021-06-23 11:11:54 -04:00
Thomas Currie
7cac7fff3f rework the algorithm at endpoint /portal/profile/equipmentCounts to include the correct child profile count for equipment 2021-06-23 10:58:02 -04:00
Mike Hansen
b48340b709 Merge pull request #122 from Telecominfraproject/disable_eq_alarms_sp
disable equipment-alarms-sp functionality, part of task to move the r…
2021-06-22 16:03:36 -04:00
Mike Hansen
44b3836758 disable equipment-alarms-sp functionality, part of task to move the raising and clearing of the threshold alarms into the gateway controller when the device information is received
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-22 15:43:09 -04:00
Mike Hansen
4f0b032549 Merge branch 'disable_eq_alarms_sp' of github.com:Telecominfraproject/wlan-cloud-services into disable_eq_alarms_sp 2021-06-22 15:40:54 -04:00
Mike Hansen
5ba0c4c242 Merge pull request #121 from Telecominfraproject/WIFI-2698-Update-visibility-of-fields-in-PortalUserDAO
WIFI-2698-Update-visibility-of-fields-in-PortalUserDAO
2021-06-22 10:42:01 -04:00
Mike Hansen
304e80332a disable equipment-alarms-sp functionality, part of task to move the raising and clearing of the threshold alarms into the gateway controller when the device information is received
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-22 10:19:41 -04:00
Thomas Currie
9fd3e73398 increase visibility of some fields in PortalUserDAO to allow classes to extend upon without duplication of values 2021-06-21 19:59:45 -04:00
Mike Hansen
b9db744aee Merge pull request #120 from Telecominfraproject/updateAPI
[WIFI-2646] update API to support WPA3-EAP-192
2021-06-17 13:43:53 -04:00
norm-traxler
1eee65d284 Merge pull request #119 from Telecominfraproject/WIFI-2670_2
[WIFI-2670] Add more counters to the ClientSessionCounts
2021-06-17 13:11:18 -04:00
Norm Traxler
75c943211a [WIFI-2670] Add more counters to the ClientSessionCounts 2021-06-17 12:14:38 -04:00
Thomas-Leung2021
d0a0ed59fe update API to support WPA3-EAP-192 2021-06-17 12:14:12 -04:00
norm-traxler
a200fcc12e Merge pull request #118 from Telecominfraproject/WIFI-2664
WIFI-2664 added private macs to return map
2021-06-17 12:12:39 -04:00
Kareem Dabbour
1f6996abb2 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services into WIFI-2664 2021-06-17 11:46:20 -04:00
Kareem Dabbour
1ebaa4a539 WIFI-2664 added private macs to return map 2021-06-17 11:44:02 -04:00
norm-traxler
f1e1bdffd7 Merge pull request #117 from Telecominfraproject/WIFI-2664
WIFI-2664 added private mac address filtering to /oui/list endpoint
2021-06-16 13:36:26 -04:00
Kareem Dabbour
37f5872552 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services into WIFI-2664 2021-06-16 12:59:23 -04:00
Kareem Dabbour
367b9ec428 WIFI-2664 adjusting unit tests to reflect added oui of ffffff 2021-06-16 12:55:57 -04:00
Kareem Dabbour
87ca619ad5 WIFI-2664 added private mac address filtering to /oui/list endpoint 2021-06-16 12:28:01 -04:00
norm-traxler
622f78f681 Merge pull request #116 from Telecominfraproject/WIFI-2664
WIFI-2664 Non-global mac addresses will now return an Uknown (private address) rather than null
2021-06-15 16:44:59 -04:00
Kareem Dabbour
faeb65d8d6 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services into WIFI-2664 2021-06-15 16:43:14 -04:00
Kareem Dabbour
34841a3a04 WIFI-2664 moving logic from in memory and DAO to controller 2021-06-15 16:37:30 -04:00
Kareem Dabbour
4fc8bc4018 WIFI-2664 renamed group to global address and did some refractoring 2021-06-15 15:26:51 -04:00
Kareem Dabbour
cce36019fe WIFI-2664 Non-global mac addresses will now return an Uknown (private address) rather than null 2021-06-15 14:46:14 -04:00
norm-traxler
4596280090 Merge pull request #115 from Telecominfraproject/WIFI-2670
[WIFI-2670] Client Session API support OUI attribute and count query
2021-06-15 14:44:44 -04:00
Norm Traxler
caaa8fb4e3 [WIFI-2670] Client Session API support OUI attribute and count query 2021-06-15 14:15:52 -04:00
Mike Hansen
b957c8bf72 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services 2021-06-14 11:55:58 -04:00
Mike Hansen
b797cc392f WIFI-2639: CloudBackend: upgrade CEGWBlinkRequest definition
Adding API call to portal, /portal/equipmentGateway/requestApBlinkLEDs

Adding RequestMapping to EquipmentPortalGatewayController

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-14 11:53:54 -04:00
norm-traxler
5fc9715649 Merge pull request #114 from Telecominfraproject/WIFI-2601-Add-check-for-valid-equipment-ID-when-creating-new-alarms-via-the-alarm-prov-controller
add check for validity of equipment ID when creating new alarms
2021-06-14 11:07:28 -04:00
Mike Hansen
0a66897e48 WIFI-2639: CloudBackend: upgrade CEGWBlinkRequest definition
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-11 15:58:30 -04:00
Mike Hansen
8d77fcb090 WIFI-2607: CloudBackend: add dynamicDiscovery attribute to RadiusProxyConfiguration
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-09 15:10:02 -04:00
Thomas Currie
256d9fbd16 throw better exception when equipment ID does not exist. 2021-06-09 09:20:30 -04:00
Thomas Currie
39e14da2e6 add check for validity of equipment ID when creating new alarms 2021-06-09 08:55:16 -04:00
Mike Hansen
996c60adf6 Merge pull request #113 from Telecominfraproject/alarmImprovement1516
Changed AccessPointIsUnreachable to NoMetricsReceived Alarm
2021-06-08 21:29:50 -04:00
Thomas-Leung2021
879abe3beb Changed AccessPointIsUnreachable to NoMetricsReceived Alarm 2021-06-08 17:51:12 -04:00
norm-traxler
796d657952 Merge pull request #112 from Telecominfraproject/WIFI-2543
WIFI-2543 Added delete methods and API endpoints for bulk deletion of client and client sessions
2021-06-08 11:45:10 -04:00
Kareem Dabbour
52ed5f6344 WIFI-2543 Added delete methods and API endpoints for bulk deletion of client and client sessions 2021-06-07 21:42:15 -04:00
Mike Hansen
f5869961b2 WIFI-2081: AP: ON_CHANNEL survey report sometimes has no information
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-07 15:47:30 -04:00
Mike Hansen
f02cadbdc3 WIFI-2081: AP: ON_CHANNEL survey report sometimes has no information
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-07 15:27:40 -04:00
Mike Hansen
c45cabf607 WIFI-2081: AP: ON_CHANNEL survey report sometimes has no information
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-07 15:25:55 -04:00
norm-traxler
c9faf138da Merge pull request #111 from Telecominfraproject/WIFI-2525
WIFI-2525 Set default value for MaxAutoCellSize in RF Config
2021-06-03 18:05:57 -04:00
Lynn Shi
f6b96fc566 WIFI-2525 Set default value for MaxAutoCellSize in RF Config 2021-06-02 14:03:15 -04:00
Mike Hansen
a089e7b748 AP: ON_CHANNEL survey report sometimes has no information
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-06-02 09:07:37 -04:00
norm-traxler
e790db2c2b Merge pull request #110 from Telecominfraproject/WIFI-2508
WIFI-2508 added delete endpoint for systemevents that are older than a given timestamp
2021-05-31 17:43:18 -04:00
Kareem Dabbour
b03dccc63f WIFI-2508 added delete endpoint for systemevents that are older than a given time stamp 2021-05-31 17:23:12 -04:00
norm-traxler
03eccfa448 Merge pull request #109 from Telecominfraproject/WIFI-2434
WIFI 2434: Update SDK master to use image tag 1.2.0-SNAPSHOT
2021-05-26 21:27:38 -04:00
Akshay Jagadish
18eeaffa13 Update SDK master to use image tag 1.2.0-SNAPSHOT 2021-05-26 17:59:41 -04:00
Mike Hansen
40aaeb33f4 WIFI-2425: RADSEC: Cloud doesn't send the radius secret as set in the radiusProxyConfigurations
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-25 14:19:40 -04:00
Mike Hansen
fb4ff772e4 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services 2021-05-20 17:00:44 -04:00
Mike Hansen
d9076562d4 WIFI-2030: SDK Gateway/BE: Proxy-ARP service
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-20 17:00:19 -04:00
norm-traxler
5ee517df81 Merge pull request #108 from Telecominfraproject/WIFI-2411-portal-user-event-payload
[NETEXP-2411] Adding new simplified PortalUser model for events
2021-05-20 16:35:13 -04:00
ralphlee
492406b56f [WIFI-2411] Updating yaml 2021-05-20 16:21:37 -04:00
ralphlee
c5648961c4 [NETEXP-2411] Adding new simplified PortalUser model for events 2021-05-20 13:25:52 -04:00
norm-traxler
c2540266d6 Merge pull request #107 from Telecominfraproject/WIFI-2398
WIFI-2398 Adding ClientMac to client session system events
2021-05-19 19:11:27 -04:00
Kareem Dabbour
35047c4fe7 WIFI-2398 Adding ClientMac to client session system events 2021-05-19 18:39:52 -04:00
Mike Hansen
deae54b4e9 WIFI-2397: Add ApcElectionEvent values to EquipmentProtocolStatusData
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-19 17:30:45 -04:00
Mike Hansen
e957cf5a3b WIFI-2120: AP: Support 8x8 MIMO and Max Tx Power
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-19 15:23:59 -04:00
Mike Hansen
09a9002962 Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services 2021-05-19 13:10:06 -04:00
Mike Hansen
48040b3cba WIFI-2395: CloudBackend: Universal (Auto) Radio Mode For Configuration
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-19 13:09:32 -04:00
Mike Hansen
a29b6636b8 Merge pull request #106 from Telecominfraproject/WIFI-2380
[WIFI-2380] Fix Event created timestamps for GW and Debug events.
2021-05-18 10:21:22 -04:00
Norm Traxler
9d558695ae [WIFI-2380] Fix Event created timestamps for GW and Debug events. 2021-05-17 15:29:08 -04:00
norm-traxler
81e100b210 Merge pull request #105 from Telecominfraproject/WIFI-2373-Add-getOrNull-API-to-location-service
Wifi 2373 add get or null api to location service
2021-05-13 12:08:46 -04:00
Thomas Currie
5fddfcbdc9 add unit test for new getOrNull api. 2021-05-13 11:50:49 -04:00
Thomas Currie
d86c4e2b0c Add getOrNull API to location service at endpoint /api/location/orNull . 2021-05-13 11:47:04 -04:00
Mike Hansen
5881a00657 Merge pull request #104 from Telecominfraproject/WIFI-2112
Wifi-2112 Support Equipment ApImpacting Provisioning Changes to AP
2021-05-11 09:44:04 -04:00
Lynn Shi
56b0dc08ba Merge branch 'master' of github.com:Telecominfraproject/wlan-cloud-services into WIFI-2112 2021-05-07 15:55:25 -04:00
Lynn Shi
5ec68adc99 WIFI-2112 Support Equipment ApImpacting Provisioning Changes to AP 2021-05-07 15:47:58 -04:00
Mike Hansen
0357f2d3a4 WIFI-2060: Service - Update equipment_ap profile with additional RadiusProxy data for accounting server and port
Adding acctSharedSecret

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
2021-05-07 10:47:30 -04:00
Mike Hansen
40c7439a60 Merge pull request #103 from Telecominfraproject/WIFI-2096
WIFI-2096 Add Portal support for cell size management
2021-05-07 10:24:03 -04:00
Lynn Shi
901f1c4517 WIFI-2096 Add Portal support for cell size management, fix test case 2021-05-06 16:44:44 -04:00
Lynn Shi
9c58fda584 WIFI-2096 Add Portal support for cell size management, throw exception for updateCellSizeAttributes on disabled autoCellSizeSelection 2021-05-06 11:06:47 -04:00
Lynn Shi
982ccfdd0e WIFI-2096 Add Portal support for cell size management 2021-05-05 16:18:42 -04:00
Mike Hansen
535df0041e Merge pull request #102 from Telecominfraproject/WIFI-2080
WIFI-2080 Add support for cell size attributes lightweight provisioni…
2021-05-04 12:52:33 -04:00
Lynn Shi
4b100290a7 WIFI-2080 Minor update 2021-04-30 14:08:54 -04:00
Lynn Shi
660326974c WIFI-2080 Update based on review comments 2021-04-30 13:49:58 -04:00
Lynn Shi
1d77f9f7f2 WIFI-2080 Add support for cell size attributes lightweight provisioning changes to AP 2021-04-29 18:15:38 -04:00
319 changed files with 5140 additions and 23831 deletions

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>adoption-metrics-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,29 +15,29 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -45,7 +45,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,25 +15,25 @@
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra-tests</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -121,6 +121,10 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
" from " + TABLE_NAME + " " +
" where customerId = ? ";
private static final String CQL_GET_ALL =
"select " + ALL_COLUMNS +
" from " + TABLE_NAME + " ";
private static final String CQL_GET_LASTMOD_BY_ID =
"select lastModifiedTimestamp " +
" from "+TABLE_NAME+" " +
@@ -791,7 +795,10 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
long equipmentIdPostQuery = row.getLong("equipmentId");
int alarmCodePostQuery = row.getInt("alarmCode");
long createdTimestampPostQuery = row.getLong("createdTimestamp");
pageItems.add(getOrNull(customerId, equipmentIdPostQuery, AlarmCode.getById(alarmCodePostQuery), createdTimestampPostQuery));
Alarm alarmToAdd = getOrNull(customerId, equipmentIdPostQuery, AlarmCode.getById(alarmCodePostQuery), createdTimestampPostQuery);
if (alarmToAdd != null) {
pageItems.add(alarmToAdd);
}
}
break;
default:
@@ -922,4 +929,51 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
return alarmCounts;
}
@Override
public List<Alarm> get(Set<AlarmCode> alarmCodes, long createdAfterTimestamp) {
if (alarmCodes == null || alarmCodes.isEmpty()) {
throw new IllegalArgumentException("alarmCodes must be provided");
}
LOG.debug("Looking up Alarms for alarmCodes {} createdAfter {}", alarmCodes, createdAfterTimestamp);
String query = CQL_GET_ALL;
// add filters for the query
ArrayList<Object> queryArgs = new ArrayList<>();
// add alarmCodes filters
alarmCodes.forEach(ac -> queryArgs.add(ac.getId()));
StringBuilder strb = new StringBuilder(100);
strb.append("where alarmCode in (");
for (int i = 0; i < alarmCodes.size(); i++) {
strb.append("?");
if (i < alarmCodes.size() - 1) {
strb.append(",");
}
}
strb.append(") ");
if (createdAfterTimestamp > 0) {
strb.append(" and createdTimestamp > ?");
queryArgs.add(createdAfterTimestamp);
}
strb.append(" allow filtering");
query += strb.toString();
List<Alarm> ret = new ArrayList<>();
PreparedStatement preparedStmt_getListForCustomer = cqlSession.prepare(query);
ResultSet rs = cqlSession.execute(preparedStmt_getListForCustomer.bind(queryArgs.toArray()));
rs.forEach(row -> ret.add(alarmRowMapper.mapRow(row)));
LOG.debug("Found {} Alarms for alarmCodes {} createdAfter {}", ret.size(), alarmCodes, createdAfterTimestamp);
return ret;
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -356,4 +356,25 @@ public class AlarmDatastoreInMemory extends BaseInMemoryDatastore implements Ala
return alarmCounts;
}
@Override
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
if (alarmCodeSet == null || alarmCodeSet.isEmpty()) {
throw new IllegalArgumentException("alarmCodeSet must be provided");
}
List<Alarm> ret = new ArrayList<>();
idToAlarmMap.values().forEach(a -> {
if (alarmCodeSet.contains(a.getAlarmCode()) && a.getCreatedTimestamp() > createdAfterTimestamp) {
ret.add(a.clone());
}
});
LOG.debug("Found Alarms {}", ret);
return ret;
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -71,4 +71,14 @@ public interface AlarmDatastore {
*/
AlarmCounts getAlarmCounts(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, Boolean acknowledged);
/**
* Retrieves a list of Alarms for the given alarm codes.
*
* @param alarmCodeSet - null or empty means include all alarm codes
* @param createdAfterTimestamp
* @return list of matching Alarm objects.
* @throws IllegalArgumentException if supplied alarmCodeSet is null or empty
*/
List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,17 +15,17 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>status-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -53,7 +53,7 @@ public class AlarmCode implements EnumWithId {
public static final AlarmCode
LimitedCloudConnectivity = new AlarmCode(3, "LimitedCloudConnectivity", "Equipment is connected, however it's not reporting status or metrics", StatusCode.error, "Service AP and verify networking path to cloud"),
AccessPointIsUnreachable = new AlarmCode(4, "AccessPointIsUnreachable", "Equipment is not reachable from cloud", StatusCode.error, "Service AP and verify networking path to cloud"),
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Equipment is not report metrics"),
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Metrics are not received from the equipment"),
NoiseFloor2G = new AlarmCode(7, "NoiseFloor2G", "Noise floor is too high on 2G radio", StatusCode.requiresAttention, "Investigate interference sources"),
ChannelUtilization2G = new AlarmCode(8, "ChannelUtilization2G", "Channel utilization is too high on 2G radio", StatusCode.requiresAttention, "Consider adding more APs"),
NoiseFloor5G = new AlarmCode(9, "NoiseFloor5G", "Noise floor is too high on 5G radio", StatusCode.requiresAttention, "Investigate interference sources"),

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -113,5 +113,16 @@ public interface AlarmServiceInterface {
* @return alarm counts for the given filters
*/
AlarmCounts getAlarmCounts(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, Boolean acknowledged);
/**
* Retrieves a list of Alarms for the given alarm codes.
*
* @param alarmCodeSet - null or empty means include all alarm codes
* @param createdAfterTimestamp
* @return list of matching Alarm objects.
* @throws IllegalArgumentException if supplied alarmCodeSet is null or empty
*/
List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -47,6 +47,10 @@ public class AlarmServiceLocal implements AlarmServiceInterface {
return alarmController.getAllForEquipment(customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp);
}
@Override
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
return alarmController.getAllForAlarmCode(alarmCodeSet, createdAfterTimestamp);
}
@Override
public Alarm update(Alarm alarm) {

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,43 +15,54 @@
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -241,14 +241,45 @@ public class AlarmServiceRemote extends BaseRemoteClient implements AlarmService
return ret;
}
@Override
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
LOG.debug("get({},{})", alarmCodeSet, createdAfterTimestamp);
if (alarmCodeSet == null || alarmCodeSet.isEmpty()) {
throw new IllegalArgumentException("alarmCodeSet must be provided");
}
String alarmCodeSetStr = alarmCodeSet.toString();
// remove [] around the string, otherwise will get:
// Failed to convert value of type 'java.lang.String' to required
// type 'java.util.Set'; nested exception is
// java.lang.NumberFormatException: For input string: "[690]"
alarmCodeSetStr = alarmCodeSetStr.substring(1, alarmCodeSetStr.length() - 1);
try {
ResponseEntity<List<Alarm>> responseEntity =
restTemplate.exchange(getBaseUrl() + "/forAlarmCode?alarmCode={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}",
HttpMethod.GET, null, Alarm_LIST_CLASS_TOKEN, alarmCodeSetStr, createdAfterTimestamp);
List<Alarm> result = responseEntity.getBody();
if (null == result) {
result = Collections.emptyList();
}
LOG.debug("get({},{}) return {} entries", alarmCodeSet, createdAfterTimestamp, result.size());
return result;
} catch (Exception exp) {
LOG.error("getAllInSet({},{}) exception ", alarmCodeSet, createdAfterTimestamp, exp);
throw exp;
}
}
public String getBaseUrl() {
if(baseUrl==null) {
baseUrl = environment.getProperty("tip.wlan.alarmServiceBaseUrl").trim()+"/api/alarm";
}
return baseUrl;
return baseUrl;
}
}

View File

@@ -19,6 +19,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -26,12 +27,17 @@ import com.telecominfraproject.wlan.alarm.models.Alarm;
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
import com.telecominfraproject.wlan.alarm.models.AlarmCounts;
import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
import com.telecominfraproject.wlan.core.model.pagination.SortOrder;
import com.telecominfraproject.wlan.datastore.exceptions.DsConcurrentModificationException;
import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundException;
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.remote.tests.BaseRemoteTest;
import com.telecominfraproject.wlan.status.models.StatusCode;
@@ -44,10 +50,16 @@ import com.telecominfraproject.wlan.status.models.StatusCode;
"integration_test",
"no_ssl","http_digest_auth","rest-template-single-user-per-service-digest-auth",
}) //NOTE: these profiles will be ADDED to the list of active profiles
@Import(value = {
EquipmentServiceLocal.class,
EquipmentDatastoreInMemory.class,
CloudEventDispatcherEmpty.class
})
public class AlarmServiceRemoteTest extends BaseRemoteTest {
@Autowired AlarmServiceRemote remoteInterface;
@Autowired EquipmentServiceLocal equipmentServicelocal;
@Before public void urlSetup(){
configureBaseUrl("tip.wlan.alarmServiceBaseUrl");
@@ -505,8 +517,10 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
public void testAlarmCountsRetrieval() {
//create some Alarms
Alarm mdl;
int customerId_1 = getNextCustomerId();
int customerId_2 = getNextCustomerId();
final int customerId_1 = getNextCustomerId();
final int customerId_2 = getNextCustomerId();
final long equipmentId_1 = createEquipmentObject(customerId_1).getId();
int apNameIdx = 0;
Set<Long> equipmentIds = new HashSet<>();
@@ -514,8 +528,8 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
Set<Long> equipmentIds_AccessPointIsUnreachable = new HashSet<>();
for(int i = 0; i< 50; i++){
mdl = createAlarmObject();
mdl.setCustomerId(customerId_1);
mdl = createAlarmObject(customerId_1, createEquipmentObject(customerId_1).getId());
mdl.setEquipmentId(createEquipmentObject(customerId_1).getId());
mdl.setScopeId("qr_"+apNameIdx);
if((i%2) == 0) {
mdl.setAlarmCode(AlarmCode.CPUUtilization);
@@ -530,16 +544,14 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
remoteInterface.create(mdl);
}
mdl = createAlarmObject();
mdl = createAlarmObject(customerId_1, equipmentId_1);
mdl.setCustomerId(customerId_1);
mdl.setEquipmentId(0);
mdl.setAlarmCode(AlarmCode.GenericError);
remoteInterface.create(mdl);
for(int i = 0; i< 50; i++){
mdl = createAlarmObject();
mdl.setCustomerId(customerId_2);
mdl = createAlarmObject(customerId_2, createEquipmentObject(customerId_2).getId());
mdl.setScopeId("qr_"+apNameIdx);
mdl.setAcknowledged(false);
mdl.setAlarmCode(AlarmCode.GenericError);
@@ -651,18 +663,33 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
}
private Alarm createAlarmObject() {
Alarm result = new Alarm();
result.setCustomerId(getNextCustomerId());
result.setEquipmentId(getNextEquipmentId());
int customerId = getNextCustomerId();
return createAlarmObject(customerId, createEquipmentObject(customerId).getId());
}
private Alarm createAlarmObject(int customerId, long equipmentId) {
Alarm result = new Alarm();
result.setCustomerId(customerId);
result.setAlarmCode(AlarmCode.AccessPointIsUnreachable);
result.setCreatedTimestamp(System.currentTimeMillis());
result.setEquipmentId(equipmentId);
result.setScopeId("test-scope-" + result.getEquipmentId());
AlarmDetails details = new AlarmDetails();
details.setMessage("test-details-" + result.getEquipmentId());
result.setDetails(details );
result.setDetails(details );
return result;
}
private Equipment createEquipmentObject(int customerId)
{
Equipment equipment = new Equipment();
equipment.setName("testName");
equipment.setInventoryId("test-inv");
equipment.setEquipmentType(EquipmentType.AP);
equipment.setCustomerId(customerId);
return equipmentServicelocal.create(equipment);
}
}

View File

@@ -1,53 +1,70 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
<artifactId>alarm-service</artifactId>
<name>alarm-service</name>
<description>Server side implementation of the service.</description>
<dependencies>
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<artifactId>alarm-service</artifactId>
<name>alarm-service</name>
<description>Server side implementation of the service.</description>
<dependencies>
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -20,6 +20,7 @@ import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
import com.telecominfraproject.wlan.datastore.exceptions.DsDataValidationException;
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
import com.telecominfraproject.wlan.alarm.datastore.AlarmDatastore;
@@ -48,6 +49,7 @@ public class AlarmController {
@Autowired private AlarmDatastore alarmDatastore;
@Autowired private CloudEventDispatcherInterface cloudEventDispatcher;
@Autowired private EquipmentServiceInterface equipmentServiceInterface;
/**
@@ -66,6 +68,14 @@ public class AlarmController {
LOG.error("Failed to create Alarm, request contains unsupported value: {}", alarm);
throw new DsDataValidationException("Alarm contains unsupported value");
}
if (alarm.getEquipmentId() != 0)
{
if (equipmentServiceInterface.getOrNull(alarm.getEquipmentId()) == null)
{
throw new DsDataValidationException(String.format("Unable to create alarm for non-existant equipment ID: %d", alarm.getEquipmentId()));
}
}
long ts = alarm.getCreatedTimestamp();
if (ts == 0) {
@@ -119,6 +129,24 @@ public class AlarmController {
throw exp;
}
}
@RequestMapping(value = "/forAlarmCode", method = RequestMethod.GET)
public ListOfAlarms getAllForAlarmCode(
@RequestParam Set<AlarmCode> alarmCode,
@RequestParam long createdAfterTimestamp) {
LOG.debug("getAllForAlarmCode({}, {})", alarmCode, createdAfterTimestamp);
try {
List<Alarm> result = alarmDatastore.get(alarmCode, createdAfterTimestamp);
LOG.debug("getAllForAlarmCode({},{}) return {} entries", alarmCode, createdAfterTimestamp, result.size());
ListOfAlarms ret = new ListOfAlarms();
ret.addAll(result);
return ret;
} catch (Exception exp) {
LOG.error("getAllForAlarmCode({},{}) exception ", alarmCode, createdAfterTimestamp, exp);
throw exp;
}
}
@RequestMapping(value = "/forCustomer", method = RequestMethod.GET)
public PaginationResponse<Alarm> getForCustomer(@RequestParam int customerId,

View File

@@ -17,7 +17,11 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
import com.telecominfraproject.wlan.equipment.controller.EquipmentController;
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.alarm.datastore.inmemory.AlarmDatastoreInMemory;
import com.telecominfraproject.wlan.alarm.models.Alarm;
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
@@ -39,10 +43,14 @@ import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
CloudEventDispatcherEmpty.class,
AlarmDatastoreInMemory.class,
AlarmControllerTest.Config.class,
EquipmentServiceLocal.class,
EquipmentController.class,
EquipmentDatastoreInMemory.class
})
public class AlarmControllerTest {
@Autowired private AlarmController alarmController;
@Autowired EquipmentServiceLocal equipmentServicelocal;
@Configuration
@@ -59,8 +67,9 @@ public class AlarmControllerTest {
//Create new Alarm - success
Alarm alarm = new Alarm();
alarm.setCustomerId((int) testSequence.getAndIncrement());
alarm.setEquipmentId(testSequence.getAndIncrement());
int customerId = (int) testSequence.getAndIncrement();
alarm.setCustomerId(customerId);
alarm.setEquipmentId(createEquipmentObject(customerId).getId());
alarm.setAlarmCode(AlarmCode.AccessPointIsUnreachable);
alarm.setCreatedTimestamp(System.currentTimeMillis());
@@ -91,5 +100,14 @@ public class AlarmControllerTest {
assertEquals(expected.getDetails(), actual.getDetails());
//TODO: add more fields to check here
}
private Equipment createEquipmentObject(int customerId)
{
Equipment equipment = new Equipment();
equipment.setName("testName");
equipment.setInventoryId("test-inv");
equipment.setEquipmentType(EquipmentType.AP);
equipment.setCustomerId(customerId);
return equipmentServicelocal.create(equipment);
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
<artifactId>all-cloud-and-opensync-gw-in-one-docker</artifactId>
@@ -22,7 +22,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-and-opensync-gw-in-one-process</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -21,350 +21,344 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>opensync-ext-cloud</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- PortForwarding Gateway - to support remote ssh connections to APs -->
<dependency>
<artifactId>port-forwarding-gateway</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- portal services -->
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>location-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>profile-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>portal-user-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>firmware-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>manufacturer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>routing-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -31,7 +31,6 @@ import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSessionMetricDetails;
import com.telecominfraproject.wlan.core.model.entity.CountryCode;
import com.telecominfraproject.wlan.core.model.entity.MinMaxAvgValueInt;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
@@ -811,10 +810,10 @@ public class AllInOneWithGatewayStartListener implements ApplicationRunner {
sessionDetails.setRadioType(radioType);
sessionDetails.setSecurityType(SecurityType.PSK);
sessionDetails.setSsid(ssidConfig.getSsid());
sessionDetails.setSessionId(System.currentTimeMillis());
sessionDetails.setSessionId(Long.toUnsignedString(System.currentTimeMillis()));
sessionDetails.setAssocTimestamp(System.currentTimeMillis() - getRandomLong(10000, 1000000));
ClientDhcpDetails dhcpDetails = new ClientDhcpDetails(System.currentTimeMillis());
ClientDhcpDetails dhcpDetails = new ClientDhcpDetails(Long.toUnsignedString(System.currentTimeMillis()));
dhcpDetails.setLeaseStartTimestamp(System.currentTimeMillis() - getRandomLong(0, TimeUnit.HOURS.toMillis(4)));
dhcpDetails.setLeaseTimeInSeconds((int)TimeUnit.HOURS.toSeconds(4));
try {
@@ -829,16 +828,6 @@ public class AllInOneWithGatewayStartListener implements ApplicationRunner {
sessionDetails.setDhcpDetails(dhcpDetails );
ClientSessionMetricDetails metricDetails = new ClientSessionMetricDetails();
metricDetails.setRssi(getRandomInt(-60, -40));
metricDetails.setRxBytes(getRandomLong(10000, 10000000));
metricDetails.setTxBytes(getRandomLong(10000, 10000000));
metricDetails.setRxMbps(getRandomFloat(50, 100));
metricDetails.setTxMbps(getRandomFloat(50, 100));
metricDetails.setSnr(getRandomInt(-90, -50));
sessionDetails.setMetricDetails(metricDetails);
clientSession.setDetails(sessionDetails);
this.clientServiceInterface.updateSession(clientSession);

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-in-one-process-with-persistence</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-in-one-process</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -22,250 +22,244 @@
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-remote</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -21,343 +21,337 @@
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>location-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>profile-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>portal-user-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>firmware-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>manufacturer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>routing-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-remote</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>port-forwarding-gateway-local</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -1,14 +1,11 @@
package com.telecominfraproject.wlan.startuptasks;
import java.io.BufferedWriter;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
@@ -41,7 +38,6 @@ import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSessionMetricDetails;
import com.telecominfraproject.wlan.core.model.entity.CountryCode;
import com.telecominfraproject.wlan.core.model.entity.MinMaxAvgValueInt;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
@@ -1241,8 +1237,6 @@ public class AllInOneStartListener implements ApplicationRunner {
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setSessionId(getRandomLong(3000000, 7000000));
clientMetrics.setTxRetries(getRandomInt(30, 70));
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
clientMetrics.setSnr(getRandomInt(-70, -30));
@@ -1268,8 +1262,6 @@ public class AllInOneStartListener implements ApplicationRunner {
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setSessionId(getRandomLong(3000000, 7000000));
clientMetrics.setTxRetries(getRandomInt(30, 70));
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
clientMetrics.setSnr(getRandomInt(-70, -30));
@@ -1295,8 +1287,6 @@ public class AllInOneStartListener implements ApplicationRunner {
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
clientMetrics.setSessionId(getRandomLong(3000000, 7000000));
clientMetrics.setTxRetries(getRandomInt(30, 70));
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
clientMetrics.setSnr(getRandomInt(-70, -30));
@@ -1364,10 +1354,10 @@ public class AllInOneStartListener implements ApplicationRunner {
sessionDetails.setRadioType(radioType);
sessionDetails.setSecurityType(SecurityType.PSK);
sessionDetails.setSsid(ssidConfig.getSsid());
sessionDetails.setSessionId(System.currentTimeMillis());
sessionDetails.setSessionId(Long.toUnsignedString(System.currentTimeMillis()));
sessionDetails.setAssocTimestamp(System.currentTimeMillis() - getRandomLong(10000, 1000000));
ClientDhcpDetails dhcpDetails = new ClientDhcpDetails(System.currentTimeMillis());
ClientDhcpDetails dhcpDetails = new ClientDhcpDetails(Long.toUnsignedString(System.currentTimeMillis()));
dhcpDetails
.setLeaseStartTimestamp(System.currentTimeMillis() - getRandomLong(0, TimeUnit.HOURS.toMillis(4)));
dhcpDetails.setLeaseTimeInSeconds((int) TimeUnit.HOURS.toSeconds(4));
@@ -1383,16 +1373,6 @@ public class AllInOneStartListener implements ApplicationRunner {
sessionDetails.setDhcpDetails(dhcpDetails);
ClientSessionMetricDetails metricDetails = new ClientSessionMetricDetails();
metricDetails.setRssi(getRandomInt(-60, -40));
metricDetails.setRxBytes(getRandomLong(10000, 10000000));
metricDetails.setTxBytes(getRandomLong(10000, 10000000));
metricDetails.setRxMbps(getRandomFloat(50, 100));
metricDetails.setTxMbps(getRandomFloat(50, 100));
metricDetails.setSnr(getRandomInt(-90, -50));
sessionDetails.setMetricDetails(metricDetails);
clientSession.setDetails(sessionDetails);
this.clientServiceInterface.updateSession(clientSession);

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra-tests</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -12,6 +12,7 @@ import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
@@ -45,6 +46,12 @@ public class ClientDatastoreCassandra implements ClientDatastore {
return clientDAO.delete(customerId, clientMac);
}
@Override
public void delete(long createdBeforeTimestamp) {
//This should be handled by Cassandra's life cycle for data.
return;
}
@Override
public List<Client> get(int customerId, Set<MacAddress> clientMacSet) {
return clientDAO.get(customerId, clientMacSet);
@@ -80,6 +87,12 @@ public class ClientDatastoreCassandra implements ClientDatastore {
public ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac) {
return clientSessionDAO.deleteSession(customerId, equipmentId, clientMac);
}
@Override
public void deleteSessions(long createdBeforeTimestamp) {
//This should be handled by Cassandra's lifecycle for data.
return;
}
@Override
public List<ClientSession> getSessions(int customerId, Set<MacAddress> clientMacSet) {
@@ -96,6 +109,13 @@ public class ClientDatastoreCassandra implements ClientDatastore {
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, context);
}
@Override
public ClientSessionCounts getSessionCounts(int customerId) {
// Not yet supported.
ClientSessionCounts counts = new ClientSessionCounts();
return counts;
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -3,6 +3,7 @@ package com.telecominfraproject.wlan.client.datastore.inmemory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -15,6 +16,7 @@ import org.springframework.context.annotation.Configuration;
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
import com.telecominfraproject.wlan.client.info.models.ClientInfoDetails;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -156,6 +158,11 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
//client is already cloned by the getOrNull method
return client;
}
@Override
public void delete(long createdBeforeTimestamp) {
return;
}
@Override
public List<Client> get(int customerId, Set<MacAddress> clientMacSet) {
@@ -362,6 +369,10 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
return clientSession.clone();
}
@Override
public void deleteSessions(long createdBeforeTimestamp) {
return;
}
@Override
public List<ClientSession> getSessions(int customerId, Set<MacAddress> clientMacSet) {
@@ -503,4 +514,56 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
return ret;
}
@Override
public ClientSessionCounts getSessionCounts(int customerId) {
ClientSessionCounts counts = new ClientSessionCounts();
counts.setCustomerId(customerId);
long totalCount = 0;
Map<String, Long> perEquipmentMap = new HashMap<>();
Map<String, Long> perOuiMap = new HashMap<>();
Map<String, Long> perRadioMap = new HashMap<>();
for (ClientSession session : idToClientSessionMap.values()) {
if (session.getCustomerId() == customerId) {
totalCount++;
String equipmentIdString = Long.toString(session.getEquipmentId());
Long cnt = perEquipmentMap.get(equipmentIdString);
if (cnt == null) {
cnt = 0L;
} else {
cnt++;
}
perEquipmentMap.put(equipmentIdString, cnt);
if (session.getOui() != null) {
cnt = perOuiMap.get(session.getOui());
if (cnt == null) {
cnt = 0L;
} else {
cnt++;
}
perOuiMap.put(session.getOui(), cnt);
}
if (session.getDetails() != null && session.getDetails().getRadioType() != null) {
String radioTypeString = session.getDetails().getRadioType().toString();
cnt = perRadioMap.get(radioTypeString);
if (cnt == null) {
cnt = 0L;
} else {
cnt++;
}
perRadioMap.put(radioTypeString, cnt);
}
}
}
counts.setTotalCount(totalCount);
counts.setEquipmentCounts(perEquipmentMap);
counts.setOuiCounts(perOuiMap);
counts.setRadioCounts(perRadioMap);
return counts;
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -21,6 +22,7 @@ public interface ClientDatastore {
Client getOrNull(int customerId, MacAddress clientMac);
Client update(Client client);
Client delete(int customerId, MacAddress clientMac);
void delete(long createdBeforeTimestamp);
/**
* Retrieves a list of Client records that which have their mac address in the provided set.
@@ -72,7 +74,7 @@ public interface ClientDatastore {
ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac);
void deleteSessions(long createdBeforeTimestamp);
/**
* Retrieves a list of Client sessions that which have their mac address in the provided set.
*
@@ -104,5 +106,12 @@ public interface ClientDatastore {
*/
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
/**
* Get Client Session counts for the given customerId.
*
* @param customerId
* @return
*/
ClientSessionCounts getSessionCounts(int customerId);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -0,0 +1,90 @@
package com.telecominfraproject.wlan.client.info.models;
import java.util.HashMap;
import java.util.Map;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
/**
* Total and per-oui/equipment/radio counts of the Client Sessions
*/
public class ClientSessionCounts extends BaseJsonModel {
private static final long serialVersionUID = 7697349699510565184L;
private int customerId;
/**
* Total count of all client sessions for the customer Id.
*/
private long totalCount;
/**
* Counts of client sessions per equipment Id.
*/
private Map<String, Long> equipmentCounts = new HashMap<>();
/**
* Counts of client sessions per OUI.
*/
private Map<String, Long> ouiCounts = new HashMap<>();
/**
* Counts of client sessions per Radio Type.
*/
private Map<String, Long> radioCounts = new HashMap<>();
public int getCustomerId() {
return customerId;
}
public void setCustomerId(int customerId) {
this.customerId = customerId;
}
public long getTotalCount() {
return totalCount;
}
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
public Map<String, Long> getEquipmentCounts() {
return equipmentCounts;
}
public void setEquipmentCounts(Map<String, Long> equipmentCounts) {
this.equipmentCounts = equipmentCounts;
}
public Map<String, Long> getOuiCounts() {
return ouiCounts;
}
public void setOuiCounts(Map<String, Long> ouiCounts) {
this.ouiCounts = ouiCounts;
}
public Map<String, Long> getRadioCounts() {
return radioCounts;
}
public void setRadioCounts(Map<String, Long> radioCounts) {
this.radioCounts = radioCounts;
}
@Override
public ClientSessionCounts clone() {
ClientSessionCounts ret = (ClientSessionCounts) super.clone();
if (equipmentCounts != null) {
ret.equipmentCounts = new HashMap<>(equipmentCounts);
}
if (ouiCounts != null) {
ret.ouiCounts = new HashMap<>(ouiCounts);
}
if (radioCounts != null) {
ret.radioCounts = new HashMap<>(radioCounts);
}
return ret;
}
}

View File

@@ -1,19 +1,30 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.systemevent.models.CustomerEventWithPayload;
/**
* @author dtoptygin
*
*/
public class ClientAddedEvent extends CustomerEventWithPayload<Client> {
public class ClientAddedEvent extends CustomerEventWithPayload<Client> implements HasClientMac{
private static final long serialVersionUID = 7142208487917559985L;
public ClientAddedEvent(Client client){
super(client.getCustomerId(), client);
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON
*/

View File

@@ -1,19 +1,30 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.systemevent.models.CustomerEventWithPayload;
/**
* @author dtoptygin
*
*/
public class ClientBlockListChangedEvent extends CustomerEventWithPayload<Client> {
public class ClientBlockListChangedEvent extends CustomerEventWithPayload<Client> implements HasClientMac{
private static final long serialVersionUID = 7142209997917559985L;
public ClientBlockListChangedEvent(Client client){
super(client.getCustomerId(), client);
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON
*/

View File

@@ -1,19 +1,30 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.systemevent.models.CustomerEventWithPayload;
/**
* @author dtoptygin
*
*/
public class ClientChangedEvent extends CustomerEventWithPayload<Client> {
public class ClientChangedEvent extends CustomerEventWithPayload<Client> implements HasClientMac{
private static final long serialVersionUID = 7142209997917559985L;
public ClientChangedEvent(Client client){
super(client.getCustomerId(), client);
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON
*/

View File

@@ -1,19 +1,30 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.systemevent.models.CustomerEventWithPayload;
/**
* @author dtoptygin
*
*/
public class ClientRemovedEvent extends CustomerEventWithPayload<Client> {
public class ClientRemovedEvent extends CustomerEventWithPayload<Client> implements HasClientMac{
private static final long serialVersionUID = 7142208488887559985L;
public ClientRemovedEvent(Client client){
super(client.getCustomerId(), client);
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON
*/

View File

@@ -1,6 +1,8 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasLocationId;
import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload;
@@ -8,7 +10,7 @@ import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload
* @author dtoptygin
*
*/
public class ClientSessionChangedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId {
public class ClientSessionChangedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId, HasClientMac {
private static final long serialVersionUID = 7142208487917559985L;
public ClientSessionChangedEvent(ClientSession clientSession){
@@ -23,6 +25,15 @@ public class ClientSessionChangedEvent extends EquipmentEventWithPayload<ClientS
return 0;
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON

View File

@@ -1,6 +1,8 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasLocationId;
import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload;
@@ -8,7 +10,7 @@ import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload
* @author dtoptygin
*
*/
public class ClientSessionClosedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId {
public class ClientSessionClosedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId, HasClientMac {
private static final long serialVersionUID = 7142208487917559985L;
public ClientSessionClosedEvent(ClientSession clientSession){
@@ -23,6 +25,15 @@ public class ClientSessionClosedEvent extends EquipmentEventWithPayload<ClientSe
return 0;
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON

View File

@@ -1,6 +1,8 @@
package com.telecominfraproject.wlan.client.models.events;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasLocationId;
import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload;
@@ -8,7 +10,7 @@ import com.telecominfraproject.wlan.systemevent.models.EquipmentEventWithPayload
* @author dtoptygin
*
*/
public class ClientSessionRemovedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId {
public class ClientSessionRemovedEvent extends EquipmentEventWithPayload<ClientSession> implements HasLocationId, HasClientMac {
private static final long serialVersionUID = 7142208487917559985L;
public ClientSessionRemovedEvent(ClientSession clientSession){
@@ -23,6 +25,15 @@ public class ClientSessionRemovedEvent extends EquipmentEventWithPayload<ClientS
return 0;
}
@Override
public MacAddress getClientMacAddress() {
if (getPayload() != null) {
return getPayload().getMacAddress();
}
return null;
}
/**
* Constructor used by JSON

View File

@@ -12,7 +12,7 @@ import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEvent
public class ClientAssocEvent extends RealTimeEvent implements HasClientMac {
private static final long serialVersionUID = 7015822981315570338L;
private long sessionId;
private String sessionId;
private String ssid;
private MacAddress clientMacAddress;
private RadioType radioType;
@@ -29,7 +29,7 @@ public class ClientAssocEvent extends RealTimeEvent implements HasClientMac {
}
public ClientAssocEvent(int customerId, long locationId, long equipmentId, long timestamp, long sessionId, String ssid,
public ClientAssocEvent(int customerId, long locationId, long equipmentId, long timestamp, String sessionId, String ssid,
MacAddress clientMacAddress, RadioType radioType, boolean isReassociation, WlanStatusCode status,
Integer internalSC, Integer rssi) {
super(RealTimeEventType.STA_Client_Assoc, customerId, locationId, equipmentId, timestamp);
@@ -50,7 +50,7 @@ public class ClientAssocEvent extends RealTimeEvent implements HasClientMac {
/**
* @return the sessionId
*/
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
@@ -58,7 +58,7 @@ public class ClientAssocEvent extends RealTimeEvent implements HasClientMac {
* @param sessionId
* the sessionId to set
*/
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -13,7 +13,7 @@ public class ClientAuthEvent extends RealTimeEvent implements HasClientMac {
private static final long serialVersionUID = 1221389696911864515L;
private long sessionId;
private String sessionId;
private String ssid;
private MacAddress clientMacAddress;
private WlanStatusCode authStatus;
@@ -32,11 +32,11 @@ public class ClientAuthEvent extends RealTimeEvent implements HasClientMac {
super(eventType, timestamp);
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -14,7 +14,7 @@ public class ClientConnectSuccessEvent extends RealTimeEvent implements HasClien
private static final long serialVersionUID = -6082134146801575193L;
private MacAddress clientMacAddress;
private long sessionId;
private String sessionId;
private RadioType radioType;
private boolean isReassociation;
private String ssid;
@@ -61,7 +61,7 @@ public class ClientConnectSuccessEvent extends RealTimeEvent implements HasClien
/**
* @return the sessionId
*/
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
@@ -69,7 +69,7 @@ public class ClientConnectSuccessEvent extends RealTimeEvent implements HasClien
* @param sessionId
* the sessionId to set
*/
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -45,7 +45,7 @@ public class ClientDisconnectEvent extends RealTimeEvent implements HasClientMac
}
private static final long serialVersionUID = -7674230178565760938L;
private long sessionId;
private String sessionId;
private byte[] macAddressBytes;
private MacAddress clientMacAddress;
private long lastRecvTime;
@@ -104,7 +104,7 @@ public class ClientDisconnectEvent extends RealTimeEvent implements HasClientMac
return rssi;
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
@@ -148,7 +148,7 @@ public class ClientDisconnectEvent extends RealTimeEvent implements HasClientMac
this.rssi = rssi;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -14,7 +14,7 @@ import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEvent
public class ClientFailureEvent extends RealTimeEvent implements HasClientMac {
private static final long serialVersionUID = -16021752050335131L;
private long sessionId;
private String sessionId;
private String ssid;
private MacAddress clientMacAddress;
private WlanReasonCode reasonCode;
@@ -38,11 +38,11 @@ public class ClientFailureEvent extends RealTimeEvent implements HasClientMac {
this.clientMacAddress = clientMacAddress;
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -10,7 +10,7 @@ import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEvent
public class ClientFirstDataEvent extends RealTimeEvent implements HasClientMac {
private static final long serialVersionUID = 298223061973506469L;
private long sessionId;
private String sessionId;
private MacAddress clientMacAddress;
private long firstDataRcvdTs;
private long firstDataSentTs;
@@ -28,11 +28,11 @@ public class ClientFirstDataEvent extends RealTimeEvent implements HasClientMac
super(eventType, timestamp);
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -1,6 +1,7 @@
package com.telecominfraproject.wlan.client.models.events.realtime;
import java.util.Arrays;
import java.util.Objects;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasClientMac;
@@ -10,7 +11,7 @@ import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEvent
public class ClientIdEvent extends RealTimeEvent implements HasClientMac {
private static final long serialVersionUID = 298223061973506469L;
private long sessionId;
private String sessionId;
private byte[] macAddressBytes;
private MacAddress clientMacAddress;
private String userId;
@@ -27,7 +28,7 @@ public class ClientIdEvent extends RealTimeEvent implements HasClientMac {
/**
* @return the sessionId
*/
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
@@ -35,7 +36,7 @@ public class ClientIdEvent extends RealTimeEvent implements HasClientMac {
* @param sessionId
* the sessionId to set
*/
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
@@ -65,58 +66,28 @@ public class ClientIdEvent extends RealTimeEvent implements HasClientMac {
this.userId = userId;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
int result = super.hashCode();
result = prime * result + Arrays.hashCode(macAddressBytes);
result = prime * result + (int) (sessionId ^ (sessionId >>> 32));
result = prime * result + ((userId == null) ? 0 : userId.hashCode());
result = prime * result + ((clientMacAddress == null) ? 0 : clientMacAddress.hashCode());
result = prime * result + Objects.hash(clientMacAddress, sessionId, userId);
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
if (this == obj)
return true;
}
if (obj == null) {
if (!super.equals(obj))
return false;
}
if (!super.equals(obj)) {
if (getClass() != obj.getClass())
return false;
}
if (!(obj instanceof ClientIdEvent)) {
return false;
}
ClientIdEvent other = (ClientIdEvent) obj;
if (!Arrays.equals(macAddressBytes, other.macAddressBytes))
return false;
if (sessionId != other.sessionId)
return false;
if (userId == null) {
if (other.userId != null)
return false;
} else if (!userId.equals(other.userId))
return false;
if (clientMacAddress == null) {
if (other.clientMacAddress != null)
return false;
} else if (!clientMacAddress.equals(other.clientMacAddress))
return false;
return true;
return Objects.equals(clientMacAddress, other.clientMacAddress) && Arrays.equals(macAddressBytes, other.macAddressBytes)
&& Objects.equals(sessionId, other.sessionId) && Objects.equals(userId, other.userId);
}
@Override

View File

@@ -1,6 +1,6 @@
package com.telecominfraproject.wlan.client.models.events.realtime;
import java.util.Arrays;
import java.net.InetAddress;
import java.util.Objects;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -12,9 +12,9 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
private static final long serialVersionUID = -5332534925768685589L;
private long sessionId;
private String sessionId;
private MacAddress clientMacAddress;
private byte[] ipAddr;
private InetAddress ipAddr;
public ClientIpAddressEvent() {
// serialization
@@ -29,11 +29,11 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
super(eventType, timestamp);
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
@@ -45,11 +45,11 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
this.clientMacAddress = clientMacAddress;
}
public byte[] getIpAddr() {
public InetAddress getIpAddr() {
return ipAddr;
}
public void setIpAddr(byte[] ipAddr) {
public void setIpAddr(InetAddress ipAddr) {
this.ipAddr = ipAddr;
}
@@ -57,8 +57,7 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Arrays.hashCode(this.ipAddr);
result = prime * result + Objects.hash(clientMacAddress, sessionId);
result = prime * result + Objects.hash(ipAddr, clientMacAddress, sessionId);
return result;
}
@@ -74,7 +73,7 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
return false;
}
ClientIpAddressEvent other = (ClientIpAddressEvent) obj;
return Objects.equals(clientMacAddress, other.clientMacAddress) && Arrays.equals(ipAddr, other.ipAddr)
return Objects.equals(clientMacAddress, other.clientMacAddress) && Objects.equals(ipAddr, other.ipAddr)
&& this.sessionId == other.sessionId;
}

View File

@@ -26,7 +26,7 @@ public class ClientTimeoutEvent extends RealTimeEvent implements HasClientMac {
}
}
private long sessionId;
private String sessionId;
private MacAddress clientMacAddress;
private long lastRecvTime;
private long lastSentTime;
@@ -45,11 +45,11 @@ public class ClientTimeoutEvent extends RealTimeEvent implements HasClientMac {
super(eventType, timestamp);
}
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

View File

@@ -1,6 +1,7 @@
package com.telecominfraproject.wlan.client.session.models;
import java.net.InetAddress;
import java.util.Objects;
import com.telecominfraproject.wlan.core.model.equipment.WiFiSessionUtility;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
@@ -29,10 +30,9 @@ public class ClientDhcpDetails extends BaseJsonModel {
/**
* Identifies the association where DHCP last occurred.
*/
private long associationId;
private String associationId;
public ClientDhcpDetails(long sessionId) {
public ClientDhcpDetails(String sessionId) {
this.associationId = sessionId;
}
@@ -101,10 +101,10 @@ public class ClientDhcpDetails extends BaseJsonModel {
this.firstDiscoverTimestamp = firstDiscoverTimestamp;
}
public long getAssociationId() {
public String getAssociationId() {
return associationId;
}
public void setAssociationId(Long associationId) {
public void setAssociationId(String associationId) {
this.associationId = associationId;
}
@@ -116,123 +116,6 @@ public class ClientDhcpDetails extends BaseJsonModel {
this.nakTimestamp = nakTimestamp;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (associationId ^ (associationId >>> 32));
result = prime * result + ((dhcpServerIp == null) ? 0 : dhcpServerIp.hashCode());
result = prime * result + ((firstDiscoverTimestamp == null) ? 0 : firstDiscoverTimestamp.hashCode());
result = prime * result + ((firstOfferTimestamp == null) ? 0 : firstOfferTimestamp.hashCode());
result = prime * result + ((firstRequestTimestamp == null) ? 0 : firstRequestTimestamp.hashCode());
result = prime * result + (fromInternal ? 1231 : 1237);
result = prime * result + ((gatewayIp == null) ? 0 : gatewayIp.hashCode());
result = prime * result + ((leaseStartTimestamp == null) ? 0 : leaseStartTimestamp.hashCode());
result = prime * result + ((leaseTimeInSeconds == null) ? 0 : leaseTimeInSeconds.hashCode());
result = prime * result + ((nakTimestamp == null) ? 0 : nakTimestamp.hashCode());
result = prime * result + ((primaryDns == null) ? 0 : primaryDns.hashCode());
result = prime * result + ((secondaryDns == null) ? 0 : secondaryDns.hashCode());
result = prime * result + ((subnetMask == null) ? 0 : subnetMask.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ClientDhcpDetails)) {
return false;
}
ClientDhcpDetails other = (ClientDhcpDetails) obj;
if (associationId != other.associationId) {
return false;
}
if (dhcpServerIp == null) {
if (other.dhcpServerIp != null) {
return false;
}
} else if (!dhcpServerIp.equals(other.dhcpServerIp)) {
return false;
}
if (firstDiscoverTimestamp == null) {
if (other.firstDiscoverTimestamp != null) {
return false;
}
} else if (!firstDiscoverTimestamp.equals(other.firstDiscoverTimestamp)) {
return false;
}
if (firstOfferTimestamp == null) {
if (other.firstOfferTimestamp != null) {
return false;
}
} else if (!firstOfferTimestamp.equals(other.firstOfferTimestamp)) {
return false;
}
if (firstRequestTimestamp == null) {
if (other.firstRequestTimestamp != null) {
return false;
}
} else if (!firstRequestTimestamp.equals(other.firstRequestTimestamp)) {
return false;
}
if (fromInternal != other.fromInternal) {
return false;
}
if (gatewayIp == null) {
if (other.gatewayIp != null) {
return false;
}
} else if (!gatewayIp.equals(other.gatewayIp)) {
return false;
}
if (leaseStartTimestamp == null) {
if (other.leaseStartTimestamp != null) {
return false;
}
} else if (!leaseStartTimestamp.equals(other.leaseStartTimestamp)) {
return false;
}
if (leaseTimeInSeconds == null) {
if (other.leaseTimeInSeconds != null) {
return false;
}
} else if (!leaseTimeInSeconds.equals(other.leaseTimeInSeconds)) {
return false;
}
if (nakTimestamp == null) {
if (other.nakTimestamp != null) {
return false;
}
} else if (!nakTimestamp.equals(other.nakTimestamp)) {
return false;
}
if (primaryDns == null) {
if (other.primaryDns != null) {
return false;
}
} else if (!primaryDns.equals(other.primaryDns)) {
return false;
}
if (secondaryDns == null) {
if (other.secondaryDns != null) {
return false;
}
} else if (!secondaryDns.equals(other.secondaryDns)) {
return false;
}
if (subnetMask == null) {
if (other.subnetMask != null) {
return false;
}
} else if (!subnetMask.equals(other.subnetMask)) {
return false;
}
return true;
}
@Override
public ClientDhcpDetails clone() {
ClientDhcpDetails ret = (ClientDhcpDetails) super.clone();
@@ -241,8 +124,7 @@ public class ClientDhcpDetails extends BaseJsonModel {
public void mergeDetails(ClientDhcpDetails other) {
if(other == null) return;
if(WiFiSessionUtility.decodeWiFiAssociationId(other.associationId)>WiFiSessionUtility.decodeWiFiAssociationId(associationId)) {
if(WiFiSessionUtility.decodeWiFiAssociationId(Long.parseUnsignedLong(other.associationId))>WiFiSessionUtility.decodeWiFiAssociationId(Long.parseUnsignedLong(associationId))) {
// The other dhcp details are from a newer session and so everything must be reset.
this.dhcpServerIp = null;
this.firstDiscoverTimestamp = null;
@@ -258,8 +140,7 @@ public class ClientDhcpDetails extends BaseJsonModel {
this.associationId = other.associationId;
this.fromInternal = false;
}
else if(other.associationId != associationId) {
// other is older, ignore it
if(!Objects.equals(this.associationId, other.associationId)) {
return;
}
dhcpServerIp = (InetAddress) assignOtherIfOtherNotNull(dhcpServerIp, other.dhcpServerIp);
@@ -305,4 +186,28 @@ public class ClientDhcpDetails extends BaseJsonModel {
this.fromInternal = fromInternal;
}
@Override
public int hashCode() {
return Objects.hash(associationId, dhcpServerIp, firstDiscoverTimestamp, firstOfferTimestamp, firstRequestTimestamp, fromInternal, gatewayIp,
leaseStartTimestamp, leaseTimeInSeconds, nakTimestamp, primaryDns, secondaryDns, subnetMask);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClientDhcpDetails other = (ClientDhcpDetails) obj;
return Objects.equals(associationId, other.associationId) && Objects.equals(dhcpServerIp, other.dhcpServerIp)
&& Objects.equals(firstDiscoverTimestamp, other.firstDiscoverTimestamp) && Objects.equals(firstOfferTimestamp, other.firstOfferTimestamp)
&& Objects.equals(firstRequestTimestamp, other.firstRequestTimestamp) && fromInternal == other.fromInternal
&& Objects.equals(gatewayIp, other.gatewayIp) && Objects.equals(leaseStartTimestamp, other.leaseStartTimestamp)
&& Objects.equals(leaseTimeInSeconds, other.leaseTimeInSeconds) && Objects.equals(nakTimestamp, other.nakTimestamp)
&& Objects.equals(primaryDns, other.primaryDns) && Objects.equals(secondaryDns, other.secondaryDns)
&& Objects.equals(subnetMask, other.subnetMask);
}
}

View File

@@ -8,6 +8,8 @@ import com.telecominfraproject.wlan.core.model.json.interfaces.HasCustomerId;
public class ClientSession extends BaseJsonModel implements HasCustomerId {
private static final String UNKNOWN_OUI = "ffffff";
private static final long serialVersionUID = -7714023056859882994L;
private MacAddress macAddress;
@@ -16,6 +18,7 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
private long locationId;
private ClientSessionDetails details;
private long lastModifiedTimestamp;
private String oui;
public long getEquipmentId() {
return equipmentId;
@@ -47,6 +50,12 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
public void setMacAddress(MacAddress macAddress) {
this.macAddress = macAddress;
if (macAddress != null && macAddress.isGlobalAddress()) {
this.oui = macAddress.toOuiString();
}
else {
this.oui = UNKNOWN_OUI;
}
}
public long getLastModifiedTimestamp() {
@@ -65,6 +74,14 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
this.details = details;
}
public String getOui() {
return oui;
}
public void setOui(String oui) {
this.oui = oui;
}
@Override
public ClientSession clone() {
ClientSession ret = (ClientSession) super.clone();
@@ -79,7 +96,7 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
@Override
public int hashCode() {
return Objects.hash(customerId, details, equipmentId, locationId, lastModifiedTimestamp, macAddress);
return Objects.hash(customerId, details, equipmentId, locationId, lastModifiedTimestamp, macAddress, oui);
}
@Override
@@ -95,7 +112,8 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
&& equipmentId == other.equipmentId
&& locationId == other.locationId
&& lastModifiedTimestamp == other.lastModifiedTimestamp
&& Objects.equals(macAddress, other.macAddress);
&& Objects.equals(macAddress, other.macAddress)
&& Objects.equals(oui, other.oui);
}
@Override

View File

@@ -19,7 +19,7 @@ public class ClientSessionDetails extends BaseJsonModel {
private static final long serialVersionUID = -7714023056859882994L;
private long sessionId;
private String sessionId;
private Long authTimestamp;
private Long assocTimestamp;
private Integer assocInternalSC;
@@ -42,7 +42,6 @@ public class ClientSessionDetails extends BaseJsonModel {
private String cpUsername;
private ClientDhcpDetails dhcpDetails;
private ClientEapDetails eapDetails;
private ClientSessionMetricDetails metricDetails;
private Boolean isReassociation;
private Integer disconnectByApReasonCode;
private Integer disconnectByClientReasonCode;
@@ -54,22 +53,22 @@ public class ClientSessionDetails extends BaseJsonModel {
private Boolean is11VUsed;
private SecurityType securityType;
private SteerType steerType;
private Long previousValidSessionId;
private String previousValidSessionId;
private ClientFailureDetails lastFailureDetails;
private ClientFailureDetails firstFailureDetails;
private Integer associationStatus;
private Integer dynamicVlan;
private Integer assocRssi;
private Long priorSessionId;
private String priorSessionId;
private Long priorEquipmentId;
private String classificationName;
private AssociationState associationState;
public long getSessionId() {
public String getSessionId() {
return sessionId;
}
public void setSessionId(long sessionId) {
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
@@ -154,12 +153,6 @@ public class ClientSessionDetails extends BaseJsonModel {
}
public Long getLastEventTimestamp() {
if (getMetricDetails() != null) {
if (lastEventTimestamp != null) {
return Math.max(getMetricDetails().getLastMetricTimestamp(), lastEventTimestamp);
}
return getMetricDetails().getLastMetricTimestamp();
}
return lastEventTimestamp;
}
@@ -192,13 +185,7 @@ public class ClientSessionDetails extends BaseJsonModel {
}
public Long getLastRxTimestamp() {
if (lastRxTimestamp != null && getMetricDetails() != null && getMetricDetails().getLastRxTimestamp() != null) {
return Math.max(lastRxTimestamp, getMetricDetails().getLastRxTimestamp());
} else if (lastRxTimestamp != null) {
return lastRxTimestamp;
}
return getMetricDetails() == null ? null : getMetricDetails().getLastRxTimestamp();
return lastRxTimestamp;
}
public void setLastRxTimestamp(Long lastRxTimestamp) {
@@ -206,12 +193,7 @@ public class ClientSessionDetails extends BaseJsonModel {
}
public Long getLastTxTimestamp() {
if (lastTxTimestamp != null && getMetricDetails() != null && getMetricDetails().getLastTxTimestamp() != null) {
return Math.max(lastTxTimestamp, getMetricDetails().getLastTxTimestamp());
} else if (lastTxTimestamp != null) {
return lastTxTimestamp;
}
return getMetricDetails() == null ? null : getMetricDetails().getLastTxTimestamp();
return lastTxTimestamp;
}
public void setLastTxTimestamp(Long lastTxTimestamp) {
@@ -257,14 +239,6 @@ public class ClientSessionDetails extends BaseJsonModel {
this.eapDetails = eapDetails;
}
public ClientSessionMetricDetails getMetricDetails() {
return metricDetails;
}
public void setMetricDetails(ClientSessionMetricDetails metricDetails) {
this.metricDetails = metricDetails;
}
/**
* RADIUS 802.1x EAP_Success timestamp
*
@@ -413,11 +387,11 @@ public class ClientSessionDetails extends BaseJsonModel {
this.steerType = steerType;
}
public Long getPreviousValidSessionId() {
public String getPreviousValidSessionId() {
return previousValidSessionId;
}
public void setPreviousValidSessionId(Long previousValidSessionId) {
public void setPreviousValidSessionId(String previousValidSessionId) {
this.previousValidSessionId = previousValidSessionId;
}
@@ -514,9 +488,7 @@ public class ClientSessionDetails extends BaseJsonModel {
return AssociationState.Cloud_Timeout;
}
if (firstDataRcvdTimestamp != null || firstDataSentTimestamp != null
|| (getMetricDetails() != null && (getMetricDetails().getLastRxTimestamp() != null
|| getMetricDetails().getLastTxTimestamp() != null))) {
if (firstDataRcvdTimestamp != null || firstDataSentTimestamp != null) {
return AssociationState.Active_Data;
}
if (assocTimestamp != null) {
@@ -535,9 +507,6 @@ public class ClientSessionDetails extends BaseJsonModel {
if (this.eapDetails != null) {
ret.setEapDetails(this.eapDetails.clone());
}
if (this.metricDetails != null) {
ret.setMetricDetails(this.metricDetails.clone());
}
if (this.lastFailureDetails != null) {
ret.setLastFailureDetails(this.lastFailureDetails.clone());
}
@@ -554,7 +523,7 @@ public class ClientSessionDetails extends BaseJsonModel {
disconnectByApTimestamp, disconnectByClientInternalReasonCode, disconnectByClientReasonCode,
disconnectByClientTimestamp, dynamicVlan, eapDetails, firstDataRcvdTimestamp, firstDataSentTimestamp,
firstFailureDetails, hostname, ipAddress, ipTimestamp, is11KUsed, is11RUsed, is11VUsed, isReassociation,
lastEventTimestamp, lastFailureDetails, lastRxTimestamp, lastTxTimestamp, metricDetails,
lastEventTimestamp, lastFailureDetails, lastRxTimestamp, lastTxTimestamp,
portEnabledTimestamp, previousValidSessionId, priorEquipmentId, priorSessionId, radioType,
radiusUsername, securityType, sessionId, ssid, steerType, timeoutTimestamp, userAgentStr,
associationState);
@@ -594,7 +563,6 @@ public class ClientSessionDetails extends BaseJsonModel {
&& Objects.equals(lastFailureDetails, other.lastFailureDetails)
&& Objects.equals(lastRxTimestamp, other.lastRxTimestamp)
&& Objects.equals(lastTxTimestamp, other.lastTxTimestamp)
&& Objects.equals(metricDetails, other.metricDetails)
&& Objects.equals(portEnabledTimestamp, other.portEnabledTimestamp)
&& Objects.equals(previousValidSessionId, other.previousValidSessionId)
&& Objects.equals(priorEquipmentId, other.priorEquipmentId)
@@ -677,9 +645,6 @@ public class ClientSessionDetails extends BaseJsonModel {
} else if (latest.eapDetails != null) {
this.eapDetails.mergeDetails(latest.eapDetails);
}
if (null != latest.metricDetails) {
this.metricDetails = latest.metricDetails;
}
if (null != latest.getIsReassociation()) {
this.isReassociation = latest.getIsReassociation();
@@ -821,11 +786,11 @@ public class ClientSessionDetails extends BaseJsonModel {
this.assocRssi = assocRssi;
}
public Long getPriorSessionId() {
public String getPriorSessionId() {
return priorSessionId;
}
public void setPriorSessionId(Long priorSessionId) {
public void setPriorSessionId(String priorSessionId) {
this.priorSessionId = priorSessionId;
}

View File

@@ -1,365 +0,0 @@
package com.telecominfraproject.wlan.client.session.models;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
/**
* @author ekeddy
*
*/
public class ClientSessionMetricDetails extends BaseJsonModel
{
private static final long serialVersionUID = -6626815155700131150L;
private static final Logger LOG = LoggerFactory.getLogger(ClientSessionMetricDetails.class);
private Long rxBytes;
private Long txBytes;
private Long totalRxPackets;
private Long totalTxPackets;
private Float rxMbps;
private Float txMbps;
private Integer rssi;
private Integer snr;
private Long rxRateKbps; // from MCS
private Long txRateKbps; // from MCS
private long lastMetricTimestamp;
private Long lastRxTimestamp;
private Long lastTxTimestamp;
private String classification;
/**
* The number of dataframes transmitted TO the client from the AP.
*/
private Integer txDataFrames;
/**
* The number of data frames transmitted TO the client that were retried.
* Note this is not the same as the number of retries.
*/
private Integer txDataFramesRetried;
/**
* The number of dataframes transmitted FROM the client TO the AP.
*/
private Integer rxDataFrames;
public Long getRxBytes() {
return rxBytes;
}
public void setRxBytes(Long rxBytes) {
this.rxBytes = rxBytes;
}
public Long getTxBytes() {
return txBytes;
}
public void setTxBytes(Long txBytes) {
this.txBytes = txBytes;
}
public Long getTotalRxPackets() {
return totalRxPackets;
}
public void setTotalRxPackets(Long totalRxPackets) {
this.totalRxPackets = totalRxPackets;
}
public Long getTotalTxPackets() {
return totalTxPackets;
}
public void setTotalTxPackets(Long totalTxPackets) {
this.totalTxPackets = totalTxPackets;
}
public Float getRxMbps() {
return rxMbps;
}
public void setRxMbps(Float rxMbps) {
this.rxMbps = rxMbps;
}
public Float getTxMbps() {
return txMbps;
}
public void setTxMbps(Float txMbps) {
this.txMbps = txMbps;
}
public Integer getRssi() {
return rssi;
}
public void setRssi(Integer rssi) {
this.rssi = rssi;
}
public Integer getSnr() {
return snr;
}
public void setSnr(Integer snr) {
this.snr = snr;
}
public Long getRxRateKbps() {
return rxRateKbps;
}
public void setRxRateKbps(Long rxRateKbps) {
this.rxRateKbps = rxRateKbps;
}
public Long getTxRateKbps() {
return txRateKbps;
}
public void setTxRateKbps(Long txRateKbps) {
this.txRateKbps = txRateKbps;
}
public Integer getTxDataFrames() {
return txDataFrames;
}
public void setTxDataFrames(Integer txDataFrames) {
this.txDataFrames = txDataFrames;
}
public Integer getTxDataFramesRetried() {
return txDataFramesRetried;
}
public void setTxDataFramesRetried(Integer txDataFramesRetried) {
this.txDataFramesRetried = txDataFramesRetried;
}
public long getLastMetricTimestamp() {
return lastMetricTimestamp;
}
public void setLastMetricTimestamp(long lastMetricTimestamp) {
this.lastMetricTimestamp = lastMetricTimestamp;
}
public Long getLastRxTimestamp() {
return lastRxTimestamp;
}
public void setLastRxTimestamp(Long lastRxTimestamp) {
this.lastRxTimestamp = lastRxTimestamp;
}
public Long getLastTxTimestamp() {
return lastTxTimestamp;
}
public void setLastTxTimestamp(Long lastTxTimestamp) {
this.lastTxTimestamp = lastTxTimestamp;
}
public Integer getRxDataFrames() {
return rxDataFrames;
}
public void setRxDataFrames(Integer rxDataFrames) {
this.rxDataFrames = rxDataFrames;
}
public String getClassification() {
return classification;
}
public void setClassification(String classification) {
this.classification = classification;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((classification == null) ? 0 : classification.hashCode());
result = prime * result + (int) (lastMetricTimestamp ^ (lastMetricTimestamp >>> 32));
result = prime * result + ((lastRxTimestamp == null) ? 0 : lastRxTimestamp.hashCode());
result = prime * result + ((lastTxTimestamp == null) ? 0 : lastTxTimestamp.hashCode());
result = prime * result + ((rssi == null) ? 0 : rssi.hashCode());
result = prime * result + ((rxBytes == null) ? 0 : rxBytes.hashCode());
result = prime * result + ((rxDataFrames == null) ? 0 : rxDataFrames.hashCode());
result = prime * result + ((rxMbps == null) ? 0 : rxMbps.hashCode());
result = prime * result + ((rxRateKbps == null) ? 0 : rxRateKbps.hashCode());
result = prime * result + ((snr == null) ? 0 : snr.hashCode());
result = prime * result + ((totalRxPackets == null) ? 0 : totalRxPackets.hashCode());
result = prime * result + ((totalTxPackets == null) ? 0 : totalTxPackets.hashCode());
result = prime * result + ((txBytes == null) ? 0 : txBytes.hashCode());
result = prime * result + ((txDataFrames == null) ? 0 : txDataFrames.hashCode());
result = prime * result + ((txDataFramesRetried == null) ? 0 : txDataFramesRetried.hashCode());
result = prime * result + ((txMbps == null) ? 0 : txMbps.hashCode());
result = prime * result + ((txRateKbps == null) ? 0 : txRateKbps.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClientSessionMetricDetails other = (ClientSessionMetricDetails) obj;
if (classification == null) {
if (other.classification != null)
return false;
} else if (!classification.equals(other.classification))
return false;
if (lastMetricTimestamp != other.lastMetricTimestamp)
return false;
if (lastRxTimestamp == null) {
if (other.lastRxTimestamp != null)
return false;
} else if (!lastRxTimestamp.equals(other.lastRxTimestamp))
return false;
if (lastTxTimestamp == null) {
if (other.lastTxTimestamp != null)
return false;
} else if (!lastTxTimestamp.equals(other.lastTxTimestamp))
return false;
if (rssi == null) {
if (other.rssi != null)
return false;
} else if (!rssi.equals(other.rssi))
return false;
if (rxBytes == null) {
if (other.rxBytes != null)
return false;
} else if (!rxBytes.equals(other.rxBytes))
return false;
if (rxDataFrames == null) {
if (other.rxDataFrames != null)
return false;
} else if (!rxDataFrames.equals(other.rxDataFrames))
return false;
if (rxMbps == null) {
if (other.rxMbps != null)
return false;
} else if (!rxMbps.equals(other.rxMbps))
return false;
if (rxRateKbps == null) {
if (other.rxRateKbps != null)
return false;
} else if (!rxRateKbps.equals(other.rxRateKbps))
return false;
if (snr == null) {
if (other.snr != null)
return false;
} else if (!snr.equals(other.snr))
return false;
if (totalRxPackets == null) {
if (other.totalRxPackets != null)
return false;
} else if (!totalRxPackets.equals(other.totalRxPackets))
return false;
if (totalTxPackets == null) {
if (other.totalTxPackets != null)
return false;
} else if (!totalTxPackets.equals(other.totalTxPackets))
return false;
if (txBytes == null) {
if (other.txBytes != null)
return false;
} else if (!txBytes.equals(other.txBytes))
return false;
if (txDataFrames == null) {
if (other.txDataFrames != null)
return false;
} else if (!txDataFrames.equals(other.txDataFrames))
return false;
if (txDataFramesRetried == null) {
if (other.txDataFramesRetried != null)
return false;
} else if (!txDataFramesRetried.equals(other.txDataFramesRetried))
return false;
if (txMbps == null) {
if (other.txMbps != null)
return false;
} else if (!txMbps.equals(other.txMbps))
return false;
if (txRateKbps == null) {
if (other.txRateKbps != null)
return false;
} else if (!txRateKbps.equals(other.txRateKbps))
return false;
return true;
}
@Override
public ClientSessionMetricDetails clone() {
ClientSessionMetricDetails ret = (ClientSessionMetricDetails) super.clone();
return ret;
}
public void merge(ClientSessionMetricDetails other) {
boolean isLatestMetric = false;
if(lastMetricTimestamp<other.lastMetricTimestamp) {
this.setLastMetricTimestamp(other.lastMetricTimestamp);
isLatestMetric = true;
}
// These properties just take the latest value
if(isLatestMetric) {
if(other.rssi != null) {
this.rssi = other.rssi;
}
if(other.rxMbps != null) {
this.rxMbps = other.rxMbps;
}
if(other.txMbps != null) {
this.txMbps = other.txMbps;
}
if(other.rxRateKbps != null) {
this.rxRateKbps = other.rxRateKbps;
}
if(other.txRateKbps != null) {
this.txRateKbps = other.txRateKbps;
}
if(other.totalRxPackets != null) {
this.totalRxPackets = other.totalRxPackets;
}
if(other.totalTxPackets != null) {
this.totalTxPackets = other.totalTxPackets;
}
if(other.lastRxTimestamp != null) {
this.lastRxTimestamp = other.lastRxTimestamp;
}
if(other.lastTxTimestamp != null) {
this.lastTxTimestamp = other.lastTxTimestamp;
}
}
if(other.txDataFrames != null) {
// this is a delta
this.setTxDataFrames(sum(this.txDataFrames,other.txDataFrames));
}
if(other.txDataFramesRetried != null) {
// this is a delta
this.setTxDataFramesRetried(sum(this.txDataFramesRetried,other.txDataFramesRetried));
}
if(other.rxDataFrames != null) {
// this is a delta
this.setRxDataFrames(sum(this.rxDataFrames,other.rxDataFrames));
}
if(other.rxBytes != null)
{
// We keep the sum going
LOG.trace("RxBytes: adding {} to {}", this.rxBytes, other.rxBytes);
this.setRxBytes(sum(this.rxBytes, other.rxBytes));
}
if(other.txBytes != null)
{
// We keep the sum going
LOG.trace("TxBytes: adding {} to {}", this.txBytes, other.txBytes);
this.setTxBytes(sum(this.txBytes, other.txBytes));
}
if(other.classification != null)
{
this.classification = other.classification;
}
}
private static Integer sum(Integer v1, Integer v2) {
if(v1 == null) return v2;
if(v2 == null) return v1;
return Integer.sum(v1, v2);
}
private static Long sum(Long v1, Long v2) {
if(v1 == null) return v2;
if(v2 == null) return v1;
return Long.sum(v1, v2);
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -4,10 +4,11 @@ import java.util.List;
import java.util.Set;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
@@ -59,7 +60,15 @@ public interface ClientServiceInterface {
* @param clientMac
* @return deleted Client object
*/
Client delete(int customerId, MacAddress clientMac );
Client delete(int customerId, MacAddress clientMac);
/**
* Deletes Clients that are older than a given timestamp
*
* @param createdBeforeTimestamp
* @return GenericResponse
*/
GenericResponse delete(long createdBeforeTimestamp);
/**
* <br>Retrieves all of the Client records that are mapped to the provided customerId and optional macSubstring filter.
@@ -96,6 +105,14 @@ public interface ClientServiceInterface {
ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac);
/**
* Deletes Client Sessions that older than a given timestamp
*
* @param createdBeforeTimestamp
* @return GenericResponse
*/
GenericResponse deleteSessions(long createdBeforeTimestamp);
/**
* Retrieves a list of Client sessions that which have their mac address in the provided set.
*
@@ -127,4 +144,12 @@ public interface ClientServiceInterface {
*/
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
/**
* Get Client Session counts for the given customerId.
*
* @param customerId
* @return
*/
ClientSessionCounts getSessionCounts(int customerId);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>client-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,16 +3,16 @@ package com.telecominfraproject.wlan.client;
import java.util.List;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.telecominfraproject.wlan.client.controller.ClientController;
import com.telecominfraproject.wlan.client.controller.ClientController.ListOfClientSessions;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
@@ -25,7 +25,6 @@ import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
public class ClientServiceLocal implements ClientServiceInterface {
@Autowired private ClientController clientController;
private static final Logger LOG = LoggerFactory.getLogger(ClientServiceLocal.class);
@Override
public Client create(Client client) {
@@ -57,6 +56,11 @@ public class ClientServiceLocal implements ClientServiceInterface {
public Client delete(int customerId, MacAddress macAddress) {
return clientController.delete(customerId, macAddress);
}
@Override
public GenericResponse delete(long createdBeforeTimestamp) {
return clientController.delete(createdBeforeTimestamp);
}
@Override
public List<Client> getBlockedClients(int customerId) {
@@ -98,5 +102,15 @@ public class ClientServiceLocal implements ClientServiceInterface {
public ClientSession deleteSession(int customerId, long equipmentId, MacAddress macAddress) {
return clientController.deleteSession(customerId, equipmentId, macAddress);
}
@Override
public GenericResponse deleteSessions(long createdBeforeTimestamp) {
return clientController.deleteSessions(createdBeforeTimestamp);
}
@Override
public ClientSessionCounts getSessionCounts(int customerId) {
return clientController.getSessionCounts(customerId);
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>client-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -12,11 +12,13 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.core.client.BaseRemoteClient;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
@@ -182,7 +184,22 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
LOG.debug("completed client.delete {} ", ret);
return ret;
}
}
@Override
public GenericResponse delete(long createdBeforeTimestamp) {
LOG.debug("calling client.delete {}", createdBeforeTimestamp);
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
getBaseUrl()
+"/bulk?createdBeforeTimestamp={createdBeforeTimestamp}",
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
GenericResponse ret = responseEntity.getBody();
LOG.debug("completed client.delete {}", createdBeforeTimestamp);
return ret;
}
//
// Methods for managing client sessions
@@ -304,6 +321,21 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
return ret;
}
@Override
public GenericResponse deleteSessions(long createdBeforeTimestamp) {
LOG.debug("calling client.deleteSessions {}", createdBeforeTimestamp);
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
getBaseUrl()
+"/session/bulk?createdBeforeTimestamp={createdBeforeTimestamp}",
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
GenericResponse ret = responseEntity.getBody();
LOG.debug("completed client.deleteSessions {}", createdBeforeTimestamp);
return ret;
}
@Override
public List<ClientSession> updateSessions(List<ClientSession> clientSessions) {
LOG.debug("calling session.update {} ", clientSessions);
@@ -334,5 +366,21 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
return baseUrl;
}
@Override
public ClientSessionCounts getSessionCounts(int customerId) {
LOG.debug("calling getSessionCounts( {} )", customerId);
try {
ResponseEntity<ClientSessionCounts> responseEntity = restTemplate.exchange(getBaseUrl() + "/session/countsForCustomer?customerId={customerId}",
HttpMethod.GET, null, ClientSessionCounts.class, customerId);
ClientSessionCounts result = responseEntity.getBody();
LOG.debug("getSessionCounts({}) returns {} ", customerId, result);
return result;
} catch (Exception exp) {
LOG.error("getSessionCounts({}) exception ", customerId, exp);
throw exp;
}
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,29 +15,29 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -45,7 +45,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.models.events.ClientAddedEvent;
import com.telecominfraproject.wlan.client.models.events.ClientBlockListChangedEvent;
@@ -26,6 +28,7 @@ import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
@@ -246,6 +249,16 @@ public class ClientController {
return ret;
}
@RequestMapping(value="/bulk", method=RequestMethod.DELETE)
public GenericResponse delete(@RequestParam long createdBeforeTimestamp) {
LOG.debug("Deleting Clients older than: {}", createdBeforeTimestamp);
clientDatastore.delete(createdBeforeTimestamp);
LOG.debug("Deleted Clients");
return new GenericResponse(true, "");
}
//
// Client Session -related methods
@@ -408,8 +421,24 @@ public class ClientController {
return ret;
}
@RequestMapping(value="/session/bulk", method=RequestMethod.DELETE)
public GenericResponse deleteSessions(@RequestParam long createdBeforeTimestamp) {
LOG.debug("Deleting Client session older than {}", createdBeforeTimestamp);
clientDatastore.deleteSessions(createdBeforeTimestamp);
LOG.debug("Deleted old Client sessions");
return new GenericResponse(true, "");
}
@GetMapping("/session/countsForCustomer")
public ClientSessionCounts getSessionCounts(@RequestParam int customerId) {
ClientSessionCounts ret = clientDatastore.getSessionCounts(customerId);
LOG.debug("countsForCustomer({}) {}", customerId, ret);
return ret;
}
private void publishEvent(SystemEvent event) {
if (event == null) {

View File

@@ -147,8 +147,7 @@ components:
type: object
properties:
sessionId:
type: integer
format: int64
type: string
authTimestamp:
type: integer
format: int64
@@ -235,8 +234,7 @@ components:
steerType:
$ref: '#/components/schemas/SteerType'
previousValidSessionId:
type: integer
format: int64
type: string
lastFailureDetails:
$ref: '#/components/schemas/ClientFailureDetails'
firstFailureDetails:
@@ -251,8 +249,7 @@ components:
type: integer
format: int32
priorSessionId:
type: integer
format: int64
type: string
priorEquipmentId:
type: integer
format: int64

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,72 +15,72 @@
<dependency>
<artifactId>base-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,98 +15,97 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,37 +15,37 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-metrics</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -189,7 +189,6 @@
<module>../provisioning-sp</module>
<module>../dashboard-sp</module>
<module>../equipment-alarms-sp</module>
<module>../adoption-metrics-sp</module>
<module>../single-process-streams</module>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,18 +15,18 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>customer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<artifactId>customer-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>customer-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,24 +15,24 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-metrics</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,75 +15,75 @@
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- this is needed so that the stream processors can directly post messages to topics - to aggregate partial results, etc. -->
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- models used by the application logic of the stream processor -->

View File

@@ -1 +0,0 @@
/target/

View File

@@ -1,111 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
<artifactId>equipment-alarms-sp</artifactId>
<name>equipment-alarms-sp</name>
<description>Stream Processors for raising/clearing equipment alarms based on reported metrics.</description>
<dependencies>
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<!-- unit tests dependencies -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -1,187 +0,0 @@
package com.telecominfraproject.wlan.streams.equipmentalarms;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import com.telecominfraproject.wlan.alarm.models.Alarm;
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
/**
* <br>This context keeps track of information needed for raising/clearing the alarms with the following codes:
* <ul>
* <li>AlarmCode.CPUTemperature
* <li>AlarmCode.CPUUtilization
* <li>AlarmCode.MemoryUtilization
* <li>AlarmCode.AccessPointIsUnreachable
* </ul>
*
* @author dtop
*/
public class EquipmentAlarmsContext {
private final int customerId;
private final long equipmentId;
private final Map<AlarmCode, Alarm> existingAlarms = new ConcurrentHashMap<>();
private final long timeBucketMs;
private final int temperatureThresholdInC;
private final int cpuUtilThresholdPct;
private final int memoryUtilThresholdPct;
private final Map<Long, Integer> cpuTempSamples = new ConcurrentHashMap<>();
private final Map<Long, Integer> cpuUtilSamples = new ConcurrentHashMap<>();
private final Map<Long, Integer> memoryUtilSamples = new ConcurrentHashMap<>();
private final Map<Long, Long> metricReceivedTimestamps = new ConcurrentHashMap<>();
private long totalAvailableMemoryKb;
private final long contextCreationTimestampMs = System.currentTimeMillis();
public EquipmentAlarmsContext(int customerId, long equipmentId, List<Alarm> existingAlarmsList, long timeBucketMs, int temperatureThresholdInC, int cpuUtilThresholdPct, int memoryUtilThresholdPct) {
this.customerId = customerId;
this.equipmentId = equipmentId;
existingAlarmsList.forEach(a -> this.existingAlarms.put(a.getAlarmCode(), a));
this.timeBucketMs = timeBucketMs;
this.temperatureThresholdInC = temperatureThresholdInC;
this.cpuUtilThresholdPct = cpuUtilThresholdPct;
this.memoryUtilThresholdPct = memoryUtilThresholdPct;
}
public long getTotalAvailableMemoryKb() {
return totalAvailableMemoryKb;
}
public void setTotalAvailableMemoryKb(long totalAvailableMemoryKb) {
this.totalAvailableMemoryKb = totalAvailableMemoryKb;
}
public int getCustomerId() {
return customerId;
}
public long getEquipmentId() {
return equipmentId;
}
public Map<AlarmCode, Alarm> getExistingAlarms() {
return existingAlarms;
}
public void addDataSamples(long timestamp, ApNodeMetrics model) {
// add new samples
if(model.getApPerformance()!=null ) {
if(model.getApPerformance().getCpuTemperature()!=null) {
cpuTempSamples.put(timestamp, model.getApPerformance().getCpuTemperature());
}
if(model.getApPerformance().getAvgCpuUtilized()!=null) {
cpuUtilSamples.put(timestamp, model.getApPerformance().getAvgCpuUtilized().intValue());
}
if(model.getApPerformance().getFreeMemory()!=null && totalAvailableMemoryKb>0) {
memoryUtilSamples.put(timestamp, 100 - (int) (model.getApPerformance().getFreeMemory() * 100 / totalAvailableMemoryKb));
}
}
//we are using our own timestamp in here in case AP's time is out of sync - we do not want to raise connectivity alarm in that case
Long currentTs = System.currentTimeMillis();
metricReceivedTimestamps.put(currentTs, currentTs);
}
public void removeOldDataSamples() {
// remove samples older than timeBucketMs
long timeThresholdMs = System.currentTimeMillis() - timeBucketMs;
cpuTempSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
cpuUtilSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
memoryUtilSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
metricReceivedTimestamps.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
}
public boolean isAlarmNeedsToBeRaised(AlarmCode alarmCode) {
if(existingAlarms.containsKey(alarmCode) || System.currentTimeMillis() < contextCreationTimestampMs + timeBucketMs) {
//no need to check for thresholds - alarm is either already present, or it is too early to tell because the first time bucket has not been filled yet
return false;
}
boolean ret = false;
AtomicInteger sum = new AtomicInteger();
AtomicInteger count = new AtomicInteger();
//check alarms against thresholds
if(alarmCode.getId() == AlarmCode.AccessPointIsUnreachable.getId()) {
ret = metricReceivedTimestamps.isEmpty();
} else if(alarmCode.getId() == AlarmCode.CPUTemperature.getId()) {
cpuTempSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg >= temperatureThresholdInC ;
}
} else if(alarmCode.getId() == AlarmCode.CPUUtilization.getId()) {
cpuUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg >= cpuUtilThresholdPct ;
}
} else if(alarmCode.getId() == AlarmCode.MemoryUtilization.getId()) {
memoryUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg >= memoryUtilThresholdPct ;
}
}
return ret;
}
public boolean isAlarmNeedsToBeCleared(AlarmCode alarmCode) {
if(!existingAlarms.containsKey(alarmCode) || System.currentTimeMillis() < contextCreationTimestampMs + timeBucketMs) {
//no need to check for thresholds - alarm is either not present, or it is too early to tell because the first time bucket has not been filled yet
return false;
}
boolean ret = false;
AtomicInteger sum = new AtomicInteger();
AtomicInteger count = new AtomicInteger();
//check alarms against thresholds
if(alarmCode.getId() == AlarmCode.AccessPointIsUnreachable.getId()) {
ret = !metricReceivedTimestamps.isEmpty();
} else if(alarmCode.getId() == AlarmCode.CPUTemperature.getId()) {
cpuTempSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg < temperatureThresholdInC ;
} else {
//no new data available, but the alarm exists -> clear the alarm
ret = true;
}
} else if(alarmCode.getId() == AlarmCode.CPUUtilization.getId()) {
cpuUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg < cpuUtilThresholdPct ;
} else {
//no new data available, but the alarm exists -> clear the alarm
ret = true;
}
} else if(alarmCode.getId() == AlarmCode.MemoryUtilization.getId()) {
memoryUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
if(count.get() > 0) {
int avg = sum.get() / count.get();
ret = avg < memoryUtilThresholdPct ;
} else {
//no new data available, but the alarm exists -> clear the alarm
ret = true;
}
}
return ret;
}
}

View File

@@ -1,322 +0,0 @@
package com.telecominfraproject.wlan.streams.equipmentalarms;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
import com.telecominfraproject.wlan.alarm.models.Alarm;
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
import com.telecominfraproject.wlan.alarm.models.AlarmScopeType;
import com.telecominfraproject.wlan.alarm.models.OriginatorType;
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
import com.telecominfraproject.wlan.core.model.streams.QueuedStreamMessage;
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
import com.telecominfraproject.wlan.status.StatusServiceInterface;
import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSystemPerformance;
import com.telecominfraproject.wlan.status.models.Status;
import com.telecominfraproject.wlan.status.models.StatusCode;
import com.telecominfraproject.wlan.status.models.StatusDataType;
import com.telecominfraproject.wlan.stream.StreamProcessor;
/**
* @author dtop
* <br> This stream processor is listening for APNodeMetrics, aggregating them in sliding windows of 5 minutes and raising/clearing alarms based on preconfigured thresholds.
* <br> "AP out of reach" alarm is raised when no APNodeMetrics have been received for the equipment in the last interval, cleared when APNodeMetrics appear again
* <br> "Temperature too high" alarm is raised when average temperature over the last interval goes above the configured threshold of 80C, cleared when average temperature goes below the threshold
* <br> "CPU utilization is too high" alarm is raised when average CPU utilization on AP over the last interval goes above the configured threshold of 80%, cleared when average CPU utilization goes below the threshold
* <br> "Memory utilization is too high" alarm is raised when average RAM utilization on AP over the last interval goes above the configured threshold of 70%, cleared when average RAM utilization goes below the threshold
*
*/
@Component
public class EquipmentAlarmsProcessor extends StreamProcessor {
private static final Logger LOG = LoggerFactory.getLogger(EquipmentAlarmsProcessor.class);
@Value("${tip.wlan.wlanServiceMetricsTopic:wlan_service_metrics}")
private String wlanServiceMetricsTopic;
@Value("${tip.wlan.equipmentAlarmProcessor.timeBucketMs:300000}") //5 minutes aggregation buckets
private long timeBucketMs;
@Value("${tip.wlan.equipmentAlarmProcessor.checkAlarmsIntervalMs:15000}") //check for raising/clearing alarms every 15 seconds
private long checkAlarmsIntervalMs;
@Value("${tip.wlan.equipmentAlarmProcessor.temperatureThresholdInC:80}")
private int temperatureThresholdInC;
@Value("${tip.wlan.equipmentAlarmProcessor.cpuUtilThresholdPct:80}")
private int cpuUtilThresholdPct;
@Value("${tip.wlan.equipmentAlarmProcessor.memoryUtilThresholdPct:70}")
private int memoryUtilThresholdPct;
private final ConcurrentHashMap<Long, EquipmentAlarmsContext> contextPerEquipmentIdMap = new ConcurrentHashMap<>();
private final Set<AlarmCode> alarmCodeSet = new HashSet<>();
@Autowired
private AlarmServiceInterface alarmServiceInterface;
@Autowired
private StatusServiceInterface statusServiceInterface;
@Autowired
private EquipmentServiceInterface equipmentServiceInterface;
@Override
protected boolean acceptMessage(QueuedStreamMessage message) {
boolean ret = message.getTopic().equals(wlanServiceMetricsTopic);
if(ret && ( message.getModel() instanceof ServiceMetric) ) {
ServiceMetric sm = (ServiceMetric) message.getModel();
ret = ret &&
(
sm.getDetails() instanceof ApNodeMetrics
);
} else {
ret = false;
}
LOG.trace("acceptMessage {}", ret);
return ret;
}
@Override
protected void processMessage(QueuedStreamMessage message) {
ServiceMetric mdl = (ServiceMetric) message.getModel();
ServiceMetricDetails smd = mdl.getDetails();
LOG.debug("Processing {}", mdl);
switch ( smd.getClass().getSimpleName() ) {
case "ApNodeMetrics":
process(mdl.getCustomerId(), mdl.getCreatedTimestamp(), mdl.getEquipmentId(), (ApNodeMetrics) smd);
break;
default:
process(mdl);
}
}
private void process(int customerId, long timestamp, long equipmentId, ApNodeMetrics model) {
LOG.debug("Processing ApNodeMetrics");
//get context for the equipmentId
EquipmentAlarmsContext context = contextPerEquipmentIdMap.get(equipmentId);
if(context == null) {
//When creating EquipmentAlarmsContext - read currently raised alarms of the types we're interested, keep it in memory.
//Only this SP is responsible for raising/clearing those alarms for this particular equipment
List<Alarm> existingAlarms = alarmServiceInterface.get(customerId, Collections.singleton(equipmentId), alarmCodeSet);
//All alarms that are handled by this stream processor logically exist only once-per-alarmCode-per-equipment.
//Ensure that there is only one alarm per alarmCode per equipment (the latest one), remove all others.
//This is needed to recover from some corner-case scenarios that can happen with the distributed datastores (for example split-brain).
existingAlarms = cleanUpDuplicateAlarms(existingAlarms);
context = new EquipmentAlarmsContext(customerId, equipmentId, existingAlarms, timeBucketMs, temperatureThresholdInC, cpuUtilThresholdPct, memoryUtilThresholdPct);
context = contextPerEquipmentIdMap.putIfAbsent(equipmentId, context);
if(context == null) {
context = contextPerEquipmentIdMap.get(equipmentId);
}
}
//find out TotalAvailableMemory in kb, which is available as part of the OperatingSystemPerformance status object
//we look for it separately because this status may not be populated when the first service_metrics_collection_config are coming in
if(context.getTotalAvailableMemoryKb()==0L) {
Status osPerformanceStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.OS_PERFORMANCE);
if(osPerformanceStatus!=null) {
OperatingSystemPerformance osPerformance = (OperatingSystemPerformance) osPerformanceStatus.getDetails();
if(osPerformance !=null && osPerformance.getTotalAvailableMemoryKb() > 0) {
context.setTotalAvailableMemoryKb(osPerformance.getTotalAvailableMemoryKb());
}
}
}
// Update counters on the context
context.addDataSamples(timestamp, model);
LOG.debug("Processed {}", model);
}
private List<Alarm> cleanUpDuplicateAlarms(List<Alarm> existingAlarms) {
Map<AlarmCode, Alarm> alarmsToKeep= new HashMap<>();
//find out the latest existing alarms for each alarmCode
existingAlarms.forEach(a -> {
Alarm eA = alarmsToKeep.get(a.getAlarmCode());
if(eA == null) {
eA = a;
alarmsToKeep.put(a.getAlarmCode(), a);
}
if(eA.getCreatedTimestamp() < a.getCreatedTimestamp() ) {
alarmsToKeep.put(a.getAlarmCode(), a);
}
});
List<Alarm> alarmsToRemove = new ArrayList<>(existingAlarms);
alarmsToRemove.removeAll(alarmsToKeep.values());
alarmsToRemove.forEach(a -> {
try {
alarmServiceInterface.delete(a.getCustomerId(), a.getEquipmentId(), a.getAlarmCode(), a.getCreatedTimestamp());
} catch(Exception e) {
LOG.debug("Alarm was already deleted: {}", a);
}
});
return new ArrayList<>(alarmsToKeep.values());
}
private void process(BaseJsonModel model) {
LOG.warn("Unprocessed model: {}", model);
}
@PostConstruct
private void postCreate() {
Thread equipmentAlarmsThread = new Thread( new Runnable() {
@Override
public void run() {
LOG.info("Starting equipmentAlarmsThread");
while(true) {
LOG.trace("Checking if alarms need to be raised");
//take a snapshot of existing contexts for this iteration of alarm checks
List<EquipmentAlarmsContext> contexts = new ArrayList<>(contextPerEquipmentIdMap.values());
HashSet<Long> equipmentIdsFromContexts = new HashSet<>();
contexts.forEach(ctx -> equipmentIdsFromContexts.add(ctx.getEquipmentId()));
//get a list of equipment records for the current contexts
HashSet<Long> existingEquipmentIds = new HashSet<>();
try {
List<Equipment> existingEquipment = equipmentServiceInterface.get(equipmentIdsFromContexts);
existingEquipment.forEach(e -> existingEquipmentIds.add(e.getId()));
} catch(Exception e) {
LOG.error("Error when retrieving existing equipment", e);
sleep(checkAlarmsIntervalMs);
continue;
}
for(EquipmentAlarmsContext context : contexts ) {
if(!existingEquipmentIds.contains(context.getEquipmentId())) {
//equipment was removed, let's delete the context and remove all existing alarms for that equipmentId
try {
contextPerEquipmentIdMap.remove(context.getEquipmentId());
alarmServiceInterface.delete(context.getCustomerId(), context.getEquipmentId());
} catch(Exception e) {
LOG.error("Error when removing stale alarms for deleted equipment", e);
}
//nothing else to do for this context
continue;
}
context.removeOldDataSamples();
alarmCodeSet.forEach(alarmCode -> {
try {
//check alarms against thresholds
//if alarm needs to be raised - check if it is currently present, and if not - raise it, and add it to the context
if(context.isAlarmNeedsToBeRaised(alarmCode)) {
Alarm alarm = new Alarm();
alarm.setCustomerId(context.getCustomerId());
alarm.setEquipmentId(context.getEquipmentId());
alarm.setAlarmCode(alarmCode);
alarm.setOriginatorType(OriginatorType.AP);
alarm.setSeverity(alarmCode.getSeverity());
alarm.setScopeType(AlarmScopeType.EQUIPMENT);
alarm.setScopeId("" + context.getEquipmentId());
AlarmDetails alarmDetails = new AlarmDetails();
alarmDetails.setMessage(alarmCode.getDescription());
alarmDetails.setAffectedEquipmentIds(Collections.singletonList(context.getEquipmentId()));
alarm.setDetails(alarmDetails);
alarm = alarmServiceInterface.create(alarm);
context.getExistingAlarms().put(alarmCode, alarm);
}
if(context.isAlarmNeedsToBeCleared(alarmCode)) {
//if alarm needs to be cleared - check if it is currently present, and if it is - clear it, and remove it from the context
Alarm alarm = context.getExistingAlarms().remove(alarmCode);
if(alarm!=null) {
//All alarms that are handled by this stream processor logically exist only once-per-alarmCode-per-equipment.
//In order to self-heal from the corner cases with the datastore where more than one alarm with the same alarmCode
// is raised per equipment (for example when the datastore experienced a split-brain scenario), we would remove
// all alarms with the specified alarmCode for this equipment.
//Most of the time the existingAlarms list below would contain only one alarm.
//
List<Alarm> existingAlarms = alarmServiceInterface.get(alarm.getCustomerId(), Collections.singleton(alarm.getEquipmentId()), Collections.singleton(alarmCode));
existingAlarms.forEach(a -> {
try {
alarmServiceInterface.delete(a.getCustomerId(), a.getEquipmentId(), a.getAlarmCode(), a.getCreatedTimestamp());
} catch(Exception e) {
LOG.debug("Alarm was already deleted: {}", alarm);
}
});
}
}
} catch(Exception e) {
LOG.error("Error when processing context for customer {}", context.getCustomerId(), e);
}
});
}
LOG.trace("Done alarms check");
sleep(checkAlarmsIntervalMs);
}
}
}, "equipmentAlarmsThread");
equipmentAlarmsThread.setDaemon(true);
equipmentAlarmsThread.start();
//populate alarm codes this SP is responsible for
alarmCodeSet.add(AlarmCode.CPUTemperature);
alarmCodeSet.add(AlarmCode.CPUUtilization);
alarmCodeSet.add(AlarmCode.MemoryUtilization);
alarmCodeSet.add(AlarmCode.AccessPointIsUnreachable);
}
private static void sleep(long ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1,342 +0,0 @@
package com.telecominfraproject.wlan.streams.equipmentalarms;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringRunner;
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
import com.telecominfraproject.wlan.alarm.AlarmServiceLocal;
import com.telecominfraproject.wlan.alarm.controller.AlarmController;
import com.telecominfraproject.wlan.alarm.datastore.inmemory.AlarmDatastoreInMemory;
import com.telecominfraproject.wlan.alarm.models.Alarm;
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
import com.telecominfraproject.wlan.equipment.controller.EquipmentController;
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApPerformance;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
import com.telecominfraproject.wlan.status.StatusServiceLocal;
import com.telecominfraproject.wlan.status.controller.StatusController;
import com.telecominfraproject.wlan.status.datastore.inmemory.StatusDatastoreInMemory;
import com.telecominfraproject.wlan.stream.StreamInterface;
import com.telecominfraproject.wlan.stream.StreamMessageDispatcher;
import com.telecominfraproject.wlan.streams.simple.SimpleStreamsConfig;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.NONE, classes = EquipmentAlarmsProcessor.class)
@Import(value = { EquipmentAlarmsProcessor.class, SimpleStreamsConfig.class, StreamMessageDispatcher.class,
AlarmServiceLocal.class, AlarmController.class, AlarmDatastoreInMemory.class,
StatusServiceLocal.class, StatusController.class, StatusDatastoreInMemory.class,
EquipmentServiceLocal.class, EquipmentController.class, EquipmentDatastoreInMemory.class,
CloudEventDispatcherEmpty.class,
//EquipmentAlarmsProcessorTests.Config.class,
})
@Ignore("make these tests more robust, there are intermittent failures")
/*
expected: <0> but was: <1>
org.opentest4j.AssertionFailedError: expected: <0> but was: <1>
at com.telecominfraproject.wlan.streams.equipmentalarms.EquipmentAlarmsProcessorTests.testAccessPointIsUnreachableAlarm(EquipmentAlarmsProcessorTests.java:313)
*/
public class EquipmentAlarmsProcessorTests {
private static final long testTimeBucketMs = 200;
private static final long testCheckAlarmsIntervalMs = 50;
static {
System.setProperty("tip.wlan.equipmentAlarmProcessor.checkAlarmsIntervalMs", "" + testCheckAlarmsIntervalMs);
System.setProperty("tip.wlan.equipmentAlarmProcessor.timeBucketMs", "" + testTimeBucketMs);
}
@Autowired @Qualifier("metricStreamInterface")
StreamInterface<ServiceMetric> metricStreamInterface;
@Autowired
EquipmentAlarmsProcessor equipmentAlarmsProcessor;
@Autowired
AlarmServiceInterface alarmService;
@Autowired
EquipmentServiceInterface equipmentService;
protected static final AtomicLong testSequence = new AtomicLong(1);
@Configuration
public static class Config {
//Another way of configuring dependencies (instead of mentioning them in the pom.xml with the test scope) :
// @Bean
// AlarmServiceInterface getAlarmServiceInterface() {
// return new AlarmServiceInterface() {
// ...
// };
// }
// @Bean
// StatusServiceInterface getStatusServiceInterface() {
// return new StatusServiceInterface() {
// ...
// };
// }
}
@Test
public void testCPUTemperatureAlarm() {
int customerId = getNextCustomerId();
Equipment equipment = new Equipment();
equipment.setCustomerId(customerId);
equipment.setEquipmentType(EquipmentType.AP);
equipment.setInventoryId("testCPUTemperatureAlarm");
equipment.setName(equipment.getInventoryId());
equipment = equipmentService.create(equipment);
long equipmentId = equipment.getId();
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
record.setDetails(apNodeMetrics);
ApPerformance apPerformance = new ApPerformance();
apNodeMetrics.setApPerformance(apPerformance);
//we will force the CPUTemperature alarm to be raised
apPerformance.setCpuTemperature(85);
apPerformance.setCpuUtilized(new int[] { 70, 70 });
apPerformance.setFreeMemory(30000000);
//publish metric that should trigger alarm for the CPU Temperature
metricStreamInterface.publish(record );
//wait for the metric to be processed
sleep(2 * testTimeBucketMs);
//verify that alarm was raised
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
assertEquals(1, alarms.size());
//Now create a metric that should clear the alarm
ServiceMetric recordToClearAlarm = record.clone();
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + 2* testTimeBucketMs );
((ApNodeMetrics)recordToClearAlarm.getDetails()).getApPerformance().setCpuTemperature(70);
//publish metric that should clear the alarm for the CPU Temperature
metricStreamInterface.publish(recordToClearAlarm);
//wait for the metric to be processed
sleep(2 * testTimeBucketMs);
//verify that alarm was cleared
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
assertEquals(0, alarms.size());
}
@Test
public void testCPUTemperatureAlarm_NoEquipment() {
int customerId = getNextCustomerId();
long equipmentId = -5;
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
record.setDetails(apNodeMetrics);
ApPerformance apPerformance = new ApPerformance();
apNodeMetrics.setApPerformance(apPerformance);
//we will force the CPUTemperature alarm to be raised
apPerformance.setCpuTemperature(85);
apPerformance.setCpuUtilized(new int[] { 70, 70 });
apPerformance.setFreeMemory(30000000);
//publish metric that should trigger alarm for the CPU Temperature
metricStreamInterface.publish(record );
//wait for the metric to be processed
sleep(2 * testTimeBucketMs);
//verify that alarm was not raised - because equipment for that alarm does not exist
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
assertEquals(0, alarms.size());
}
@Test
public void testCPUUtilizationAlarm() {
int customerId = getNextCustomerId();
Equipment equipment = new Equipment();
equipment.setCustomerId(customerId);
equipment.setEquipmentType(EquipmentType.AP);
equipment.setInventoryId("testCPUUtilizationAlarm");
equipment.setName(equipment.getInventoryId());
equipment = equipmentService.create(equipment);
long equipmentId = equipment.getId();
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
record.setDetails(apNodeMetrics);
ApPerformance apPerformance = new ApPerformance();
apNodeMetrics.setApPerformance(apPerformance);
apPerformance.setCpuTemperature(55);
//we will force the CPUUtilization alarm to be raised
apPerformance.setCpuUtilized(new int[] { 90, 90 });
apPerformance.setFreeMemory(30000000);
//publish metric that should trigger alarm for the CPU Utilization
metricStreamInterface.publish(record );
//wait for the metric to be processed
sleep(2 * testTimeBucketMs);
//verify that alarm was raised
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUUtilization));
assertEquals(1, alarms.size());
//Now create a metric that should clear the alarm
ServiceMetric recordToClearAlarm = record.clone();
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + 2* testTimeBucketMs );
((ApNodeMetrics)recordToClearAlarm.getDetails()).getApPerformance().setCpuUtilized(new int[] { 50, 50 });
//publish metric that should clear the alarm for the CPU Utilization
metricStreamInterface.publish(recordToClearAlarm);
//wait for the metric to be processed
sleep(2 * testTimeBucketMs);
//verify that alarm was cleared
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUUtilization));
assertEquals(0, alarms.size());
}
@Test
public void testAccessPointIsUnreachableAlarm() {
int customerId = getNextCustomerId();
Equipment equipment = new Equipment();
equipment.setCustomerId(customerId);
equipment.setEquipmentType(EquipmentType.AP);
equipment.setInventoryId("testAccessPointIsUnreachableAlarm");
equipment.setName(equipment.getInventoryId());
equipment = equipmentService.create(equipment);
long equipmentId = equipment.getId();
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
record.setCreatedTimestamp(System.currentTimeMillis() + testTimeBucketMs);
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
record.setDetails(apNodeMetrics);
ApPerformance apPerformance = new ApPerformance();
apNodeMetrics.setApPerformance(apPerformance);
apPerformance.setCpuTemperature(55);
//we will force the CPUUtilization alarm to be raised
apPerformance.setCpuUtilized(new int[] { 50, 50 });
apPerformance.setFreeMemory(30000000);
//publish metric that should not trigger AccessPointIsUnreachable alarm
metricStreamInterface.publish(record );
//wait for the metric to be processed
sleep(testTimeBucketMs);
//verify that alarm was not raised
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
assertEquals(0, alarms.size());
//Now wait for the alarm to be raised because no service_metrics_collection_config were posted
sleep(testTimeBucketMs);
//verify that alarm was raised
for(int i = 0; i < 50; i++) {
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
if(!alarms.isEmpty()) {
break;
}else {
sleep(5);
}
}
assertEquals(1, alarms.size());
//Now create a metric that should clear the alarm
ServiceMetric recordToClearAlarm = record.clone();
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + testTimeBucketMs );
//publish metric that should clear the AccessPointIsUnreachable alarm
metricStreamInterface.publish(recordToClearAlarm);
//wait for the metric to be processed
sleep(testTimeBucketMs);
//verify that alarm was cleared
for(int i = 0; i < 50; i++) {
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
if(alarms.isEmpty()) {
break;
}else {
sleep(5);
}
}
assertEquals(0, alarms.size());
}
public int getNextCustomerId() {
return (int) testSequence.incrementAndGet();
}
public long getNextEquipmentId() {
return testSequence.incrementAndGet();
}
public void sleep(long ms) {
try {
Thread.sleep( ms );
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}

View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<conversionRule conversionWord="filteredStack"
converterClass="com.telecominfraproject.wlan.server.exceptions.logback.ExceptionCompressingConverter" />
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n%filteredStack%nopex</pattern>
<!-- See http://logback.qos.ch/manual/layouts.html for details -->
<!-- %ex{5} - add at the end to display only 5 levels of the exception stack trace -->
<!-- %nopex - add at the end to not display any of the exception stack traces -->
<!-- %ex{full} - add at the end to display all the levels of the exception stack trace -->
</encoder>
</appender>
<!--
details: http://logback.qos.ch/manual/configuration.html#auto_configuration
runtime configuration, if need to override the defaults:
-Dlogging.config=file:///home/ec2-user/opensync/logback.xml
for log configuration debugging - use
-Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener
log levels:
OFF ERROR WARN INFO DEBUG TRACE
-->
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="INFO"/>
<logger name="org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer" level="INFO"/>
<logger name="org.springframework.security.web.authentication.preauth" level="OFF"/>
<logger name="com.netflix.servo.tag.aws.AwsInjectableTag" level="OFF"/>
<logger name="com.telecominfraproject" level="WARN"/>
<!--
<logger name="com.telecominfraproject.wlan.streams.simple" level="TRACE"/>
<logger name="com.telecominfraproject.wlan.streams.equipmentalarms" level="TRACE"/>
-->
<root level="WARN">
<appender-ref ref="stdout"/>
</root>
</configuration>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-interface</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-common-test</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

Some files were not shown because too many files have changed in this diff Show More