Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Akila94 committed Jan 4, 2024
1 parent ed5acd5 commit fc97e57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
public class CertCache implements ManageableCache {

private static volatile CertCache cache;
private static volatile Map<String, TempCacheValue> hashMap = new ConcurrentHashMap<String, TempCacheValue>();
private static volatile Iterator<Map.Entry<String, TempCacheValue>> iterator = hashMap.entrySet().iterator();
private static volatile Map<String, CertCacheValue> hashMap = new ConcurrentHashMap<String, CertCacheValue>();
private static volatile Iterator<Map.Entry<String, CertCacheValue>> iterator = hashMap.entrySet().iterator();
private static volatile CacheManager cacheManager;
private static final Log log = LogFactory.getLog(CertCache.class);

Expand Down Expand Up @@ -74,7 +74,7 @@ public void init(int size, int delay) {
}

public synchronized X509Certificate getCacheValue(String serialNumber) {
CertCache.TempCacheValue cacheValue = hashMap.get(serialNumber);
CertCacheValue cacheValue = hashMap.get(serialNumber);
if (cacheValue != null) {
return cacheValue.getValue();
} else
Expand Down Expand Up @@ -112,7 +112,7 @@ public static void resetCache() {
}

public synchronized void setCacheValue(String serialNumber, X509Certificate cert) {
CertCache.TempCacheValue cacheValue = new CertCache.TempCacheValue(serialNumber, cert);
CertCacheValue cacheValue = new CertCacheValue(serialNumber, cert);

if (log.isDebugEnabled()) {
log.debug("Before set - HashMap size " + hashMap.size());
Expand All @@ -137,13 +137,13 @@ public synchronized void removeCacheValue(String serialNumber) {
/**
* This is the wrapper class of the actual cache value which is a X509CRL.
*/
private class TempCacheValue implements ManageableCacheValue {
private class CertCacheValue implements ManageableCacheValue {

private final String serialNumber;
private final X509Certificate issuerCertificate;
private final long timeStamp = System.currentTimeMillis();

public TempCacheValue(String serialNumber, X509Certificate issuerCertificate) {
public CertCacheValue(String serialNumber, X509Certificate issuerCertificate) {

this.serialNumber = serialNumber;
this.issuerCertificate = issuerCertificate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public ClientConnFactoryBuilder parseSSL() throws AxisFault {
final Parameter cvp = transportOut.getParameter("CertificateRevocationVerifier");
final String cvEnable = cvp != null ?
cvp.getParameterElement().getAttribute(new QName("enable")).getAttributeValue() : null;
CertificateVerificationManager revocationVerifier = null;
CertificateVerificationManager certificateVerifier = null;

if ("true".equalsIgnoreCase(cvEnable)) {
String cacheSizeString = cvp.getParameterElement().getFirstChildWithName(new QName("CacheSize")).getText();
Expand All @@ -142,7 +142,7 @@ public ClientConnFactoryBuilder parseSSL() throws AxisFault {
cacheDelay = new Integer(cacheDelayString);
} catch (NumberFormatException e) {
}
revocationVerifier = new CertificateVerificationManager(cacheSize, cacheDelay);
certificateVerifier = new CertificateVerificationManager(cacheSize, cacheDelay);
}

// Process HttpProtocols
Expand All @@ -163,7 +163,7 @@ public ClientConnFactoryBuilder parseSSL() throws AxisFault {
}

// Initiated separately to cater setting https protocols
ClientSSLSetupHandler clientSSLSetupHandler = new ClientSSLSetupHandler(hostnameVerifier, revocationVerifier);
ClientSSLSetupHandler clientSSLSetupHandler = new ClientSSLSetupHandler(hostnameVerifier, certificateVerifier);

if (null != httpsProtocols) {
clientSSLSetupHandler.setHttpsProtocols(httpsProtocols);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
t-0-1704257728276.txt 03/01/2024/ 10:25:28
in 03/01/2024/ 13:29:16
t-0-1704268757607.txt 03/01/2024/ 13:29:17
t-0-1704336995522.txt 04/01/2024/ 08:26:35

0 comments on commit fc97e57

Please sign in to comment.