diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-27 09:36:14 -0600 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-12 12:45:05 -0500 |
commit | 0bc851bff69ef174b11cf147aeb1289c43de0666 (patch) | |
tree | 08daf5662ba4fc31d04947e887e7929b87e185c4 /pki/base/common/src/com/netscape/cms/crl | |
parent | c0b210a15ef43873b52c1c9fbec73eba48155b4b (diff) | |
download | pki-0bc851bff69ef174b11cf147aeb1289c43de0666.tar.gz pki-0bc851bff69ef174b11cf147aeb1289c43de0666.tar.xz pki-0bc851bff69ef174b11cf147aeb1289c43de0666.zip |
Refactored NameValuePairs.
The NameValuePairs class has been modified to extend the Linked-
HashMap which preserves the order of elements as in the original
code. Some methods are renamed to match Java Map interface. The
NameValuePair class is no longer needed and has been removed.
Ticket #78
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/crl')
6 files changed, 35 insertions, 35 deletions
diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSAuthInfoAccessExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSAuthInfoAccessExtension.java index d070cc6fd..d4cef0148 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSAuthInfoAccessExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSAuthInfoAccessExtension.java @@ -159,7 +159,7 @@ public class CMSAuthInfoAccessExtension } catch (EBaseException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_CREATE_AIA_INVALID_NUM_ADS", e.toString())); } - nvp.add(PROP_NUM_ADS, String.valueOf(numberOfAccessDescriptions)); + nvp.put(PROP_NUM_ADS, String.valueOf(numberOfAccessDescriptions)); for (int i = 0; i < numberOfAccessDescriptions; i++) { String accessMethod = null; @@ -175,9 +175,9 @@ public class CMSAuthInfoAccessExtension } if (accessMethod != null && accessMethod.length() > 0) { - nvp.add(PROP_ACCESS_METHOD + i, accessMethod); + nvp.put(PROP_ACCESS_METHOD + i, accessMethod); } else { - nvp.add(PROP_ACCESS_METHOD + i, PROP_ACCESS_METHOD_CAISSUERS); + nvp.put(PROP_ACCESS_METHOD + i, PROP_ACCESS_METHOD_CAISSUERS); } try { @@ -189,9 +189,9 @@ public class CMSAuthInfoAccessExtension } if (accessLocationType != null && accessLocationType.length() > 0) { - nvp.add(PROP_ACCESS_LOCATION_TYPE + i, accessLocationType); + nvp.put(PROP_ACCESS_LOCATION_TYPE + i, accessLocationType); } else { - nvp.add(PROP_ACCESS_LOCATION_TYPE + i, PROP_URINAME); + nvp.put(PROP_ACCESS_LOCATION_TYPE + i, PROP_URINAME); } try { @@ -203,14 +203,14 @@ public class CMSAuthInfoAccessExtension } if (accessLocation != null && accessLocation.length() > 0) { - nvp.add(PROP_ACCESS_LOCATION + i, accessLocation); + nvp.put(PROP_ACCESS_LOCATION + i, accessLocation); } else { String hostname = CMS.getEENonSSLHost(); String port = CMS.getEENonSSLPort(); if (hostname != null && port != null) { accessLocation = "http://" + hostname + ":" + port + "/ca/ee/ca/getCAChain?op=downloadBIN"; } - nvp.add(PROP_ACCESS_LOCATION + i, accessLocation); + nvp.put(PROP_ACCESS_LOCATION + i, accessLocation); } } } diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSCertificateIssuerExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSCertificateIssuerExtension.java index 67f4736c7..b0bf20856 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSCertificateIssuerExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSCertificateIssuerExtension.java @@ -149,7 +149,7 @@ public class CMSCertificateIssuerExtension } catch (EBaseException e) { log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_CREATE_INVALID_NUM_NAMES", e.toString())); } - nvp.add("numNames", String.valueOf(numNames)); + nvp.put("numNames", String.valueOf(numNames)); for (int i = 0; i < numNames; i++) { String nameType = null; @@ -164,9 +164,9 @@ public class CMSCertificateIssuerExtension } if (nameType != null && nameType.length() > 0) { - nvp.add("nameType" + i, nameType); + nvp.put("nameType" + i, nameType); } else { - nvp.add("nameType" + i, ""); + nvp.put("nameType" + i, ""); } String name = null; @@ -181,16 +181,16 @@ public class CMSCertificateIssuerExtension } if (name != null && name.length() > 0) { - nvp.add("name" + i, name); + nvp.put("name" + i, name); } else { - nvp.add("name" + i, ""); + nvp.put("name" + i, ""); } } if (numNames < 3) { for (int i = numNames; i < 3; i++) { - nvp.add("nameType" + i, ""); - nvp.add("name" + i, ""); + nvp.put("nameType" + i, ""); + nvp.put("name" + i, ""); } } } diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSFreshestCRLExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSFreshestCRLExtension.java index edb6494af..72dbe5502 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSFreshestCRLExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSFreshestCRLExtension.java @@ -157,7 +157,7 @@ public class CMSFreshestCRLExtension log(ILogger.LL_FAILURE, "Invalid numPoints property for CRL " + "Freshest CRL extension - " + e); } - nvp.add(PROP_NUM_POINTS, String.valueOf(numPoints)); + nvp.put(PROP_NUM_POINTS, String.valueOf(numPoints)); for (int i = 0; i < numPoints; i++) { String pointType = null; @@ -171,9 +171,9 @@ public class CMSFreshestCRLExtension } if (pointType != null && pointType.length() > 0) { - nvp.add(PROP_POINTTYPE + i, pointType); + nvp.put(PROP_POINTTYPE + i, pointType); } else { - nvp.add(PROP_POINTTYPE + i, ""); + nvp.put(PROP_POINTTYPE + i, ""); } String pointName = null; @@ -187,9 +187,9 @@ public class CMSFreshestCRLExtension } if (pointName != null && pointName.length() > 0) { - nvp.add(PROP_POINTNAME + i, pointName); + nvp.put(PROP_POINTNAME + i, pointName); } else { - nvp.add(PROP_POINTNAME + i, ""); + nvp.put(PROP_POINTNAME + i, ""); } } } diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSHoldInstructionExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSHoldInstructionExtension.java index df8d058ce..4023e3b2f 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSHoldInstructionExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSHoldInstructionExtension.java @@ -123,7 +123,7 @@ public class CMSHoldInstructionExtension } else { instruction = PROP_INSTR_NONE; } - nvp.add(PROP_INSTR, instruction); + nvp.put(PROP_INSTR, instruction); } public String[] getExtendedPluginInfo(Locale locale) { diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSIssuerAlternativeNameExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSIssuerAlternativeNameExtension.java index ee656a199..64252a0b9 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSIssuerAlternativeNameExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSIssuerAlternativeNameExtension.java @@ -200,7 +200,7 @@ public class CMSIssuerAlternativeNameExtension log(ILogger.LL_FAILURE, "Invalid numNames property for CRL " + "IssuerAlternativeName extension - " + e); } - nvp.add("numNames", String.valueOf(numNames)); + nvp.put("numNames", String.valueOf(numNames)); for (int i = 0; i < numNames; i++) { String nameType = null; @@ -216,9 +216,9 @@ public class CMSIssuerAlternativeNameExtension } if (nameType != null && nameType.length() > 0) { - nvp.add("nameType" + i, nameType); + nvp.put("nameType" + i, nameType); } else { - nvp.add("nameType" + i, ""); + nvp.put("nameType" + i, ""); } String name = null; @@ -234,16 +234,16 @@ public class CMSIssuerAlternativeNameExtension } if (name != null && name.length() > 0) { - nvp.add("name" + i, name); + nvp.put("name" + i, name); } else { - nvp.add("name" + i, ""); + nvp.put("name" + i, ""); } } if (numNames < 3) { for (int i = numNames; i < 3; i++) { - nvp.add("nameType" + i, ""); - nvp.add("name" + i, ""); + nvp.put("nameType" + i, ""); + nvp.put("name" + i, ""); } } } diff --git a/pki/base/common/src/com/netscape/cms/crl/CMSIssuingDistributionPointExtension.java b/pki/base/common/src/com/netscape/cms/crl/CMSIssuingDistributionPointExtension.java index 21bd86b0a..4253584ce 100644 --- a/pki/base/common/src/com/netscape/cms/crl/CMSIssuingDistributionPointExtension.java +++ b/pki/base/common/src/com/netscape/cms/crl/CMSIssuingDistributionPointExtension.java @@ -229,9 +229,9 @@ public class CMSIssuingDistributionPointExtension log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_CREATE_DIST_POINT_INVALID", e.toString())); } if (pointType != null && pointType.length() > 0) { - nvp.add("pointType", pointType); + nvp.put("pointType", pointType); } else { - nvp.add("pointType", ""); + nvp.put("pointType", ""); } String pointName = null; @@ -244,9 +244,9 @@ public class CMSIssuingDistributionPointExtension log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_CREATE_DIST_POINT_INVALID", e.toString())); } if (pointName != null && pointName.length() > 0) { - nvp.add("pointName", pointName); + nvp.put("pointName", pointName); } else { - nvp.add("pointName", ""); + nvp.put("pointName", ""); } String reasons = null; @@ -257,17 +257,17 @@ public class CMSIssuingDistributionPointExtension log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_INVALID_PROPERTY", PROP_REASONS, e.toString())); } if (reasons != null && reasons.length() > 0) { - nvp.add(PROP_REASONS, reasons); + nvp.put(PROP_REASONS, reasons); } else { - nvp.add(PROP_REASONS, ""); + nvp.put(PROP_REASONS, ""); } try { boolean caCertsOnly = config.getBoolean(PROP_CACERTS, false); - nvp.add(PROP_CACERTS, String.valueOf(caCertsOnly)); + nvp.put(PROP_CACERTS, String.valueOf(caCertsOnly)); } catch (EBaseException e) { - nvp.add(PROP_CACERTS, "false"); + nvp.put(PROP_CACERTS, "false"); log(ILogger.LL_FAILURE, CMS.getLogMessage("CRL_INVALID_PROPERTY", "caCertsOnly", e.toString())); } // Disable these for now unitl we support them fully |