Skip to content

Commit

Permalink
Move CAEngine.removeCA() to AuthorityMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Oct 3, 2023
1 parent cf1eed9 commit 82f0ed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 8 additions & 2 deletions base/ca/src/main/java/com/netscape/ca/AuthorityMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private synchronized void handleMODDN(DN oldDN, LDAPEntry entry) throws Exceptio
LDAPAttribute attr = entry.getAttribute("authorityID");
if (attr != null) {
AuthorityID aid = new AuthorityID(attr.getStringValueArray()[0]);
engine.removeCA(aid);
removeCA(aid);
}

} else if (!wasMonitored && isMonitored) {
Expand Down Expand Up @@ -275,14 +275,20 @@ private synchronized void handleDELETE(LDAPEntry entry) {
+ "for authority '" + aid + "': " + e.getMessage(), e);
}

engine.removeCA(aid);
removeCA(aid);
}
}

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

public void removeCA(AuthorityID aid) {
authorities.remove(aid);
entryUSNs.remove(aid);
nsUniqueIds.remove(aid);
}

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

LDAPPostReadControl control = (LDAPPostReadControl)
Expand Down
8 changes: 1 addition & 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 @@ -1013,12 +1013,6 @@ public CertificateAuthority getCA(X500Name dn) {
return null;
}

public void removeCA(AuthorityID aid) {
authorityMonitor.authorities.remove(aid);
authorityMonitor.entryUSNs.remove(aid);
authorityMonitor.nsUniqueIds.remove(aid);
}

public void ensureAuthorityDNAvailable(X500Name dn)
throws IssuerUnavailableException {

Expand Down Expand Up @@ -1308,7 +1302,7 @@ public synchronized void deleteAuthorityEntry(AuthorityID aid) throws EBaseExcep
authorityMonitor.deletedNsUniqueIds.add(nsUniqueId);
}

removeCA(aid);
authorityMonitor.removeCA(aid);
}

public synchronized void readAuthority(LDAPEntry entry) throws Exception {
Expand Down

0 comments on commit 82f0ed0

Please sign in to comment.