728x90

Luna HSMs have many capabilities that are not certified by NIST. To be FIPS-compliant, the HSM must be set to FIPS mode, where any mechanisms or cryptographic operations that are not FIPS-certified are blocked from use. FIPS mode is set using HSM or partition policies as described below.

 

Setting FIPS Mode on the HSM

You can set the HSM to FIPS mode using HSM policy 12: Allow non-FIPS algorithms. When this policy is set to 0, algorithms that are not FIPS-validated are blocked from use on every partition on the HSM, and the HSM is operating in FIPS mode. There are two methods of setting this policy:

>The HSM SO can use a policy template to set the policy at initialization (see Setting HSM Policies Using a Template). This method is recommended for auditing purposes -- it ensures that the HSM is in FIPS mode for its entire use cycle.

>The HSM SO can set the policy manually after initializing the HSM (see Setting HSM Policies Manually).

'Cryptography' 카테고리의 다른 글

HOTP and TOTP  (31) 2024.03.21
The group Zp*  (31) 2024.03.11
Padding oracles and the decline of CBC-mode cipher suites  (117) 2024.03.08
CBC-bit Flipping  (56) 2024.03.08
AES Cipher  (0) 2024.03.07
728x90

JSONException and JSONObject components called from JSON Library were not imported in Jenkins compiling stage.

Components are not included in or are not recognized at the JVM level, which is expected.

 

Despite these issues causing some users, I have no idea why they happen.

 

Change Below 

import org.springframework.boot.configurationprocessor.json.JSONObject;
import org.springframework.boot.configurationprocessor.json.JSONException;

 

to

import org.json.JSONException;
import org.json.JSONObject;

 

Also, import JSON directly

implementation 'org.json:json:20240303'

 

'Java > Spring Boot JPA' 카테고리의 다른 글

[Spring Batch] 조져보자 meta table  (0) 2024.04.29
생성자와 Builder패턴  (1) 2024.04.26
JobParametersIncrementer  (0) 2024.04.03
Running Jobs from within a Web Container  (31) 2024.04.03
Builder and AllArgsConstructor Annotation  (31) 2024.04.02
728x90

JobParametersIncrementer

Most of the methods on JobOperator are self-explanatory, and you can find more detailed explanations in the Javadoc of the interface. However, the startNextInstance method is worth noting. This method always starts a new instance of a Job. This can be extremely useful if there are serious issues in a JobExecution and the Job needs to be started over again from the beginning. Unlike JobLauncher (which requires a new JobParameters object that triggers a new JobInstance), if the parameters are different from any previous set of parameters, the startNextInstance method uses the JobParametersIncrementer tied to the Job to force the Job to a new instance:

 

public interface JobParametersIncrementer {

    JobParameters getNext(JobParameters parameters);

}

 

 

The contract of JobParametersIncrementer is that, given a JobParameters object, it returns the “next” JobParameters object by incrementing any necessary values it may contain. This strategy is useful because the framework has no way of knowing what changes to the JobParameters make it the “next” instance. For example, if the only value in JobParameters is a date and the next instance should be created, should that value be incremented by one day or one week (if the job is weekly, for instance)? The same can be said for any numerical values that help to identify the Job, as the following example shows:

 

public class SampleIncrementer implements JobParametersIncrementer {

    public JobParameters getNext(JobParameters parameters) {
        if (parameters==null || parameters.isEmpty()) {
            return new JobParametersBuilder().addLong("run.id", 1L).toJobParameters();
        }
        long id = parameters.getLong("run.id",1L) + 1;
        return new JobParametersBuilder().addLong("run.id", id).toJobParameters();
    }
}

 

In this example, the value with a key of run.id is used to discriminate between JobInstances. If the JobParameters passed in is null, it can be assumed that the Job has never been run before and, thus, its initial state can be returned. However, if not, the old value is obtained, incremented by one, and returned.

 

For jobs defined in Java, you can associate an incrementer with a Job through the incrementer method provided in the builders, as follows:

 

@Bean
public Job footballJob(JobRepository jobRepository) {
    return new JobBuilder("footballJob", jobRepository)
    				 .incrementer(sampleIncrementer())
    				 ...
                     .build();
}
Copied
728x90

Historically, offline processing (such as batch jobs) has been launched from the command-line, as described earlier. However, there are many cases where launching from an HttpRequest is a better option. Many such use cases include reporting, ad-hoc job running, and web application support. Because a batch job (by definition) is long running, the most important concern is to launch the job asynchronously:

 

Figure 1. Asynchronous Job Launcher Sequence From Web Container

 

 

The controller in this case is a Spring MVC controller. See the Spring Framework Reference Guide for more about Spring MVC. The controller launches a Job by using a JobLauncher that has been configured to launch asynchronously, which immediately returns a JobExecution. The Job is likely still running. However, this nonblocking behavior lets the controller return immediately, which is required when handling an HttpRequest. The following listing shows an example:

@Controller
public class JobLauncherController {

    @Autowired
    JobLauncher jobLauncher;

    @Autowired
    Job job;

    @RequestMapping("/jobLauncher.html")
    public void handle() throws Exception{
        jobLauncher.run(job, new JobParameters());
    }
}
Copied!

 

'Java > Spring Boot JPA' 카테고리의 다른 글

not importing JSONException and JSONObject issue  (0) 2024.04.04
JobParametersIncrementer  (0) 2024.04.03
Builder and AllArgsConstructor Annotation  (31) 2024.04.02
Item Processing in Spring Batch  (0) 2024.04.01
ItemReaders and ItemWriters  (31) 2024.03.27

+ Recent posts