Skip to content

Commit

Permalink
Refactor OCSPEngine.initSubsystem()
Browse files Browse the repository at this point in the history
The code in OCSPEngine.initSubsystem() that initializes the OCSP
authority has been moved into initSubsystems().
  • Loading branch information
edewata committed Feb 1, 2024
1 parent 5c0ba66 commit 02c0413
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions base/ocsp/src/main/java/org/dogtagpki/server/ocsp/OCSPEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,34 @@ public void initDBSubsystem() throws Exception {
dbSubsystem.setCMSEngine(this);
dbSubsystem.setEngineConfig(config);
}

@Override
public void initSubsystems() throws Exception {

OCSPEngineConfig engineConfig = getConfig();
OCSPConfig ocspConfig = engineConfig.getOCSPConfig();

OCSPAuthority authority = (OCSPAuthority) subsystems.get(OCSPAuthority.ID);
authority.init(ocspConfig);

if (!isPreOpMode()) {
authority.startup();
}

super.initSubsystems();
}

@Override
public void initSubsystem(Subsystem subsystem, ConfigStore subsystemConfig) throws Exception {

if (subsystem instanceof OCSPAuthority) {
// skip initialization during installation
if (isPreOpMode()) return;
// already initialized in initSubsystems()
return;
}

super.initSubsystem(subsystem, subsystemConfig);
if (subsystem instanceof OCSPAuthority) {
subsystem.startup();
}
}


@Override
protected void startupSubsystems() throws Exception {

Expand Down

0 comments on commit 02c0413

Please sign in to comment.