mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-21 08:39:24 +00:00
Compare commits
18 Commits
change_ses
...
NETEXP-267
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daabf38510 | ||
|
|
91877f5305 | ||
|
|
11314e3395 | ||
|
|
fa6795369c | ||
|
|
e6e06d7b70 | ||
|
|
1e15e3cd94 | ||
|
|
02e03780db | ||
|
|
aac34150b2 | ||
|
|
3085c34cde | ||
|
|
35fd038113 | ||
|
|
7c387f1940 | ||
|
|
abb9b59659 | ||
|
|
7f0497754c | ||
|
|
82095510f7 | ||
|
|
0afd414870 | ||
|
|
41add1922b | ||
|
|
90ac57b988 | ||
|
|
0cc90764c6 |
@@ -259,7 +259,7 @@ public class AlarmServiceRemote extends BaseRemoteClient implements AlarmService
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
ResponseEntity<List<Alarm>> responseEntity =
|
ResponseEntity<List<Alarm>> responseEntity =
|
||||||
restTemplate.exchange(getBaseUrl() + "/forAlarmCode?alarmCodeSet={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}",
|
restTemplate.exchange(getBaseUrl() + "/forAlarmCode?alarmCode={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}",
|
||||||
HttpMethod.GET, null, Alarm_LIST_CLASS_TOKEN, alarmCodeSetStr, createdAfterTimestamp);
|
HttpMethod.GET, null, Alarm_LIST_CLASS_TOKEN, alarmCodeSetStr, createdAfterTimestamp);
|
||||||
|
|
||||||
List<Alarm> result = responseEntity.getBody();
|
List<Alarm> result = responseEntity.getBody();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class ClientSessionDetails extends BaseJsonModel {
|
|||||||
private Boolean is11VUsed;
|
private Boolean is11VUsed;
|
||||||
private SecurityType securityType;
|
private SecurityType securityType;
|
||||||
private SteerType steerType;
|
private SteerType steerType;
|
||||||
private Long previousValidSessionId;
|
private String previousValidSessionId;
|
||||||
private ClientFailureDetails lastFailureDetails;
|
private ClientFailureDetails lastFailureDetails;
|
||||||
private ClientFailureDetails firstFailureDetails;
|
private ClientFailureDetails firstFailureDetails;
|
||||||
private Integer associationStatus;
|
private Integer associationStatus;
|
||||||
@@ -413,11 +413,11 @@ public class ClientSessionDetails extends BaseJsonModel {
|
|||||||
this.steerType = steerType;
|
this.steerType = steerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getPreviousValidSessionId() {
|
public String getPreviousValidSessionId() {
|
||||||
return previousValidSessionId;
|
return previousValidSessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPreviousValidSessionId(Long previousValidSessionId) {
|
public void setPreviousValidSessionId(String previousValidSessionId) {
|
||||||
this.previousValidSessionId = previousValidSessionId;
|
this.previousValidSessionId = previousValidSessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -234,8 +234,7 @@ components:
|
|||||||
steerType:
|
steerType:
|
||||||
$ref: '#/components/schemas/SteerType'
|
$ref: '#/components/schemas/SteerType'
|
||||||
previousValidSessionId:
|
previousValidSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
lastFailureDetails:
|
lastFailureDetails:
|
||||||
$ref: '#/components/schemas/ClientFailureDetails'
|
$ref: '#/components/schemas/ClientFailureDetails'
|
||||||
firstFailureDetails:
|
firstFailureDetails:
|
||||||
@@ -250,8 +249,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
priorSessionId:
|
priorSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
priorEquipmentId:
|
priorEquipmentId:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
payload:
|
payload:
|
||||||
$ref: '#/components/schemas/PortalUser'
|
$ref: '#/components/schemas/PortalUserEventPayload'
|
||||||
|
|
||||||
PortalUserChangedEvent:
|
PortalUserChangedEvent:
|
||||||
properties:
|
properties:
|
||||||
@@ -566,7 +566,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
payload:
|
payload:
|
||||||
$ref: '#/components/schemas/PortalUser'
|
$ref: '#/components/schemas/PortalUserEventPayload'
|
||||||
|
|
||||||
PortalUserRemovedEvent:
|
PortalUserRemovedEvent:
|
||||||
properties:
|
properties:
|
||||||
@@ -577,7 +577,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
payload:
|
payload:
|
||||||
$ref: '#/components/schemas/PortalUser'
|
$ref: '#/components/schemas/PortalUserEventPayload'
|
||||||
|
|
||||||
ProfileAddedEvent:
|
ProfileAddedEvent:
|
||||||
properties:
|
properties:
|
||||||
@@ -1132,8 +1132,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -1151,8 +1150,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -1627,8 +1625,7 @@ components:
|
|||||||
steerType:
|
steerType:
|
||||||
$ref: '#/components/schemas/SteerType'
|
$ref: '#/components/schemas/SteerType'
|
||||||
previousValidSessionId:
|
previousValidSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
lastFailureDetails:
|
lastFailureDetails:
|
||||||
$ref: '#/components/schemas/ClientFailureDetails'
|
$ref: '#/components/schemas/ClientFailureDetails'
|
||||||
firstFailureDetails:
|
firstFailureDetails:
|
||||||
@@ -1643,8 +1640,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
priorSessionId:
|
priorSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
priorEquipmentId:
|
priorEquipmentId:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
@@ -2386,7 +2382,7 @@ components:
|
|||||||
# Portal User data models
|
# Portal User data models
|
||||||
#
|
#
|
||||||
|
|
||||||
PortalUser:
|
PortalUserEventPayload:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@@ -2397,10 +2393,6 @@ components:
|
|||||||
format: int32
|
format: int32
|
||||||
username:
|
username:
|
||||||
type: string
|
type: string
|
||||||
password:
|
|
||||||
type: string
|
|
||||||
role:
|
|
||||||
$ref: '#/components/schemas/PortalUserRole'
|
|
||||||
createdTimestamp:
|
createdTimestamp:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
@@ -2411,8 +2403,6 @@ components:
|
|||||||
example:
|
example:
|
||||||
customerId: 2
|
customerId: 2
|
||||||
username: new_user
|
username: new_user
|
||||||
password: pwd
|
|
||||||
role: CustomerIT
|
|
||||||
|
|
||||||
PortalUserRole:
|
PortalUserRole:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -60,11 +60,6 @@ public enum CEGWCommandType {
|
|||||||
|
|
||||||
ClientBlocklistChangeNotification,
|
ClientBlocklistChangeNotification,
|
||||||
|
|
||||||
/**
|
|
||||||
* Most recent timestamp for receipt of stats data from this AP.
|
|
||||||
*/
|
|
||||||
MostRecentStatsTimestamp,
|
|
||||||
|
|
||||||
UNSUPPORTED;
|
UNSUPPORTED;
|
||||||
|
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
|
|||||||
@@ -118,33 +118,40 @@ public class EquipmentRrmBulkUpdateItem extends BaseJsonModel {
|
|||||||
finalDetails.getRadioMap().put(rt, erc);
|
finalDetails.getRadioMap().put(rt, erc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(erc.getManualChannelNumber()== null || erc.getManualChannelNumber().intValue() != updateDetails.getChannelNumber()) {
|
if(erc.getManualChannelNumber() == null
|
||||||
|
|| erc.getManualChannelNumber().intValue() != updateDetails.getChannelNumber()) {
|
||||||
erc.setManualChannelNumber(updateDetails.getChannelNumber());
|
erc.setManualChannelNumber(updateDetails.getChannelNumber());
|
||||||
modelChanged.set(true);
|
modelChanged.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(erc.getManualBackupChannelNumber()== null ||
|
if(erc.getManualBackupChannelNumber() == null
|
||||||
erc.getManualBackupChannelNumber().intValue() != updateDetails.getBackupChannelNumber()) {
|
|| erc.getManualBackupChannelNumber().intValue() != updateDetails.getBackupChannelNumber()) {
|
||||||
erc.setManualBackupChannelNumber(updateDetails.getBackupChannelNumber());
|
erc.setManualBackupChannelNumber(updateDetails.getBackupChannelNumber());
|
||||||
modelChanged.set(true);
|
modelChanged.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((erc.getClientDisconnectThresholdDb() == null && updateDetails.getClientDisconnectThresholdDb() != null)
|
if (updateDetails.getClientDisconnectThresholdDb() != null) {
|
||||||
|| !erc.getClientDisconnectThresholdDb().equals(updateDetails.getClientDisconnectThresholdDb())) {
|
if ((erc.getClientDisconnectThresholdDb() == null && updateDetails.getClientDisconnectThresholdDb() != null)
|
||||||
erc.setClientDisconnectThresholdDb(updateDetails.getClientDisconnectThresholdDb());
|
|| !erc.getClientDisconnectThresholdDb().equals(updateDetails.getClientDisconnectThresholdDb())) {
|
||||||
modelChanged.set(true);
|
erc.setClientDisconnectThresholdDb(updateDetails.getClientDisconnectThresholdDb());
|
||||||
|
modelChanged.set(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((erc.getProbeResponseThresholdDb() == null && updateDetails.getProbeResponseThresholdDb() != null)
|
if (updateDetails.getProbeResponseThresholdDb() != null) {
|
||||||
|| !erc.getProbeResponseThresholdDb().equals(updateDetails.getProbeResponseThresholdDb())) {
|
if ((erc.getProbeResponseThresholdDb() == null && updateDetails.getProbeResponseThresholdDb() != null)
|
||||||
erc.setProbeResponseThresholdDb(updateDetails.getProbeResponseThresholdDb());
|
|| !erc.getProbeResponseThresholdDb().equals(updateDetails.getProbeResponseThresholdDb())) {
|
||||||
modelChanged.set(true);
|
erc.setProbeResponseThresholdDb(updateDetails.getProbeResponseThresholdDb());
|
||||||
|
modelChanged.set(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((erc.getRxCellSizeDb() == null && updateDetails.getRxCellSizeDb() != null)
|
if (updateDetails.getRxCellSizeDb() != null) {
|
||||||
|| !erc.getRxCellSizeDb().equals(updateDetails.getRxCellSizeDb())) {
|
if ((erc.getRxCellSizeDb() == null && updateDetails.getRxCellSizeDb() != null)
|
||||||
erc.setRxCellSizeDb(updateDetails.getRxCellSizeDb());
|
|| !erc.getRxCellSizeDb().equals(updateDetails.getRxCellSizeDb())) {
|
||||||
modelChanged.set(true);
|
erc.setRxCellSizeDb(updateDetails.getRxCellSizeDb());
|
||||||
|
modelChanged.set(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -280,14 +280,15 @@ public class EquipmentController {
|
|||||||
LOG.debug("Updated Equipment {}", ret);
|
LOG.debug("Updated Equipment {}", ret);
|
||||||
|
|
||||||
EquipmentChangedEvent event;
|
EquipmentChangedEvent event;
|
||||||
if ((equipment.getProfileId() != existingEquipment.getProfileId()) || (existingApElementConfig != null && updatedApElementConfig != null &&
|
if (ret.getCustomerId() != existingEquipment.getCustomerId()) {
|
||||||
|
publishEvent(new EquipmentCustomerChangedEvent(existingEquipment, ret));
|
||||||
|
}
|
||||||
|
if ((ret.getProfileId() != existingEquipment.getProfileId()) || (existingApElementConfig != null && updatedApElementConfig != null &&
|
||||||
updatedApElementConfig.needsToBeUpdatedOnDevice(existingApElementConfig))) {
|
updatedApElementConfig.needsToBeUpdatedOnDevice(existingApElementConfig))) {
|
||||||
event = new EquipmentApImpactingChangedEvent(ret);
|
event = new EquipmentApImpactingChangedEvent(ret);
|
||||||
} else if (existingApElementConfig != null && existingApElementConfig.isBlinkAllLEDs() != updatedApElementConfig.isBlinkAllLEDs()) {
|
} else if (existingApElementConfig != null && existingApElementConfig.isBlinkAllLEDs() != updatedApElementConfig.isBlinkAllLEDs()) {
|
||||||
LOG.debug("Updated BlinkingLEDs {}", ret);
|
LOG.debug("Updated BlinkingLEDs {}", ret);
|
||||||
event = new EquipmentBlinkLEDsEvent(ret);
|
event = new EquipmentBlinkLEDsEvent(ret);
|
||||||
} else if (equipment.getCustomerId() != existingEquipment.getCustomerId()) {
|
|
||||||
event = new EquipmentCustomerChangedEvent(existingEquipment, ret);
|
|
||||||
} else {
|
} else {
|
||||||
event = new EquipmentChangedEvent(ret);
|
event = new EquipmentChangedEvent(ret);
|
||||||
}
|
}
|
||||||
@@ -296,7 +297,6 @@ public class EquipmentController {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void validateChannelNum(Equipment equipment) {
|
private void validateChannelNum(Equipment equipment) {
|
||||||
if (equipment.getDetails() instanceof ApElementConfiguration) {
|
if (equipment.getDetails() instanceof ApElementConfiguration) {
|
||||||
ApElementConfiguration apElementConfiguration = (ApElementConfiguration) equipment.getDetails();
|
ApElementConfiguration apElementConfiguration = (ApElementConfiguration) equipment.getDetails();
|
||||||
|
|||||||
@@ -16,12 +16,9 @@ import com.telecominfraproject.wlan.equipment.models.Equipment;
|
|||||||
import com.telecominfraproject.wlan.equipment.models.RadioChannelChangeSettings;
|
import com.telecominfraproject.wlan.equipment.models.RadioChannelChangeSettings;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBlinkRequest;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBlinkRequest;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCommandResultCode;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCommandResultCode;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCommandType;
|
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWMostRecentStatsTimestamp;
|
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWNewChannelRequest;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWNewChannelRequest;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWRebootRequest;
|
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWRebootRequest;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGatewayCommand;
|
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.models.EquipmentCommandResponse;
|
import com.telecominfraproject.wlan.equipmentgateway.models.EquipmentCommandResponse;
|
||||||
import com.telecominfraproject.wlan.equipmentgateway.service.EquipmentGatewayServiceInterface;
|
import com.telecominfraproject.wlan.equipmentgateway.service.EquipmentGatewayServiceInterface;
|
||||||
import com.telecominfraproject.wlan.firmware.FirmwareServiceInterface;
|
import com.telecominfraproject.wlan.firmware.FirmwareServiceInterface;
|
||||||
@@ -163,17 +160,4 @@ public class EquipmentGatewayPortalController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/equipmentGateway/lastReceivedStatsTimestamp", method = RequestMethod.GET)
|
|
||||||
public GenericResponse lastReceivedStatsTimestamp(@RequestParam long equipmentId) {
|
|
||||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
|
||||||
String apId = equipment.getInventoryId();
|
|
||||||
CEGWMostRecentStatsTimestamp mostRecentStatsTimestamp = new CEGWMostRecentStatsTimestamp(CEGWCommandType.MostRecentStatsTimestamp, apId, equipmentId);
|
|
||||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(mostRecentStatsTimestamp);
|
|
||||||
LOG.debug("lastReceivedStatsTimestamp response {}", response);
|
|
||||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
|
||||||
return new GenericResponse(true, response.getResultDetail());
|
|
||||||
} else {
|
|
||||||
return new GenericResponse(false, response.getResultCode() + " - Failed to get last received stats timestamp for " + apId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4434,8 +4434,7 @@ components:
|
|||||||
steerType:
|
steerType:
|
||||||
$ref: '#/components/schemas/SteerType'
|
$ref: '#/components/schemas/SteerType'
|
||||||
previousValidSessionId:
|
previousValidSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
lastFailureDetails:
|
lastFailureDetails:
|
||||||
$ref: '#/components/schemas/ClientFailureDetails'
|
$ref: '#/components/schemas/ClientFailureDetails'
|
||||||
firstFailureDetails:
|
firstFailureDetails:
|
||||||
@@ -4450,8 +4449,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
priorSessionId:
|
priorSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
priorEquipmentId:
|
priorEquipmentId:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
@@ -10336,8 +10334,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -10359,8 +10356,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -10380,8 +10376,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -14274,31 +14269,6 @@ paths:
|
|||||||
500:
|
500:
|
||||||
$ref: '#/components/responses/GenericApiError'
|
$ref: '#/components/responses/GenericApiError'
|
||||||
|
|
||||||
/portal/equipmentGateway/lastReceivedStatsTimestamp:
|
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- Equipment Gateway
|
|
||||||
summary: Request to get the last received (most recent) stats received timestamp for the APs session with the gateway controller
|
|
||||||
operationId: lastReceivedStatsTimestamp
|
|
||||||
parameters:
|
|
||||||
- name: equipmentId
|
|
||||||
in: query
|
|
||||||
description: Equipment id for AP for which last received stats timestamp is being requested.
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: successful operation
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/GenericResponse'
|
|
||||||
500:
|
|
||||||
$ref: '#/components/responses/GenericApiError'
|
|
||||||
|
|
||||||
|
|
||||||
/portal/equipmentGateway/requestChannelChange:
|
/portal/equipmentGateway/requestChannelChange:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class PortalUserDatastoreInMemory extends BaseInMemoryDatastore implement
|
|||||||
PortalUser ret = null;
|
PortalUser ret = null;
|
||||||
|
|
||||||
for (PortalUser mdl : idToPortalUserMap.values()) {
|
for (PortalUser mdl : idToPortalUserMap.values()) {
|
||||||
if(mdl.getCustomerId() == customerId && mdl.getUsername().equals(username)) {
|
if(mdl.getCustomerId() == customerId && mdl.getUsername().toLowerCase().equals(username.toLowerCase())) {
|
||||||
ret = mdl.clone();
|
ret = mdl.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ public class PortalUserDatastoreInMemory extends BaseInMemoryDatastore implement
|
|||||||
List<PortalUser> listOfPortalUsers = new ArrayList<>();
|
List<PortalUser> listOfPortalUsers = new ArrayList<>();
|
||||||
|
|
||||||
for (PortalUser portalUser : idToPortalUserMap.values()) {
|
for (PortalUser portalUser : idToPortalUserMap.values()) {
|
||||||
if (portalUser.getUsername().equals(username)) {
|
if (portalUser.getUsername().toLowerCase().equals(username.toLowerCase())) {
|
||||||
listOfPortalUsers.add(portalUser);
|
listOfPortalUsers.add(portalUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class PortalUserDAO extends BaseJdbcDao {
|
|||||||
|
|
||||||
public static final Set<String> ALL_COLUMNS_LOWERCASE = new HashSet<>();
|
public static final Set<String> ALL_COLUMNS_LOWERCASE = new HashSet<>();
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
//use this for queries where multiple tables are involved
|
//use this for queries where multiple tables are involved
|
||||||
public static final String ALL_COLUMNS_WITH_PREFIX;
|
public static final String ALL_COLUMNS_WITH_PREFIX;
|
||||||
|
|
||||||
@@ -135,10 +134,10 @@ public class PortalUserDAO extends BaseJdbcDao {
|
|||||||
private static final String SQL_GET_BY_USERNAME =
|
private static final String SQL_GET_BY_USERNAME =
|
||||||
"select " + ALL_COLUMNS +
|
"select " + ALL_COLUMNS +
|
||||||
" from " + TABLE_NAME + " " +
|
" from " + TABLE_NAME + " " +
|
||||||
" where username = ? ";
|
" where lower(username) = ? ";
|
||||||
|
|
||||||
private static final String SQL_GET_BY_CUSTOMERID_AND_USERNAME = SQL_GET_BY_CUSTOMER_ID +
|
private static final String SQL_GET_BY_CUSTOMERID_AND_USERNAME = SQL_GET_BY_CUSTOMER_ID +
|
||||||
" and username = ?";
|
" and lower(username) = ?";
|
||||||
|
|
||||||
private static final String SQL_GET_LASTMOD_BY_ID =
|
private static final String SQL_GET_LASTMOD_BY_ID =
|
||||||
"select lastModifiedTimestamp " +
|
"select lastModifiedTimestamp " +
|
||||||
@@ -463,7 +462,7 @@ public class PortalUserDAO extends BaseJdbcDao {
|
|||||||
try{
|
try{
|
||||||
PortalUser portalUser = this.jdbcTemplate.queryForObject(
|
PortalUser portalUser = this.jdbcTemplate.queryForObject(
|
||||||
SQL_GET_BY_CUSTOMERID_AND_USERNAME,
|
SQL_GET_BY_CUSTOMERID_AND_USERNAME,
|
||||||
portalUserRowMapper, customerId, username);
|
portalUserRowMapper, customerId, username.toLowerCase());
|
||||||
|
|
||||||
LOG.debug("Found PortalUser {}", portalUser);
|
LOG.debug("Found PortalUser {}", portalUser);
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ public class PortalUserDAO extends BaseJdbcDao {
|
|||||||
LOG.debug("Looking up PortalUsers for username {} {}", username);
|
LOG.debug("Looking up PortalUsers for username {} {}", username);
|
||||||
|
|
||||||
List<PortalUser> ret = this.jdbcTemplate.query(SQL_GET_BY_USERNAME,
|
List<PortalUser> ret = this.jdbcTemplate.query(SQL_GET_BY_USERNAME,
|
||||||
portalUserRowMapper, username);
|
portalUserRowMapper, username.toLowerCase());
|
||||||
|
|
||||||
LOG.debug("Found List of Portal Users {}", ret);
|
LOG.debug("Found List of Portal Users {}", ret);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class PortalUserEventPayload extends BaseJsonModel implements HasCustomer
|
|||||||
private long createdTimestamp;
|
private long createdTimestamp;
|
||||||
private long lastModifiedTimestamp;
|
private long lastModifiedTimestamp;
|
||||||
|
|
||||||
|
public PortalUserEventPayload() {}
|
||||||
|
|
||||||
public PortalUserEventPayload(PortalUser portalUser) {
|
public PortalUserEventPayload(PortalUser portalUser) {
|
||||||
this.setId(portalUser.getId());
|
this.setId(portalUser.getId());
|
||||||
this.setCustomerId(portalUser.getCustomerId());
|
this.setCustomerId(portalUser.getCustomerId());
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
|
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
|
||||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||||
|
import com.telecominfraproject.wlan.client.ClientServiceInterface;
|
||||||
|
import com.telecominfraproject.wlan.client.session.models.AssociationState;
|
||||||
|
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||||
@@ -75,6 +78,8 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
|
|||||||
private StatusServiceInterface statusServiceInterface;
|
private StatusServiceInterface statusServiceInterface;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AlarmServiceInterface alarmServiceInterface;
|
private AlarmServiceInterface alarmServiceInterface;
|
||||||
|
@Autowired
|
||||||
|
private ClientServiceInterface clientServiceInterface;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean acceptMessage(QueuedStreamMessage message) {
|
protected boolean acceptMessage(QueuedStreamMessage message) {
|
||||||
@@ -275,10 +280,49 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
alarmServiceInterface.delete(existingEquipment.getCustomerId(), existingEquipment.getId());
|
alarmServiceInterface.delete(existingEquipment.getCustomerId(), existingEquipment.getId());
|
||||||
|
|
||||||
|
// Disconnect all associated client devices from existing equipment
|
||||||
|
disconnectClients(existingEquipment);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void process(BaseJsonModel model) {
|
private void process(BaseJsonModel model) {
|
||||||
LOG.warn("Unprocessed model: {}", model);
|
LOG.warn("Unprocessed model: {}", model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void disconnectClients(Equipment ce) {
|
||||||
|
|
||||||
|
LOG.info("EquipmentConfigPushTrigger::disconnectClients for Equipment {}", ce);
|
||||||
|
PaginationResponse<ClientSession> clientSessions = clientServiceInterface.getSessionsForCustomer(
|
||||||
|
ce.getCustomerId(), Set.of(ce.getId()), Set.of(ce.getLocationId()), null, null,
|
||||||
|
new PaginationContext<ClientSession>(100));
|
||||||
|
|
||||||
|
if (clientSessions == null) {
|
||||||
|
LOG.info("There are no existing client sessions to disconnect.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ClientSession> toBeDisconnected = new ArrayList<>();
|
||||||
|
|
||||||
|
clientSessions.getItems().stream().forEach(c -> {
|
||||||
|
if (c.getDetails().getAssociationState() != null
|
||||||
|
&& !c.getDetails().getAssociationState().equals(AssociationState.Disconnected)) {
|
||||||
|
LOG.info("Change association state for client {} from {} to {}", c.getMacAddress(),
|
||||||
|
c.getDetails().getAssociationState(), AssociationState.Disconnected);
|
||||||
|
|
||||||
|
c.getDetails().setAssociationState(AssociationState.Disconnected);
|
||||||
|
toBeDisconnected.add(c);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!toBeDisconnected.isEmpty()) {
|
||||||
|
LOG.info("Sending disconnect for client sessions {}", toBeDisconnected);
|
||||||
|
List<ClientSession> disconnectedSessions = clientServiceInterface.updateSessions(toBeDisconnected);
|
||||||
|
LOG.info("Result of client disconnect {}", disconnectedSessions);
|
||||||
|
} else {
|
||||||
|
LOG.info("There are no existing client sessions that are not already in Disconnected state.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,7 @@ public class StatusDatastoreCassandra implements StatusDatastore {
|
|||||||
private static final Set<String> columnsToSkipForUpdate = new HashSet<>(Arrays.asList(
|
private static final Set<String> columnsToSkipForUpdate = new HashSet<>(Arrays.asList(
|
||||||
"customerId",
|
"customerId",
|
||||||
"equipmentId",
|
"equipmentId",
|
||||||
"statusDataType",
|
"statusDataType"));
|
||||||
"createdTimestamp"));
|
|
||||||
|
|
||||||
private static final String TABLE_NAME = "status";
|
private static final String TABLE_NAME = "status";
|
||||||
private static final String ALL_COLUMNS;
|
private static final String ALL_COLUMNS;
|
||||||
@@ -230,11 +229,14 @@ public class StatusDatastoreCassandra implements StatusDatastore {
|
|||||||
//This DAO does not enforce check for concurrent updates. Last one always wins.
|
//This DAO does not enforce check for concurrent updates. Last one always wins.
|
||||||
|
|
||||||
long newLastModifiedTs = System.currentTimeMillis();
|
long newLastModifiedTs = System.currentTimeMillis();
|
||||||
|
boolean isCreateNotSet = status.getCreatedTimestamp() == 0;
|
||||||
|
|
||||||
|
|
||||||
cqlSession.execute(preparedStmt_update.bind(
|
cqlSession.execute(preparedStmt_update.bind(
|
||||||
|
|
||||||
//TODO: add remaining properties from Status here
|
//TODO: add remaining properties from Status here
|
||||||
(status.getDetails()!=null) ? ByteBuffer.wrap(status.getDetails().toZippedBytes()) : null ,
|
(status.getDetails()!=null) ? ByteBuffer.wrap(status.getDetails().toZippedBytes()) : null ,
|
||||||
|
isCreateNotSet ? newLastModifiedTs : status.getCreatedTimestamp(),
|
||||||
|
|
||||||
newLastModifiedTs,
|
newLastModifiedTs,
|
||||||
|
|
||||||
@@ -253,6 +255,9 @@ public class StatusDatastoreCassandra implements StatusDatastore {
|
|||||||
|
|
||||||
//make a copy so that we don't accidentally update caller's version by reference
|
//make a copy so that we don't accidentally update caller's version by reference
|
||||||
Status statusCopy = status.clone();
|
Status statusCopy = status.clone();
|
||||||
|
if(isCreateNotSet) {
|
||||||
|
statusCopy.setCreatedTimestamp(newLastModifiedTs);
|
||||||
|
}
|
||||||
statusCopy.setLastModifiedTimestamp(newLastModifiedTs);
|
statusCopy.setLastModifiedTimestamp(newLastModifiedTs);
|
||||||
|
|
||||||
LOG.debug("Updated Status {}", statusCopy);
|
LOG.debug("Updated Status {}", statusCopy);
|
||||||
|
|||||||
@@ -1149,8 +1149,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -1168,8 +1167,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -1185,8 +1183,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/RealTimeEvent'
|
$ref: '#/components/schemas/RealTimeEvent'
|
||||||
videoSessionId:
|
videoSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
sessionId:
|
sessionId:
|
||||||
type: string
|
type: string
|
||||||
clientMac:
|
clientMac:
|
||||||
@@ -1641,8 +1638,7 @@ components:
|
|||||||
steerType:
|
steerType:
|
||||||
$ref: '#/components/schemas/SteerType'
|
$ref: '#/components/schemas/SteerType'
|
||||||
previousValidSessionId:
|
previousValidSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
lastFailureDetails:
|
lastFailureDetails:
|
||||||
$ref: '#/components/schemas/ClientFailureDetails'
|
$ref: '#/components/schemas/ClientFailureDetails'
|
||||||
firstFailureDetails:
|
firstFailureDetails:
|
||||||
@@ -1657,8 +1653,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
priorSessionId:
|
priorSessionId:
|
||||||
type: integer
|
type: string
|
||||||
format: int64
|
|
||||||
priorEquipmentId:
|
priorEquipmentId:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
@@ -2420,8 +2415,6 @@ components:
|
|||||||
example:
|
example:
|
||||||
customerId: 2
|
customerId: 2
|
||||||
username: new_user
|
username: new_user
|
||||||
password: pwd
|
|
||||||
role: CustomerIT
|
|
||||||
|
|
||||||
PortalUserRole:
|
PortalUserRole:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
Reference in New Issue
Block a user