[#1150] Cleanup/Refactor Files and Classes#1151
Conversation
…ice classes and addressed checkstyle warnings.
| */ | ||
| @Service | ||
| @Log4j2 | ||
| public class DeviceInfoProcessorService { |
There was a problem hiding this comment.
This service class is essentially code that was extracted from the IdentityClaimProcessor.java. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
| */ | ||
| @Service | ||
| @Log4j2 | ||
| public class Tpm2ProvisionerStateService { |
There was a problem hiding this comment.
This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
| import java.util.regex.Pattern; | ||
|
|
||
| @Log4j2 | ||
| public class IdentityClaimProcessor extends AbstractProcessor { |
There was a problem hiding this comment.
Renamed to IdentityClaimProcessorService. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
| @Log4j2 | ||
| @RestController | ||
| @RequestMapping("/HIRS_AttestationCA") | ||
| public class RestfulAttestationCertificateAuthority extends AttestationCertificateAuthority |
There was a problem hiding this comment.
This class has been renamed to AttestationCertificateAuthorityRestController. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
| @Service | ||
| @Log4j2 | ||
| public class PlatformCredentialPageService { | ||
| public class PlatformCertificatePageService { |
There was a problem hiding this comment.
Changed Credential to Certificate in order to keep consistency throughout the code base.
| @Log4j2 | ||
| public class EndorsementCredentialPageService { | ||
| private final EndorsementCredentialRepository endorsementCredentialRepository; | ||
| public class EndorsementCertificatePageService { |
There was a problem hiding this comment.
Changed Credential to Certificate for consistency reasons.
| * Test suite for {@link AttestationCertificateAuthority}. | ||
| */ | ||
| @TestInstance(TestInstance.Lifecycle.PER_CLASS) // needed to use non-static BeforeAll | ||
| public class AttestationCertificateAuthorityTest { |
There was a problem hiding this comment.
Renamed test class to AttestationCertificateAuthorityServiceTest
| * Identity Request. | ||
| */ | ||
| @Log4j2 | ||
| public abstract class AttestationCertificateAuthority { |
There was a problem hiding this comment.
Renamed to AttestationCertificateAuthorityService
| /** | ||
| * Utility class which includes credential management functions used by the ACA. | ||
| */ | ||
| @Log4j2 |
There was a problem hiding this comment.
Renamed to CredentialManagementService. This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
| @Getter | ||
| @Log4j2 | ||
| @NoArgsConstructor | ||
| public class AbstractProcessor { |
There was a problem hiding this comment.
This change was also made in #1127 but was placed here to reduce the num of lines changed in the original PR.
Description
This issue focuses on cleaning up unused files, classes, and methods throughout the codebase, relocating files and classes to the appropriate packages, refactoring class names, and reorganizing services and controllers for clarity and proper structure. All these changes come from #1127 and #1105. This PR was also created with the intention of reducing the number of lines of files changed in those respective PRs.
Test Instructions:
Summary Of Changes:
Refactored the REST controller and service classes (specifically the Identity Claim and Certificate Processor classes) to align with proper Spring Boot MVC design patterns.
Converted the Identity Claim and Certificate Processor classes into Spring-managed services by annotating them with
@Serviceannotation, as they were effectively acting as services.Simplified the Identity Claim and Certificate Processor classes by moving unrelated logic into appropriate service classes, reducing complexity and better adhering to the Single Responsibility Principle.
Converted utility classes used by the Identity Claim and Certificate Processor classes into Spring-managed service classes, as they contained business logic and repository interactions.
Deleted unused files and dead code that were encountered as I was looking at [#1101] Fix JavaDoc Generation Errors/Warnings #1105.
Renamed service, repository, and controller classes, replacing 'Credential' with 'Certificate' in their names.
Issues This PR Addresses:
Closes #1150