From 4522224462a6b5bb75eb7659358528778c562b10 Mon Sep 17 00:00:00 2001 From: Loganathan Sekar <42532387+LoganathanSekar7627@users.noreply.github.com> Date: Wed, 21 Jun 2023 16:14:27 +0530 Subject: [PATCH] Code cleanup (#977) * fix build issue * Fix local startup issue * Code cleanup, added domain-url config, organised imports --------- Co-authored-by: Loganathan Sekar Signed-off-by: Ritik Jain --- resident/resident-service/pom.xml | 5 + .../mosip/resident/constant/PacketStatus.java | 1 - .../resident/constant/TransactionStage.java | 1 - .../DownLoadMasterDataController.java | 33 +-- .../controller/GrievanceController.java | 19 +- .../controller/ProxyOtpController.java | 4 +- .../DynamicFieldConsolidateResponseDto.java | 4 +- .../io/mosip/resident/dto/UserInfoDto.java | 1 - .../exception/InvalidInputException.java | 1 - .../RepeatableStreamHttpServletRequest.java | 2 +- .../ResettableStreamHttpServletRequest.java | 193 ------------------ .../ResidentTransactionRepository.java | 12 +- .../service/DownLoadMasterDataService.java | 1 - .../service/impl/IdAuthServiceImpl.java | 2 +- .../service/impl/OtpManagerServiceImpl.java | 2 +- .../impl/ProxyMasterdataServiceImpl.java | 4 +- .../service/impl/ProxyOtpServiceImpl.java | 25 +-- .../service/impl/ResidentServiceImpl.java | 97 ++++----- .../impl/WebSubUpdateAuthTypeServiceImpl.java | 2 - 19 files changed, 111 insertions(+), 298 deletions(-) delete mode 100644 resident/resident-service/src/main/java/io/mosip/resident/filter/ResettableStreamHttpServletRequest.java diff --git a/resident/resident-service/pom.xml b/resident/resident-service/pom.xml index d3c7abddc36..5582c8f7175 100644 --- a/resident/resident-service/pom.xml +++ b/resident/resident-service/pom.xml @@ -422,6 +422,11 @@ 5.3.3.RELEASE test + + org.bitbucket.b_c + jose4j + 0.9.3 + diff --git a/resident/resident-service/src/main/java/io/mosip/resident/constant/PacketStatus.java b/resident/resident-service/src/main/java/io/mosip/resident/constant/PacketStatus.java index 920384acc8c..feee2023810 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/constant/PacketStatus.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/constant/PacketStatus.java @@ -1,7 +1,6 @@ package io.mosip.resident.constant; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.springframework.core.env.Environment; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/constant/TransactionStage.java b/resident/resident-service/src/main/java/io/mosip/resident/constant/TransactionStage.java index 3503fcc5d13..328745ec732 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/constant/TransactionStage.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/constant/TransactionStage.java @@ -1,7 +1,6 @@ package io.mosip.resident.constant; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.springframework.core.env.Environment; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/controller/DownLoadMasterDataController.java b/resident/resident-service/src/main/java/io/mosip/resident/controller/DownLoadMasterDataController.java index 078888c831d..1db98280d81 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/controller/DownLoadMasterDataController.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/controller/DownLoadMasterDataController.java @@ -1,5 +1,22 @@ package io.mosip.resident.controller; +import java.io.IOException; +import java.io.InputStream; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; +import java.util.Objects; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.core.io.InputStreamResource; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import io.mosip.kernel.core.logger.spi.Logger; import io.mosip.kernel.core.util.DateUtils; import io.mosip.resident.config.LoggerConfiguration; @@ -13,22 +30,6 @@ import io.mosip.resident.util.Utility; import io.mosip.resident.validator.RequestValidator; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.core.io.InputStreamResource; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.io.InputStream; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Map; -import java.util.Objects; /** * diff --git a/resident/resident-service/src/main/java/io/mosip/resident/controller/GrievanceController.java b/resident/resident-service/src/main/java/io/mosip/resident/controller/GrievanceController.java index 8d0114ff95a..db59494f2b1 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/controller/GrievanceController.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/controller/GrievanceController.java @@ -1,5 +1,15 @@ package io.mosip.resident.controller; +import java.io.IOException; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + import io.mosip.kernel.core.http.ResponseWrapper; import io.mosip.kernel.core.logger.spi.Logger; import io.mosip.resident.config.LoggerConfiguration; @@ -15,15 +25,6 @@ import io.mosip.resident.util.EventEnum; import io.mosip.resident.validator.RequestValidator; import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -import java.io.IOException; -import java.util.Map; /** * @author Kamesh Shekhar Prasad diff --git a/resident/resident-service/src/main/java/io/mosip/resident/controller/ProxyOtpController.java b/resident/resident-service/src/main/java/io/mosip/resident/controller/ProxyOtpController.java index dcd3e69e2fd..20840a79805 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/controller/ProxyOtpController.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/controller/ProxyOtpController.java @@ -2,8 +2,6 @@ import java.util.Map; -import io.mosip.resident.constant.ResidentErrorCode; -import io.mosip.resident.exception.ApisResourceAccessException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.http.HttpStatus; @@ -19,10 +17,12 @@ import io.mosip.kernel.core.logger.spi.Logger; import io.mosip.resident.config.LoggerConfiguration; import io.mosip.resident.constant.ResidentConstants; +import io.mosip.resident.constant.ResidentErrorCode; import io.mosip.resident.dto.MainRequestDTO; import io.mosip.resident.dto.MainResponseDTO; import io.mosip.resident.dto.OtpRequestDTOV2; import io.mosip.resident.dto.OtpRequestDTOV3; +import io.mosip.resident.exception.ApisResourceAccessException; import io.mosip.resident.exception.InvalidInputException; import io.mosip.resident.exception.ResidentServiceException; import io.mosip.resident.service.ProxyOtpService; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/dto/DynamicFieldConsolidateResponseDto.java b/resident/resident-service/src/main/java/io/mosip/resident/dto/DynamicFieldConsolidateResponseDto.java index 863fc1b0485..7eb525a7e16 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/dto/DynamicFieldConsolidateResponseDto.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/dto/DynamicFieldConsolidateResponseDto.java @@ -1,12 +1,12 @@ package io.mosip.resident.dto; +import java.util.List; + import io.swagger.annotations.ApiModel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.List; - /** * @author Kamesh Shekhar Prasad * Dynamic Field Consolidate Response Dto diff --git a/resident/resident-service/src/main/java/io/mosip/resident/dto/UserInfoDto.java b/resident/resident-service/src/main/java/io/mosip/resident/dto/UserInfoDto.java index c7d05c17bab..d96d36e1414 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/dto/UserInfoDto.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/dto/UserInfoDto.java @@ -1,6 +1,5 @@ package io.mosip.resident.dto; -import java.time.LocalDateTime; import java.util.Map; import lombok.Data; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/exception/InvalidInputException.java b/resident/resident-service/src/main/java/io/mosip/resident/exception/InvalidInputException.java index ba038a4ff42..df9fd1ba1c3 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/exception/InvalidInputException.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/exception/InvalidInputException.java @@ -1,6 +1,5 @@ package io.mosip.resident.exception; -import io.mosip.kernel.core.exception.BaseUncheckedException; import io.mosip.resident.constant.ResidentErrorCode; public class InvalidInputException extends BaseResidentUncheckedExceptionWithMetadata { diff --git a/resident/resident-service/src/main/java/io/mosip/resident/filter/RepeatableStreamHttpServletRequest.java b/resident/resident-service/src/main/java/io/mosip/resident/filter/RepeatableStreamHttpServletRequest.java index 8e4cbc24fe8..0bfc0ce15fb 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/filter/RepeatableStreamHttpServletRequest.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/filter/RepeatableStreamHttpServletRequest.java @@ -105,7 +105,7 @@ public void replaceData(byte[] newData) { /** * The Class RepeatableServletInputStream - used in - * ResettableStreamHttpServletRequest + * RepeatableServletInputStream */ private class RepeatableServletInputStream extends ServletInputStream { diff --git a/resident/resident-service/src/main/java/io/mosip/resident/filter/ResettableStreamHttpServletRequest.java b/resident/resident-service/src/main/java/io/mosip/resident/filter/ResettableStreamHttpServletRequest.java deleted file mode 100644 index 13151c75de9..00000000000 --- a/resident/resident-service/src/main/java/io/mosip/resident/filter/ResettableStreamHttpServletRequest.java +++ /dev/null @@ -1,193 +0,0 @@ -package io.mosip.resident.filter; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Map; - -import javax.servlet.ReadListener; -import javax.servlet.ServletInputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; - -import org.springframework.util.StreamUtils; - -import io.mosip.resident.util.ObjectWithMetadata; - -/** - * The request wrapper used in filter that allows to re-read the request - * body. - * - * @author Loganathan Sekar - */ -public class ResettableStreamHttpServletRequest extends HttpServletRequestWrapper implements ObjectWithMetadata { - - /** The raw data. */ - private byte[] rawData; - - /** The request. */ - private HttpServletRequest request; - - /** The servlet stream. */ - private ResettableServletInputStream servletStream; - - private Map metadata; - - /** - * Instantiates a new resettable stream http servlet request. - * - * @param request the request - */ - public ResettableStreamHttpServletRequest(HttpServletRequest request) { - super(request); - this.request = request; - this.servletStream = new ResettableServletInputStream(); - } - - /** - * Reset input stream. - */ - public void resetInputStream() { - servletStream.stream = new ResettableServletInputStream(new ByteArrayInputStream(rawData)); - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletRequestWrapper#getInputStream() - */ - @Override - public ServletInputStream getInputStream() throws IOException { - if (rawData == null) { - rawData = StreamUtils.copyToByteArray(this.request.getInputStream()); - servletStream.stream = new ByteArrayInputStream(rawData); - } - return servletStream; - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletRequestWrapper#getReader() - */ - @Override - public BufferedReader getReader() throws IOException { - if (rawData == null) { - rawData = StreamUtils.copyToByteArray(this.request.getInputStream()); - servletStream.stream = new ByteArrayInputStream(rawData); - } - return new BufferedReader(new InputStreamReader(servletStream)); - } - - /** - * Replace the request data with the given bytes - * - * @param newData the new data to be replaced with - */ - public void replaceData(byte[] newData) { - rawData = newData; - servletStream.stream = new ByteArrayInputStream(rawData); - } - - /** - * The Class ResettableServletInputStream - used in - * ResettableStreamHttpServletRequest - */ - private class ResettableServletInputStream extends ServletInputStream { - - /** The stream. */ - private InputStream stream; - - /** The eof reached. */ - private boolean eofReached; - - /** The closed. */ - private boolean closed; - - /** - * Instantiates a new resettable servlet input stream. - * - * @param stream the stream - */ - public ResettableServletInputStream(InputStream stream) { - this.stream = stream; - } - - /** - * Instantiates a new resettable servlet input stream. - */ - public ResettableServletInputStream() { - } - - /* - * (non-Javadoc) - * - * @see java.io.InputStream#read() - */ - @Override - public int read() throws IOException { - int val = stream.read(); - if (val == -1) { - eofReached = true; - } - return val; - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletInputStream#isFinished() - */ - @Override - public boolean isFinished() { - return eofReached; - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletInputStream#isReady() - */ - @Override - public boolean isReady() { - return !eofReached && !closed; - } - - /* - * (non-Javadoc) - * - * @see java.io.InputStream#close() - */ - @Override - public void close() throws IOException { - super.close(); - closed = true; - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletInputStream#setReadListener(javax.servlet. - * ReadListener) - */ - @Override - public void setReadListener(ReadListener listener) { - // Nothing to do - } - } - - @Override - public Map getMetadata() { - return metadata; - } - - @Override - public void setMetadata(Map metadata) { - this.metadata = metadata; - - } - - -} diff --git a/resident/resident-service/src/main/java/io/mosip/resident/repository/ResidentTransactionRepository.java b/resident/resident-service/src/main/java/io/mosip/resident/repository/ResidentTransactionRepository.java index dc9c2d7dcb7..1cd0573495b 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/repository/ResidentTransactionRepository.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/repository/ResidentTransactionRepository.java @@ -1,16 +1,18 @@ package io.mosip.resident.repository; -import io.mosip.resident.entity.ResidentTransactionEntity; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Optional; + +import javax.transaction.Transactional; + import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import javax.transaction.Transactional; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Optional; +import io.mosip.resident.entity.ResidentTransactionEntity; /** * The Interface ResidentTransactionRepository. diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/DownLoadMasterDataService.java b/resident/resident-service/src/main/java/io/mosip/resident/service/DownLoadMasterDataService.java index 9f8c81bb2c8..195d64ca439 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/DownLoadMasterDataService.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/DownLoadMasterDataService.java @@ -2,7 +2,6 @@ import java.io.IOException; import java.io.InputStream; -import java.util.List; import org.springframework.stereotype.Service; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/IdAuthServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/IdAuthServiceImpl.java index 654400f913b..b0118f1f5f4 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/IdAuthServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/IdAuthServiceImpl.java @@ -97,7 +97,7 @@ public class IdAuthServiceImpl implements IdAuthService { @Value("${auth.type.status.id}") private String authTypeStatusId; - @Value("${mosipbox.public.url:null}") + @Value("${mosip.ida.domain-url:null}") private String domainUrl; @Value("${mosip.ida.env:Staging}") diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/OtpManagerServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/OtpManagerServiceImpl.java index 725fa012982..63e0ecd0db7 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/OtpManagerServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/OtpManagerServiceImpl.java @@ -10,7 +10,6 @@ import javax.xml.bind.DatatypeConverter; -import io.mosip.resident.util.Utilities; import org.json.simple.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -49,6 +48,7 @@ import io.mosip.resident.service.OtpManager; import io.mosip.resident.service.ResidentService; import io.mosip.resident.util.TemplateUtil; +import io.mosip.resident.util.Utilities; import io.mosip.resident.validator.RequestValidator; import reactor.util.function.Tuple2; diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyMasterdataServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyMasterdataServiceImpl.java index e93b1dfc507..66538779c3c 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyMasterdataServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyMasterdataServiceImpl.java @@ -1,5 +1,7 @@ package io.mosip.resident.service.impl; +import static io.mosip.resident.constant.MappingJsonConstants.GENDER; + import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -36,8 +38,6 @@ import reactor.util.function.Tuple2; import reactor.util.function.Tuples; -import static io.mosip.resident.constant.MappingJsonConstants.GENDER; - /** * Resident proxy masterdata service implementation class. * diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyOtpServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyOtpServiceImpl.java index 02caf3eb666..8d362280808 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyOtpServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyOtpServiceImpl.java @@ -1,5 +1,18 @@ package io.mosip.resident.service.impl; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; + import io.mosip.kernel.core.authmanager.model.AuthNResponse; import io.mosip.kernel.core.logger.spi.Logger; import io.mosip.kernel.core.util.DateUtils; @@ -22,21 +35,9 @@ import io.mosip.resident.util.EventEnum; import io.mosip.resident.util.Utility; import io.mosip.resident.validator.RequestValidator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; import reactor.util.function.Tuple2; import reactor.util.function.Tuples; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - /** * @author Kamesh Shekhar Prasad * This class is used to implement opt service impl class. diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java index 42d1116e6c0..89b9bca635a 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentServiceImpl.java @@ -1,7 +1,57 @@ package io.mosip.resident.service.impl; +import static io.mosip.resident.constant.EventStatusSuccess.CARD_DOWNLOADED; +import static io.mosip.resident.constant.EventStatusSuccess.LOCKED; +import static io.mosip.resident.constant.EventStatusSuccess.UNLOCKED; +import static io.mosip.resident.constant.MappingJsonConstants.IDSCHEMA_VERSION; +import static io.mosip.resident.constant.RegistrationConstants.UIN_LABEL; +import static io.mosip.resident.constant.RegistrationConstants.VID_LABEL; +import static io.mosip.resident.constant.ResidentConstants.ATTRIBUTE_LIST_DELIMITER; +import static io.mosip.resident.constant.ResidentConstants.RESIDENT_NOTIFICATIONS_DEFAULT_PAGE_SIZE; +import static io.mosip.resident.constant.ResidentConstants.SEMI_COLON; +import static io.mosip.resident.constant.ResidentConstants.UI_ATTRIBUTE_DATA_DELIMITER; +import static io.mosip.resident.constant.ResidentErrorCode.MACHINE_MASTER_CREATE_EXCEPTION; +import static io.mosip.resident.constant.ResidentErrorCode.PACKET_SIGNKEY_EXCEPTION; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.Month; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import javax.annotation.PostConstruct; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.json.simple.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.http.HttpEntity; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; + import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; + import io.mosip.commons.khazana.exception.ObjectStoreAdapterException; import io.mosip.kernel.core.exception.BaseCheckedException; import io.mosip.kernel.core.http.ResponseWrapper; @@ -108,56 +158,9 @@ import io.mosip.resident.util.UINCardDownloadService; import io.mosip.resident.util.Utilities; import io.mosip.resident.util.Utility; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.json.simple.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpEntity; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Service; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; import reactor.util.function.Tuple2; import reactor.util.function.Tuples; -import javax.annotation.PostConstruct; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.Month; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; - -import static io.mosip.resident.constant.EventStatusSuccess.CARD_DOWNLOADED; -import static io.mosip.resident.constant.EventStatusSuccess.LOCKED; -import static io.mosip.resident.constant.EventStatusSuccess.UNLOCKED; -import static io.mosip.resident.constant.MappingJsonConstants.IDSCHEMA_VERSION; -import static io.mosip.resident.constant.RegistrationConstants.UIN_LABEL; -import static io.mosip.resident.constant.RegistrationConstants.VID_LABEL; -import static io.mosip.resident.constant.ResidentConstants.ATTRIBUTE_LIST_DELIMITER; -import static io.mosip.resident.constant.ResidentConstants.RESIDENT_NOTIFICATIONS_DEFAULT_PAGE_SIZE; -import static io.mosip.resident.constant.ResidentConstants.SEMI_COLON; -import static io.mosip.resident.constant.ResidentConstants.UI_ATTRIBUTE_DATA_DELIMITER; -import static io.mosip.resident.constant.ResidentErrorCode.MACHINE_MASTER_CREATE_EXCEPTION; -import static io.mosip.resident.constant.ResidentErrorCode.PACKET_SIGNKEY_EXCEPTION; - @Service public class ResidentServiceImpl implements ResidentService { diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java index 6df65566e98..dbd4e203dd6 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java @@ -1,7 +1,5 @@ package io.mosip.resident.service.impl; -import static io.mosip.resident.constant.ResidentConstants.RESIDENT; - import java.util.List; import java.util.Map; import java.util.Objects;