diff options
author | Adam Young <ayoung@redhat.com> | 2011-11-17 12:27:31 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-12-22 16:39:30 -0500 |
commit | 6373ddf8fdb15ecd841735910da728e55ad9582a (patch) | |
tree | dca05e58ab87470bf91345af46133a096f7707c7 /pki/base/common/src/com/netscape/cms/profile/common | |
parent | fd669390a16a0bce341df685c990f3159df11d53 (diff) | |
download | pki-6373ddf8fdb15ecd841735910da728e55ad9582a.tar.gz pki-6373ddf8fdb15ecd841735910da728e55ad9582a.tar.xz pki-6373ddf8fdb15ecd841735910da728e55ad9582a.zip |
type safety for certserv.base
more type safety
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/profile/common')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java | 60 | ||||
-rw-r--r-- | pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java | 4 |
2 files changed, 31 insertions, 33 deletions
diff --git a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java index acaf9772a..68c706f5f 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/BasicProfile.java @@ -83,19 +83,19 @@ public abstract class BasicProfile implements IProfile { protected IConfigStore mConfig = null; protected IPluginRegistry mRegistry = null; - protected Vector mInputNames = new Vector(); - protected Hashtable mInputs = new Hashtable(); - protected Vector mInputIds = new Vector(); - protected Hashtable mOutputs = new Hashtable(); - protected Vector mOutputIds = new Vector(); - protected Hashtable mUpdaters = new Hashtable(); - protected Vector mUpdaterIds = new Vector(); + protected Vector<String> mInputNames = new Vector<String>(); + protected Hashtable<String, IProfileInput> mInputs = new Hashtable<String, IProfileInput>(); + protected Vector<String> mInputIds = new Vector<String>(); + protected Hashtable<String, IProfileOutput> mOutputs = new Hashtable<String, IProfileOutput>(); + protected Vector<String> mOutputIds = new Vector<String>(); + protected Hashtable<String, IProfileUpdater> mUpdaters = new Hashtable<String, IProfileUpdater>(); + protected Vector<String> mUpdaterIds = new Vector<String>(); protected IProfileAuthenticator mAuthenticator = null; protected String mAuthInstanceId = null; protected String mId = null; protected String mAuthzAcl = ""; - protected Hashtable mPolicySet = new Hashtable(); + protected Hashtable<String, Vector<ProfilePolicy>> mPolicySet = new Hashtable<String, Vector<ProfilePolicy>>(); protected ILogger mSignedAuditLogger = CMS.getSignedAuditLogger(); @@ -343,11 +343,11 @@ public abstract class BasicProfile implements IProfile { return mConfig; } - public Enumeration getInputNames() { + public Enumeration<String> getInputNames() { return mInputNames.elements(); } - public Enumeration getProfileUpdaterIds() { + public Enumeration<String> getProfileUpdaterIds() { return mUpdaterIds.elements(); // ordered list } @@ -355,7 +355,7 @@ public abstract class BasicProfile implements IProfile { return (IProfileUpdater) mUpdaters.get(name); } - public Enumeration getProfileOutputIds() { + public Enumeration<String> getProfileOutputIds() { return mOutputIds.elements(); // ordered list } @@ -363,7 +363,7 @@ public abstract class BasicProfile implements IProfile { return (IProfileOutput) mOutputs.get(name); } - public Enumeration getProfileInputIds() { + public Enumeration<String> getProfileInputIds() { return mInputIds.elements(); // ordered list } @@ -388,13 +388,13 @@ public abstract class BasicProfile implements IProfile { String value) throws EProfileException { } - public Enumeration getProfilePolicySetIds() { + public Enumeration<String> getProfilePolicySetIds() { return mPolicySet.keys(); } public void deleteProfilePolicy(String setId, String policyId) throws EProfileException { - Vector policies = (Vector) mPolicySet.get(setId); + Vector<ProfilePolicy> policies = mPolicySet.get(setId); if (policies == null) { return; @@ -621,7 +621,7 @@ public abstract class BasicProfile implements IProfile { outputInfo.getName(Locale.getDefault())); outputStore.putString(prefix + "class_id", outputId); - Enumeration enum1 = nvps.getNames(); + Enumeration<String> enum1 = nvps.getNames(); while (enum1.hasMoreElements()) { String name = (String) enum1.nextElement(); @@ -724,7 +724,7 @@ public abstract class BasicProfile implements IProfile { inputInfo.getName(Locale.getDefault())); inputStore.putString(prefix + "class_id", inputId); - Enumeration enum1 = nvps.getNames(); + Enumeration<String> enum1 = nvps.getNames(); while (enum1.hasMoreElements()) { String name = (String) enum1.nextElement(); @@ -772,16 +772,16 @@ public abstract class BasicProfile implements IProfile { // String constraintClassId : if of the constraint plugin ex: basicConstraintsExtConstraintImpl // boolean createConfig : true : being called from the console. false: being called from server startup code - Vector policies = (Vector) mPolicySet.get(setId); + Vector<ProfilePolicy> policies = mPolicySet.get(setId); IConfigStore policyStore = mConfig.getSubStore("policyset." + setId); if (policies == null) { - policies = new Vector(); + policies = new Vector<ProfilePolicy>(); mPolicySet.put(setId, policies); if (createConfig) { // re-create policyset.list StringBuffer setlist =new StringBuffer(); - Enumeration keys = mPolicySet.keys(); + Enumeration<String> keys = mPolicySet.keys(); while (keys.hasMoreElements()) { String k = (String) keys.nextElement(); @@ -990,7 +990,7 @@ public abstract class BasicProfile implements IProfile { } public IProfilePolicy getProfilePolicy(String setId, String id) { - Vector policies = (Vector) mPolicySet.get(setId); + Vector<ProfilePolicy> policies = mPolicySet.get(setId); if (policies == null) return null; @@ -1057,7 +1057,7 @@ public abstract class BasicProfile implements IProfile { public void populateInput(IProfileContext ctx, IRequest request) throws EProfileException { - Enumeration ids = getProfileInputIds(); + Enumeration<String> ids = getProfileInputIds(); while (ids.hasMoreElements()) { String id = (String) ids.nextElement(); @@ -1067,8 +1067,8 @@ public abstract class BasicProfile implements IProfile { } } - public Vector getPolicies(String setId) { - Vector policies = (Vector) mPolicySet.get(setId); + public Vector<ProfilePolicy> getPolicies(String setId) { + Vector<ProfilePolicy> policies = mPolicySet.get(setId); return policies; } @@ -1080,7 +1080,7 @@ public abstract class BasicProfile implements IProfile { public void populate(IRequest request) throws EProfileException { String setId = getPolicySetId(request); - Vector policies = getPolicies(setId); + Vector<ProfilePolicy> policies = getPolicies(setId); CMS.debug("BasicProfile: populate() policy setid ="+ setId); for (int i = 0; i < policies.size(); i++) { @@ -1099,7 +1099,7 @@ public abstract class BasicProfile implements IProfile { throws ERejectException { String setId = getPolicySetId(request); CMS.debug("BasicProfile: validate start on setId="+ setId); - Vector policies = getPolicies(setId); + Vector<ProfilePolicy> policies = getPolicies(setId); for (int i = 0; i < policies.size(); i++) { ProfilePolicy policy = (ProfilePolicy) @@ -1112,21 +1112,21 @@ public abstract class BasicProfile implements IProfile { CMS.debug("BasicProfile: validate end"); } - public Enumeration getProfilePolicies(String setId) { - Vector policies = (Vector) mPolicySet.get(setId); + public Enumeration<ProfilePolicy> getProfilePolicies(String setId) { + Vector<ProfilePolicy> policies = mPolicySet.get(setId); if (policies == null) return null; return policies.elements(); } - public Enumeration getProfilePolicyIds(String setId) { - Vector policies = (Vector) mPolicySet.get(setId); + public Enumeration<String> getProfilePolicyIds(String setId) { + Vector<ProfilePolicy> policies = mPolicySet.get(setId); if (policies == null) return null; - Vector v = new Vector(); + Vector<String> v = new Vector<String>(); for (int i = 0; i < policies.size(); i++) { ProfilePolicy policy = (ProfilePolicy) diff --git a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java index 95c360f8c..8bc6f1903 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/EnrollProfile.java @@ -28,7 +28,6 @@ import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.util.Date; import java.util.Enumeration; -import java.util.Hashtable; import java.util.Locale; import java.util.StringTokenizer; @@ -281,7 +280,7 @@ public abstract class EnrollProfile extends BasicProfile int seq_no = seq.intValue(); // start from 0 int count = 0; - Enumeration setIds = getProfilePolicySetIds(); + Enumeration<String> setIds = getProfilePolicySetIds(); while (setIds.hasMoreElements()) { String setId = (String) setIds.nextElement(); @@ -369,7 +368,6 @@ public abstract class EnrollProfile extends BasicProfile } CMS.debug("EnrollProfile: Start parseCMC(): " + certreq); - Hashtable t1 = new Hashtable(); TaggedRequest msgs[] = null; String creq = normalizeCertReq(certreq); |