Skip to content

Commit

Permalink
[Java21]
Browse files Browse the repository at this point in the history
Signed-off-by: JanardhanBS-SyncByte <[email protected]>
  • Loading branch information
JanardhanBS-SyncByte committed Jun 7, 2024
1 parent 659f3c8 commit 7f2cb15
Show file tree
Hide file tree
Showing 110 changed files with 3,460 additions and 2,089 deletions.
66 changes: 38 additions & 28 deletions pre-registration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<url>https://github.com/mosip/pre-registration</url>
<tag>HEAD</tag>
</scm>

<developers>
<developer>
<name>Mosip</name>
Expand All @@ -35,26 +35,26 @@
</developer>
</developers>

<repositories>
<repository>
<id>ossrh</id>
<name>CentralRepository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<name>MavenCentral</name>
<layout>default</layout>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<repositories>
<repository>
<id>ossrh</id>
<name>CentralRepository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<name>MavenCentral</name>
<layout>default</layout>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
Expand Down Expand Up @@ -119,7 +119,7 @@
<mockito-version>3.4.3</mockito-version>

<!-- Lombok -->
<lombok.version>1.18.32</lombok.version>
<lombok.version>1.18.30</lombok.version>

<!-- Json Simple -->
<jsonsimple.version>1.1.1</jsonsimple.version>
Expand Down Expand Up @@ -172,7 +172,13 @@
<artifactId>kernel-bom</artifactId>
<version>1.2.1-java21-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -215,15 +221,18 @@
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
Expand Down Expand Up @@ -422,7 +431,8 @@
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFilename>
${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<includeOnlyProperties>
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
Expand Down
49 changes: 26 additions & 23 deletions pre-registration/pre-registration-application-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,12 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-bom</artifactId>
<version>1.2.1-java21-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -74,9 +61,9 @@
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.8</version>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -155,12 +142,27 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -217,9 +219,9 @@
<version>1.2.1-java21-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -279,7 +281,8 @@
</execution>
</executions>
<configuration>
<apiDocsUrl>http://localhost:9090/preregistration/v1/application-service/v3/api-docs/Pre-Registration</apiDocsUrl>
<apiDocsUrl>
http://localhost:9090/preregistration/v1/application-service/v3/api-docs/Pre-Registration</apiDocsUrl>
<outputFileName>${artifactId}-openapi.json</outputFileName>
<outputDir>${project.build.directory}</outputDir>
<skip>false</skip>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.mosip.preregistration.application.dto;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -9,37 +8,33 @@

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;


@Getter
@Setter
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OTPGenerateRequestDTO {

private String id;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@Setter(AccessLevel.NONE)
@Getter(AccessLevel.NONE)
private Date requesttime;

private String version;

private Map metadata=new HashMap();

private RequestDTO request;

private Map metadata = new HashMap();

private RequestDTO request;

// Getter and Setter methods for requesttime are overridden manually
public Date getRequesttime() {
return requesttime!=null ? new Date(requesttime.getTime()):null;
return requesttime != null ? new Date(requesttime.getTime()) : null;
}

public void setRequesttime(Date requesttime) {
this.requesttime =requesttime!=null ? new Date(requesttime.getTime()):null;
this.requesttime = requesttime != null ? new Date(requesttime.getTime()) : null;
}

}

Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
package io.mosip.preregistration.application.exception;

import java.util.Objects;

import io.mosip.kernel.core.exception.BaseUncheckedException;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class AppointmentExecption extends BaseUncheckedException {

public AppointmentExecption(String errorCode, String message) {
this.errorCode = errorCode;
this.errorMessage = message;
}
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;

/**
*
* The error code associated with the audit failure.
*/
private static final long serialVersionUID = 1L;

private String errorCode;

/**
* A descriptive message explaining the reason for the audit failure.
*/
private String errorMessage;

}
public AppointmentExecption(String errorCode, String message) {
super();
this.errorCode = errorCode;
this.errorMessage = message;
}

@Override
public boolean equals(Object obj) {
super.equals(obj);
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AppointmentExecption other = (AppointmentExecption) obj;
return Objects.equals(errorCode, other.errorCode) && Objects.equals(errorMessage, other.errorMessage);
}

@Override
public int hashCode() {
super.hashCode();
return Objects.hash(errorCode, errorMessage);
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
package io.mosip.preregistration.application.exception;

import io.mosip.kernel.core.exception.BaseUncheckedException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@AllArgsConstructor
/**
* The AuditFailedException class represents an exception that occurs
* when audit fails.
*
*
* @author Tapaswini Behera
* @since 1.0.0
*
*/

@Data
public class AuditFailedException extends BaseUncheckedException {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;

/**
*
* The error code associated with the audit failure.
*/
private static final long serialVersionUID = 1L;

private String errorCode;

private String errorMessage;
private final String errorCode;






/**
* A descriptive message explaining the reason for the audit failure.
*/
private final String errorMessage;

}
/**
* Constructs a new AuditFailedException with the specified error code and
* message.
*
* @param errorCode The error code associated with the audit failure.
* @param errorMessage A descriptive message explaining the reason for the audit
* failure.
*/
public AuditFailedException(String errorCode, String errorMessage) {
super();
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
}
Loading

0 comments on commit 7f2cb15

Please sign in to comment.