Skip to content

Commit

Permalink
Move CAEngine.addCA() to AuthorityMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Oct 3, 2023
1 parent 4b48613 commit cf1eed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions base/ca/src/main/java/com/netscape/ca/AuthorityMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ private synchronized void handleDELETE(LDAPEntry entry) {
}
}

public void addCA(AuthorityID aid, CertificateAuthority ca) {
authorities.put(aid, ca);
}

public synchronized void trackUpdate(AuthorityID aid, LDAPControl[] responseControls) {

LDAPPostReadControl control = (LDAPPostReadControl)
Expand Down
10 changes: 3 additions & 7 deletions base/ca/src/main/java/org/dogtagpki/server/ca/CAEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public void initAuthorityMonitor() throws Exception {
if (!authorityMonitor.foundHostCA) {
logger.debug("CAEngine: No entry for host authority");
logger.debug("CAEngine: Adding entry for host authority");
addCA(addHostAuthorityEntry(), hostCA);
authorityMonitor.addCA(addHostAuthorityEntry(), hostCA);
}
}

Expand Down Expand Up @@ -1013,10 +1013,6 @@ public CertificateAuthority getCA(X500Name dn) {
return null;
}

public void addCA(AuthorityID aid, CertificateAuthority ca) {
authorityMonitor.authorities.put(aid, ca);
}

public void removeCA(AuthorityID aid) {
authorityMonitor.authorities.remove(aid);
authorityMonitor.entryUSNs.remove(aid);
Expand Down Expand Up @@ -1371,7 +1367,7 @@ public synchronized void readAuthority(LDAPEntry entry) throws Exception {
logger.info("CAEngine: - description: " + desc);
hostCA.setAuthorityDescription(desc);

addCA(aid, hostCA);
authorityMonitor.addCA(aid, hostCA);

return;
}
Expand Down Expand Up @@ -1456,7 +1452,7 @@ public synchronized void readAuthority(LDAPEntry entry) throws Exception {
ca.setCMSEngine(this);
ca.init(caConfig);

addCA(aid, ca);
authorityMonitor.addCA(aid, ca);
authorityMonitor.entryUSNs.put(aid, newEntryUSN);
authorityMonitor.nsUniqueIds.put(aid, nsUniqueId);

Expand Down

0 comments on commit cf1eed9

Please sign in to comment.