From fc4f3643e4c88246f6dcb5559ea67010b4dddcbb Mon Sep 17 00:00:00 2001 From: ralphlee Date: Wed, 2 Feb 2022 14:33:09 -0500 Subject: [PATCH] [WIFI-6855] Add support for when Passpoint profile is updated without any detail changes --- .../profile/controller/ProfileController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/profile-service/src/main/java/com/telecominfraproject/wlan/profile/controller/ProfileController.java b/profile-service/src/main/java/com/telecominfraproject/wlan/profile/controller/ProfileController.java index 1ca4ce1b..f5370226 100644 --- a/profile-service/src/main/java/com/telecominfraproject/wlan/profile/controller/ProfileController.java +++ b/profile-service/src/main/java/com/telecominfraproject/wlan/profile/controller/ProfileController.java @@ -31,6 +31,7 @@ import com.telecominfraproject.wlan.profile.models.ProfileType; import com.telecominfraproject.wlan.profile.models.events.ProfileAddedEvent; import com.telecominfraproject.wlan.profile.models.events.ProfileChangedEvent; import com.telecominfraproject.wlan.profile.models.events.ProfileRemovedEvent; +import com.telecominfraproject.wlan.profile.passpoint.models.PasspointProfile; /** @@ -209,6 +210,20 @@ public class ProfileController { LOG.error("Failed to update Profile, request contains unsupported value: {}", profile); throw new DsDataValidationException("Profile contains unsupported value"); } + + // WIFI-6855: To handle SSID-Passpoint association update when SSID profiles are updated + // If the passpoint profile update is requested, but no change is made to the details, then skip the update + if (profile.getProfileType().equals(ProfileType.passpoint)) { + Profile existingProfile = profileDatastore.getOrNull(profile.getId()); + if (existingProfile != null) { + PasspointProfile existingDetails = (PasspointProfile) existingProfile.getDetails(); + PasspointProfile newDetails = (PasspointProfile) profile.getDetails(); + if (existingDetails.equals(newDetails)) { + LOG.info("No change was made to this profile, skip update on profile {}", profile.getId()); + return profile; + } + } + } Profile ret = profileDatastore.update(profile);