From 712a4e28f5f183a45ee0c4863a998fb64d9db4a9 Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:35:29 +0530 Subject: [PATCH] fix: remove redundunt classes --- .../client/heracles/AtlasHeraclesClient.java | 3 - .../client/heracles/HeraclesRestClient.java | 1 - .../heracles/RetrofitHeraclesClient.java | 1 - .../models/HeraclesUsersRepresentation.java | 113 ------------------ 4 files changed, 118 deletions(-) delete mode 100644 client-auth/src/main/java/org/apache/atlas/auth/client/heracles/models/HeraclesUsersRepresentation.java diff --git a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/AtlasHeraclesClient.java b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/AtlasHeraclesClient.java index 0c599e8078..dd212794ca 100644 --- a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/AtlasHeraclesClient.java +++ b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/AtlasHeraclesClient.java @@ -4,15 +4,12 @@ import org.apache.atlas.auth.client.heracles.models.HeraclesRoleViewRepresentation; import org.apache.atlas.auth.client.heracles.models.HeraclesUserViewRepresentation; import org.apache.atlas.exception.AtlasBaseException; -import org.apache.atlas.auth.client.heracles.models.HeraclesUsersRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Set; import java.util.stream.Collectors; public class AtlasHeraclesClient { diff --git a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/HeraclesRestClient.java b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/HeraclesRestClient.java index e7548138d3..c6fbbcb935 100644 --- a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/HeraclesRestClient.java +++ b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/HeraclesRestClient.java @@ -5,7 +5,6 @@ import org.apache.atlas.auth.client.heracles.models.HeraclesRoleViewRepresentation; import org.apache.atlas.auth.client.heracles.models.HeraclesUserViewRepresentation; import org.apache.atlas.exception.AtlasBaseException; -import org.apache.atlas.auth.client.heracles.models.HeraclesUsersRepresentation; import retrofit2.Response; import java.util.List; diff --git a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/RetrofitHeraclesClient.java b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/RetrofitHeraclesClient.java index 5a78ed4225..b9fd8de6ca 100644 --- a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/RetrofitHeraclesClient.java +++ b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/RetrofitHeraclesClient.java @@ -2,7 +2,6 @@ import org.apache.atlas.auth.client.heracles.models.HeraclesRoleViewRepresentation; import org.apache.atlas.auth.client.heracles.models.HeraclesUserViewRepresentation; -import org.apache.atlas.auth.client.heracles.models.HeraclesUsersRepresentation; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Headers; diff --git a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/models/HeraclesUsersRepresentation.java b/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/models/HeraclesUsersRepresentation.java deleted file mode 100644 index 4cea34f509..0000000000 --- a/client-auth/src/main/java/org/apache/atlas/auth/client/heracles/models/HeraclesUsersRepresentation.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.apache.atlas.auth.client.heracles.models; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import org.keycloak.representations.idm.UserRepresentation; - -import java.util.ArrayList; -import java.util.List; - -@JsonIgnoreProperties(ignoreUnknown = true) -public class HeraclesUsersRepresentation { - protected int totalRecord; - protected int filterRecord; - protected List records; - public static final String USER_PROJECTIONS = "emailVerified,enabled,id,status,username"; - public static final String USER_SORT = "username"; - - public HeraclesUsersRepresentation() { - } - - public HeraclesUsersRepresentation(int totalRecord, int filterRecord, List records) { - this.totalRecord = totalRecord; - this.filterRecord = filterRecord; - this.records = records; - } - - public int getTotalRecord() { - return totalRecord; - } - - public void setTotalRecord(int totalRecord) { - this.totalRecord = totalRecord; - } - - public int getFilterRecord() { - return filterRecord; - } - - public void setFilterRecord(int filterRecord) { - this.filterRecord = filterRecord; - } - - public List getRecords() { - return records; - } - - public void setRecords(List records) { - this.records = records; - } - - public List toKeycloakUserRepresentations() { - List userRepresentations = new ArrayList<>(); - for (HeraclesUserRepresentation heraclesUserRepresentation : records) { - UserRepresentation userRepresentation = new UserRepresentation(); - userRepresentation.setEmailVerified(heraclesUserRepresentation.emailVerified); - userRepresentation.setEnabled(heraclesUserRepresentation.enabled); - userRepresentation.setUsername(heraclesUserRepresentation.username); - userRepresentation.setId(heraclesUserRepresentation.id); - userRepresentations.add(userRepresentation); - } - return userRepresentations; - } -} - -@JsonIgnoreProperties(ignoreUnknown = true) -class HeraclesUserRepresentation { - protected boolean emailVerified; - protected boolean enabled; - protected String username; - protected String id; - - public HeraclesUserRepresentation() { - } - - public HeraclesUserRepresentation(boolean emailVerified, boolean enabled, String username, String id) { - this.emailVerified = emailVerified; - this.enabled = enabled; - this.username = username; - this.id = id; - } - - public boolean isEmailVerified() { - return emailVerified; - } - - public void setEmailVerified(boolean emailVerified) { - this.emailVerified = emailVerified; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - -}