>From aa3e642673c732a1864e3e32090de77de90f97b8 Mon Sep 17 00:00:00 2001
From: Adam Young <ayoung@redhat.com>
Date: Fri, 18 Nov 2011 15:03:44 -0500
Subject: [PATCH 43/45] type safety  certserv cms and cmscore

---
 pki/base/common/src/CMakeLists.txt                 |    2 -
 .../certsrv/notification/IEmailFormProcessor.java  |    4 +-
 .../certsrv/notification/IMailNotification.java    |    2 +-
 .../certsrv/pattern/AttrSetCollection.java         |    2 +-
 .../src/com/netscape/certsrv/pattern/Pattern.java  |    2 +-
 .../certsrv/policy/IGeneralNameConfig.java         |    2 +-
 .../netscape/certsrv/policy/IPolicyProcessor.java  |   16 ++--
 .../com/netscape/certsrv/policy/IPolicyRule.java   |    4 +-
 .../com/netscape/certsrv/policy/IPolicySet.java    |    2 +-
 .../netscape/certsrv/profile/CertInfoProfile.java  |    4 +-
 .../netscape/certsrv/profile/IPolicyDefault.java   |    2 +-
 .../src/com/netscape/certsrv/profile/IProfile.java |   11 +-
 .../certsrv/profile/IProfileAuthenticator.java     |    2 +-
 .../netscape/certsrv/profile/IProfileInput.java    |    2 +-
 .../netscape/certsrv/profile/IProfileOutput.java   |    2 +-
 .../certsrv/profile/IProfileSubsystem.java         |    2 +-
 .../netscape/certsrv/property/IConfigTemplate.java |    2 +-
 .../com/netscape/certsrv/property/PropertySet.java |    4 +-
 .../netscape/certsrv/publish/ILdapCertMapper.java  |   71 -----------
 .../netscape/certsrv/publish/IPublishRuleSet.java  |  124 --------------------
 .../certsrv/ra/IRegistrationAuthority.java         |    2 +-
 .../netscape/certsrv/registry/IPluginRegistry.java |    4 +-
 .../src/com/netscape/certsrv/request/IRequest.java |    2 +-
 .../com/netscape/certsrv/usrgrp/IUGSubsystem.java  |    6 +-
 .../authentication/UidPwdPinDirAuthentication.java |    4 +-
 .../cms/notification/MailNotification.java         |    2 +-
 .../netscape/cms/profile/def/EnrollDefault.java    |   22 ++--
 .../cms/profile/def/NameConstraintsExtDefault.java |    2 +-
 .../netscape/cms/profile/input/SubjectDNInput.java |    4 +-
 .../netscape/cms/profile/output/EnrollOutput.java  |    8 +-
 .../cms/servlet/admin/ProfileAdminServlet.java     |   74 +++++++-----
 .../cms/servlet/admin/RegistryAdminServlet.java    |   10 +-
 .../com/netscape/cms/servlet/base/CMSServlet.java  |    8 +-
 .../cms/servlet/profile/ProfileProcessServlet.java |    4 +-
 .../cmscore/notification/EmailFormProcessor.java   |   18 ++--
 .../cmscore/policy/GenericPolicyProcessor.java     |  104 ++++++++---------
 .../src/com/netscape/cmscore/policy/PolicySet.java |    6 +-
 .../netscape/cmscore/profile/ProfileSubsystem.java |   10 +-
 .../netscape/cmscore/registry/PluginRegistry.java  |   24 ++--
 .../netscape/cmscore/request/ARequestQueue.java    |    6 +-
 .../cmscore/selftests/SelfTestSubsystem.java       |   40 +++---
 .../src/com/netscape/cmscore/usrgrp/Group.java     |   13 +-
 .../com/netscape/cmscore/usrgrp/UGSubsystem.java   |   79 +++++++------
 43 files changed, 269 insertions(+), 445 deletions(-)
 delete mode 100644 pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java
 delete mode 100644 pki/base/common/src/com/netscape/certsrv/publish/IPublishRuleSet.java

diff --git a/pki/base/common/src/CMakeLists.txt b/pki/base/common/src/CMakeLists.txt
index 12e401d8fac4b624503de77b2c65aa6244133317..a2527d2eee04144750353a8396824fab4221320b 100644
--- a/pki/base/common/src/CMakeLists.txt
+++ b/pki/base/common/src/CMakeLists.txt
@@ -111,9 +111,7 @@ set(pki-certsrv_java_SRCS
     com/netscape/certsrv/publish/ILdapRule.java
     com/netscape/certsrv/publish/IPublisherProcessor.java
     com/netscape/certsrv/publish/LdapCertMapResult.java
-    com/netscape/certsrv/publish/IPublishRuleSet.java
     com/netscape/certsrv/publish/ILdapExpression.java
-    com/netscape/certsrv/publish/ILdapCertMapper.java
     com/netscape/certsrv/publish/ILdapMapper.java
     com/netscape/certsrv/publish/PublisherPlugin.java
     com/netscape/certsrv/publish/ERulePluginNotFound.java
diff --git a/pki/base/common/src/com/netscape/certsrv/notification/IEmailFormProcessor.java b/pki/base/common/src/com/netscape/certsrv/notification/IEmailFormProcessor.java
index 9d7ee46f067effe00baac889e08a606b70ce8541..ace09a8cfe36bb500485dc2f62797efc809218cb 100644
--- a/pki/base/common/src/com/netscape/certsrv/notification/IEmailFormProcessor.java
+++ b/pki/base/common/src/com/netscape/certsrv/notification/IEmailFormProcessor.java
@@ -67,12 +67,12 @@ public interface IEmailFormProcessor {
      * @return mail content
      */
     public String getEmailContent(String form,
-        Hashtable tok2vals);
+        Hashtable<String, Object> tok2vals);
 
     /**
      * takes a vector of strings and concatenate them
      */
-    public String formContent(Vector vec);
+    public String formContent(Vector<String> vec);
 
     /**
      * logs an entry in the log file.
diff --git a/pki/base/common/src/com/netscape/certsrv/notification/IMailNotification.java b/pki/base/common/src/com/netscape/certsrv/notification/IMailNotification.java
index c5375caed8006bdcad95f9676d4a9a4c4062b637..b537fbbd2cc6e0d4e080008c7bbb03cdb78e04d0 100644
--- a/pki/base/common/src/com/netscape/certsrv/notification/IMailNotification.java
+++ b/pki/base/common/src/com/netscape/certsrv/notification/IMailNotification.java
@@ -65,7 +65,7 @@ public interface IMailNotification {
      * sets the recipients' email addresses
      * @param addresses a list of email addresses of the recipients
      */
-    public void setTo(Vector addresses);
+    public void setTo(Vector<String> addresses);
 
     /**
      * sets the recipient's email address
diff --git a/pki/base/common/src/com/netscape/certsrv/pattern/AttrSetCollection.java b/pki/base/common/src/com/netscape/certsrv/pattern/AttrSetCollection.java
index 2a9a87e39564690f44676daee4b8c4c764efdf6c..22cfc232c12b2327506634526f2b25ef5492cf19 100644
--- a/pki/base/common/src/com/netscape/certsrv/pattern/AttrSetCollection.java
+++ b/pki/base/common/src/com/netscape/certsrv/pattern/AttrSetCollection.java
@@ -28,7 +28,7 @@ import com.netscape.certsrv.base.IAttrSet;
  *
  * @version $Revision$, $Date$
  */
-public class AttrSetCollection extends Hashtable {
+public class AttrSetCollection extends Hashtable<String, IAttrSet> {
 
     /**
      *
diff --git a/pki/base/common/src/com/netscape/certsrv/pattern/Pattern.java b/pki/base/common/src/com/netscape/certsrv/pattern/Pattern.java
index d177f87b1280b399ceaf9aa9160b5ce39ed3052f..36cc7cb3bc5a359b841145edc4ae96c70aa158db 100644
--- a/pki/base/common/src/com/netscape/certsrv/pattern/Pattern.java
+++ b/pki/base/common/src/com/netscape/certsrv/pattern/Pattern.java
@@ -70,7 +70,7 @@ public class Pattern {
      */
     public String substitute(AttrSetCollection attrSetCollection) {
         String temp = mS;
-        Enumeration keys = attrSetCollection.keys();
+        Enumeration<String> keys = attrSetCollection.keys();
 
         while (keys.hasMoreElements()) {
             String key = (String) keys.nextElement();
diff --git a/pki/base/common/src/com/netscape/certsrv/policy/IGeneralNameConfig.java b/pki/base/common/src/com/netscape/certsrv/policy/IGeneralNameConfig.java
index 0d44be08166e6c2ca6c0b05f8e874d7cb5669b28..953bb41ea93cdfe283d3988dbcbf3ba95d92b514 100644
--- a/pki/base/common/src/com/netscape/certsrv/policy/IGeneralNameConfig.java
+++ b/pki/base/common/src/com/netscape/certsrv/policy/IGeneralNameConfig.java
@@ -56,7 +56,7 @@ public interface IGeneralNameConfig {
      * @return a vector of general names
      * @exception EBaseException failed to form general name
      */
-    public Vector formGeneralNames(Object value)
+    public Vector<GeneralName> formGeneralNames(Object value)
         throws EBaseException;
 
     /**
diff --git a/pki/base/common/src/com/netscape/certsrv/policy/IPolicyProcessor.java b/pki/base/common/src/com/netscape/certsrv/policy/IPolicyProcessor.java
index 834d462e0baa2f2b5032d6ec0befa17c4ff372a4..09f2415a1a375135051248645933cac9056bf09c 100644
--- a/pki/base/common/src/com/netscape/certsrv/policy/IPolicyProcessor.java
+++ b/pki/base/common/src/com/netscape/certsrv/policy/IPolicyProcessor.java
@@ -73,7 +73,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * 		   about policy implementations. Currently only the
      *		   the implementation id is expected.
      */
-    Enumeration getPolicyImplsInfo();
+    Enumeration<String> getPolicyImplsInfo();
 
     /**
      * Returns the rule implementations registered with this processor.
@@ -81,7 +81,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * @return An Enumeration of uninitialized IPolicyRule 
      *					objects.
      */
-    Enumeration getPolicyImpls();
+    Enumeration<IPolicyRule> getPolicyImpls();
 
     /**
      * Returns an implementation identified by a given id.
@@ -98,7 +98,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * @return A vector of name/value pairs in the form of
      *	name=value.
      */
-    Vector getPolicyImplConfig(String id);
+    Vector<String> getPolicyImplConfig(String id);
 
     /**
      * Deletes a policy implementation identified by an impl id.
@@ -129,14 +129,14 @@ public interface IPolicyProcessor extends ISubsystem,
      * @return An Enumeration of Strings describing the information 
      *			about policy rule instances.
      */
-    Enumeration getPolicyInstancesInfo();
+    Enumeration<String> getPolicyInstancesInfo();
 
     /**
      * Returns policy instances registered with this processor.
      *
      * @return An Enumeration of policy instances.
      */
-    Enumeration getPolicyInstances();
+    Enumeration<IPolicyRule>  getPolicyInstances();
 
     /**
      * Returns instance configuration for a given instance id.
@@ -145,7 +145,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * @return A vector of name/value pairs in the form of
      *	name=value.
      */
-    Vector getPolicyInstanceConfig(String id);
+    Vector<String>  getPolicyInstanceConfig(String id);
 
     /**
      * Returns instance configuration for a given instance id.
@@ -172,7 +172,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * @param ht a Hashtable of config params.
      * @exception EBaseException is thrown if an error occurs in addition.
      */
-    void addPolicyInstance(String id, Hashtable ht)
+    void addPolicyInstance(String id, Hashtable<String, String> ht)
         throws EBaseException;
 
     /**
@@ -183,7 +183,7 @@ public interface IPolicyProcessor extends ISubsystem,
      * @param ht a Hashtable of config params.
      * @exception EBaseException is thrown if an error occurs in addition.
      */
-    void modifyPolicyInstance(String id, Hashtable ht)
+    void modifyPolicyInstance(String id, Hashtable<String, String> ht)
         throws EBaseException;
 
     /**
diff --git a/pki/base/common/src/com/netscape/certsrv/policy/IPolicyRule.java b/pki/base/common/src/com/netscape/certsrv/policy/IPolicyRule.java
index d80a0d0c2f203752be68ab4212f01c2eaa359b48..0babd48aa8137686fce7bb35c374df4f5f371e47 100644
--- a/pki/base/common/src/com/netscape/certsrv/policy/IPolicyRule.java
+++ b/pki/base/common/src/com/netscape/certsrv/policy/IPolicyRule.java
@@ -110,7 +110,7 @@ public interface IPolicyRule
      * @return nvPairs A Vector of name/value pairs. Each name/value
      *				pair is constructed as a String in name=value format.
      */
-    public Vector getInstanceParams();
+    public Vector<String> getInstanceParams();
 
     /**
      * Return default parameters for a policy implementation.
@@ -118,7 +118,7 @@ public interface IPolicyRule
      * @return nvPairs A Vector of name/value pairs. Each name/value
      *		  		pair is constructed as a String in name=value.
      */
-    public Vector getDefaultParams();
+    public Vector<String>  getDefaultParams();
 
     public void setError(IRequest req, String format, Object[] params);
 
diff --git a/pki/base/common/src/com/netscape/certsrv/policy/IPolicySet.java b/pki/base/common/src/com/netscape/certsrv/policy/IPolicySet.java
index ea12f4b1be333504eb02f4b68db28c76bb007dbb..dd5a36bcabf3048306d68f65a3de93dfa62cc029 100644
--- a/pki/base/common/src/com/netscape/certsrv/policy/IPolicySet.java
+++ b/pki/base/common/src/com/netscape/certsrv/policy/IPolicySet.java
@@ -90,7 +90,7 @@ public interface IPolicySet {
      *
      * @return An enumeration of rules.
      */
-    Enumeration getRules();
+    Enumeration<IPolicyRule> getRules();
 
     /**
      * Apply policy rules on a request. This call may modify
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/CertInfoProfile.java b/pki/base/common/src/com/netscape/certsrv/profile/CertInfoProfile.java
index fae38c696dfe767b9acacf3edc0abd4b975e0ed6..75f134c2a9ff82ae8a35d056ff10bafb552b3bd0 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/CertInfoProfile.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/CertInfoProfile.java
@@ -28,7 +28,7 @@ import com.netscape.certsrv.base.IConfigStore;
 
 public class CertInfoProfile 
 {
-    private Vector mDefaults = new Vector();
+    private Vector<ICertInfoPolicyDefault> mDefaults = new Vector<ICertInfoPolicyDefault>();
     private String mName = null;
     private String mID = null;
     private String mDescription = null;
@@ -96,7 +96,7 @@ public class CertInfoProfile
 
     public void populate(X509CertInfo info)
     {
-        Enumeration e1 = mDefaults.elements();
+        Enumeration<ICertInfoPolicyDefault> e1 = mDefaults.elements();
         while (e1.hasMoreElements()) {
           ICertInfoPolicyDefault def = 
                (ICertInfoPolicyDefault)e1.nextElement();
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IPolicyDefault.java b/pki/base/common/src/com/netscape/certsrv/profile/IPolicyDefault.java
index 018054926c5741b89936068dcee057d7cff3723f..092b10fdce3d2e336f74b8569e2bbfe696cbbfbd 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IPolicyDefault.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IPolicyDefault.java
@@ -109,7 +109,7 @@ public interface IPolicyDefault extends IConfigTemplate {
      * @return a list of property names. The values are
      *         of type java.lang.String
      */
-    public Enumeration getValueNames();
+    public Enumeration<String> getValueNames();
 
     /**
      * Retrieves the descriptor of the given property 
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IProfile.java b/pki/base/common/src/com/netscape/certsrv/profile/IProfile.java
index c006db6793906c352f3cf4e592403d894494ba13..cc6975cdf355db415a7f123580c0dbc06267fbe4 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IProfile.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IProfile.java
@@ -26,6 +26,7 @@ import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.common.NameValuePairs;
 import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.IRequestQueue;
+import com.netscape.cms.profile.common.ProfilePolicy;
 
 /**
  * This interface represents a profile. A profile contains 
@@ -137,7 +138,7 @@ public interface IProfile {
      *
      * @return input policy id list
      */
-    public Enumeration getProfileInputIds();
+    public Enumeration<String> getProfileInputIds();
 
     /**
      * Retrieves input policy by id.
@@ -152,7 +153,7 @@ public interface IProfile {
      *
      * @return output policy id list
      */
-    public Enumeration getProfileOutputIds();
+    public Enumeration<String> getProfileOutputIds();
 
     /**
      * Retrieves output policy by id.
@@ -243,7 +244,7 @@ public interface IProfile {
      *
      * @return a list of policy set id
      */
-    public Enumeration getProfilePolicySetIds();
+    public Enumeration<String> getProfilePolicySetIds();
 
     /**
      * Creates a profile policy.
@@ -325,7 +326,7 @@ public interface IProfile {
      * @param setId set id
      * @return a list of policy id
      */
-    public Enumeration getProfilePolicyIds(String setId);
+    public Enumeration<String> getProfilePolicyIds(String setId);
 
     /**
      * Retrieves a default set id for the given request.
@@ -343,7 +344,7 @@ public interface IProfile {
      * @param setId set id
      * @return a list of policies
      */
-    public Enumeration getProfilePolicies(String setId);
+    public Enumeration<ProfilePolicy> getProfilePolicies(String setId);
 
     /**
      * Creates one or more requests. Normally, only one request will
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IProfileAuthenticator.java b/pki/base/common/src/com/netscape/certsrv/profile/IProfileAuthenticator.java
index 195078f7ba0d801fba1a8bf29b07b0c5e85a6628..476002e2d28c079d354a35501e2412e43f78c098 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IProfileAuthenticator.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IProfileAuthenticator.java
@@ -89,7 +89,7 @@ public interface IProfileAuthenticator extends IAuthManager {
      *
      * @return a list of property names
      */
-    public Enumeration getValueNames();
+    public Enumeration<String> getValueNames();
 
     /**
      * Checks if the value of the given property should be
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IProfileInput.java b/pki/base/common/src/com/netscape/certsrv/profile/IProfileInput.java
index 6d861579c54e9330f033c7252645ebf80d009c9c..35453e7d5a298284c8c10ecbf266b7863d1ac115 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IProfileInput.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IProfileInput.java
@@ -83,7 +83,7 @@ public interface IProfileInput extends IConfigTemplate {
      *
      * @return a list of property names
      */
-    public Enumeration getValueNames();
+    public Enumeration<String> getValueNames();
 
     /**
      * Retrieves the descriptor of the given value 
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IProfileOutput.java b/pki/base/common/src/com/netscape/certsrv/profile/IProfileOutput.java
index b4654f408c7f6645fb0af213828978d0452b9cbd..6dbfea51cae62426b995535cc0ed5446a4f9ea07 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IProfileOutput.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IProfileOutput.java
@@ -83,7 +83,7 @@ public interface IProfileOutput extends IConfigTemplate {
      *
      * @return a list of property names
      */
-    public Enumeration getValueNames();
+    public Enumeration<String> getValueNames();
 
     /**
      * Retrieves the descriptor of the given value 
diff --git a/pki/base/common/src/com/netscape/certsrv/profile/IProfileSubsystem.java b/pki/base/common/src/com/netscape/certsrv/profile/IProfileSubsystem.java
index 795a19c0e7a44f903e319e4cd204ad55f788268a..6f2fef37831fa6cd13a96b8feb89f8ba00ca28a4 100644
--- a/pki/base/common/src/com/netscape/certsrv/profile/IProfileSubsystem.java
+++ b/pki/base/common/src/com/netscape/certsrv/profile/IProfileSubsystem.java
@@ -124,7 +124,7 @@ public interface IProfileSubsystem extends ISubsystem {
      *
      * @return a list of profile ids
      */
-    public Enumeration getProfileIds();
+    public Enumeration<String>  getProfileIds();
 
     /**
      * Checks if owner id should be enforced during profile approval.
diff --git a/pki/base/common/src/com/netscape/certsrv/property/IConfigTemplate.java b/pki/base/common/src/com/netscape/certsrv/property/IConfigTemplate.java
index f435db50c705f8608a5c78f85576b0daa176acce..e40c98fa9222afd9790f40861cb64a2956393787 100644
--- a/pki/base/common/src/com/netscape/certsrv/property/IConfigTemplate.java
+++ b/pki/base/common/src/com/netscape/certsrv/property/IConfigTemplate.java
@@ -41,7 +41,7 @@ public interface IConfigTemplate {
      * 
      * @return parameter names
      */
-    public Enumeration getConfigNames();
+    public Enumeration<String> getConfigNames();
 
     /**
      * Returns the descriptors of configuration parameter.
diff --git a/pki/base/common/src/com/netscape/certsrv/property/PropertySet.java b/pki/base/common/src/com/netscape/certsrv/property/PropertySet.java
index 360477fe914849c290a762d15ea9c70b49932ef8..f308a3e7e49f90b8763926ad08894536aa61505b 100644
--- a/pki/base/common/src/com/netscape/certsrv/property/PropertySet.java
+++ b/pki/base/common/src/com/netscape/certsrv/property/PropertySet.java
@@ -26,7 +26,7 @@ import java.util.Hashtable;
  */
 public class PropertySet {
 
-  private Hashtable mProperties = new Hashtable();
+  private Hashtable<String, IDescriptor> mProperties = new Hashtable<String, IDescriptor>();
 
   public PropertySet()
   {
@@ -37,7 +37,7 @@ public class PropertySet {
      mProperties.put(name, desc);
   }
 
-  public Enumeration getNames()
+  public Enumeration<String> getNames()
   {
     return mProperties.keys();
   }
diff --git a/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java b/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java
deleted file mode 100644
index cd4012a45f34c063e2d2f8e0f7e039faeaf4fa7f..0000000000000000000000000000000000000000
--- a/pki/base/common/src/com/netscape/certsrv/publish/ILdapCertMapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2007 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.certsrv.publish;
-
-
-import java.security.cert.X509Certificate;
-import java.util.Vector;
-
-import netscape.ldap.LDAPConnection;
-
-import com.netscape.certsrv.ldap.ELdapException;
-
-
-/** 
- * Interface for mapping a X509 certificate to a LDAP entry. 
- *
- * @version $Revision$ $Date$
- */
-public interface ILdapCertMapper extends ILdapPlugin {
-
-    /**
-     * Returns implementation name.
-     */
-    public String getImplName();
-
-    /**
-     * Returns the description of this mapper.
-     */
-    public String getDescription();
-
-    /**
-     * Returns the default parameters.
-     */
-    public Vector getDefaultParams();
-
-    /**
-     * Returns the instance parameters.
-     */
-    public Vector getInstanceParams();
-
-    /**
-     * maps a certificate to a LDAP entry.
-     * returns dn of the mapped LDAP entry.
-     * @param conn the LDAP connection
-     * @param cert the certificate to map
-     * @param checkForCert whether to check for the presence of the cert
-     * @exception ELdapException  Failed to map.
-     * @return LdapCertMapResult indicates whether a mapping was successful
-     * and whether a certificate was found if checkForCert was true.
-     * If checkForCert was not set the hasCert method in LdapCertMapResult
-     * should be ignored.
-     */
-    public LdapCertMapResult map(LDAPConnection conn, 
-        X509Certificate cert, boolean checkForCert)
-        throws ELdapException;
-}
diff --git a/pki/base/common/src/com/netscape/certsrv/publish/IPublishRuleSet.java b/pki/base/common/src/com/netscape/certsrv/publish/IPublishRuleSet.java
deleted file mode 100644
index 6ff997a1dab0e42b4c814c48479cd25d0e2b8818..0000000000000000000000000000000000000000
--- a/pki/base/common/src/com/netscape/certsrv/publish/IPublishRuleSet.java
+++ /dev/null
@@ -1,124 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2007 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.certsrv.publish;
-
-
-import java.util.Enumeration;
-
-import netscape.ldap.LDAPConnection;
-
-import com.netscape.certsrv.base.EBaseException;
-import com.netscape.certsrv.base.IConfigStore;
-import com.netscape.certsrv.base.ISubsystem;
-import com.netscape.certsrv.ldap.ELdapException;
-import com.netscape.certsrv.request.IRequest;
-
-
-/**
- * Represents a set of publishing rules. Publishing rules are ordered from
- * lowest priority to highest priority. The priority assignment for publishing 
- * rules is not enforced by this interface. Various implementation may
- * use different mechanisms such as a linear ordering of publishing rules
- * in a configuration file or explicit assignment of priority levels ..etc.
- * The publishing rule initialization needs to deal with reading the 
- * publishing rules, sorting them in increasing order of priority and 
- * presenting an ordered vector of publishing rules via the IPublishRuleSet 
- * interface.
- * When a request comes, the predicates of the publishing rules will be 
- * checked in the order to find the first matched publishing rule as the 
- * mapping rule to (un)publish the object.
- * <P>
- *
- * @version $Revision$, $Date$
- */
-public interface IPublishRuleSet {
-    void init(ISubsystem sys, IConfigStore conf) throws EBaseException;
-
-    /**
-     * Returns the name of the publishing rule set.
-     * <P>
-     *
-     * @return The name of the publishing rule set.
-     */
-    String getName();
-
-    /**
-     * Returns the no of publishing rules in a set.
-     * <P>
-     * @return the no of publishing rules.
-     */
-    int count();
-
-    /**
-     * Add a publishing rule
-     * <P>
-     *
-     * @param aliasName  The name of the publishing rule to be added.
-     * @param rule rule  The publishing rule to be added.
-     */
-    void addRule(String aliasName, ILdapRule rule);
-
-    /**
-     * Removes a publishing rule identified by the given name.
-     *
-     * @param ruleName  The name of the publishing rule to be removed.
-     */
-    void removeRule(String ruleName);
-
-    /**
-     * Get the publishing rule identified by a given name.
-     * <P>
-     *
-     * @param ruleName  The name of the publishing rule to be return.
-     * @return The publishing rule identified by the given name or null if none exists.
-     */
-    ILdapRule getRule(String ruleName);
-
-    /**
-     * Get the publishing rule identified by a corresponding request.
-     * <P>
-     *
-     * @param req  The request from which rule will be identified.
-     * @return The publishing rule or null if none exists.
-     */
-    ILdapRule getRule(IRequest req);
-
-    /**
-     * Get an enumeration of publishing rules.
-     * <P>
-     *
-     * @return An enumeration of publishing rules.
-     */
-    Enumeration getRules();
-
-    /**
-     * Apply publishing rules on a request. 
-     * The predicates of the publishing rules will be checked in the order 
-     * to find the first matched publishing rule. 
-     * Use the mapper to find the dn of the LDAP entry and use the publisher 
-     * to publish the object in the request.
-     * <P>
-     *
-     * @param conn    The Ldap connection
-     * @param req   The request to apply policies on.
-     * @exception  ELdapException publish failed due to Ldap error.
-     */
-    public void publish(LDAPConnection conn, IRequest req)
-        throws ELdapException;
-}
-
diff --git a/pki/base/common/src/com/netscape/certsrv/ra/IRegistrationAuthority.java b/pki/base/common/src/com/netscape/certsrv/ra/IRegistrationAuthority.java
index 62fe529f021f379d98534fb7629d622a9bcc4319..3ab3a08480275c4f0dddc24ddc25f3d6db0cfdc3 100644
--- a/pki/base/common/src/com/netscape/certsrv/ra/IRegistrationAuthority.java
+++ b/pki/base/common/src/com/netscape/certsrv/ra/IRegistrationAuthority.java
@@ -168,5 +168,5 @@ public interface IRegistrationAuthority extends ISubsystem {
      *
      * @return name enumeration of all request listeners
      */
-    public Enumeration getRequestListenerNames();
+    public Enumeration<String> getRequestListenerNames();
 }
diff --git a/pki/base/common/src/com/netscape/certsrv/registry/IPluginRegistry.java b/pki/base/common/src/com/netscape/certsrv/registry/IPluginRegistry.java
index 0497562be45b780e3fc8df4601788fade26e8995..7631f3eaf353c778e3ec537a5c6c6dce8ba66622 100644
--- a/pki/base/common/src/com/netscape/certsrv/registry/IPluginRegistry.java
+++ b/pki/base/common/src/com/netscape/certsrv/registry/IPluginRegistry.java
@@ -49,7 +49,7 @@ public interface IPluginRegistry extends ISubsystem {
      *
      * @return a list of String-based names
      */
-    public Enumeration getTypeNames();
+    public Enumeration<String> getTypeNames();
 
     /**
      * Returns a list of plugin identifiers of the given type.
@@ -57,7 +57,7 @@ public interface IPluginRegistry extends ISubsystem {
      * @param type plugin type
      * @return a list of plugin IDs
      */
-    public Enumeration getIds(String type);
+    public Enumeration<String> getIds(String type);
 
     /**
      * Retrieves the plugin information.
diff --git a/pki/base/common/src/com/netscape/certsrv/request/IRequest.java b/pki/base/common/src/com/netscape/certsrv/request/IRequest.java
index c509e2966cd1dbcdf8e4e18289ae1a4041f7ce56..477a14c65bb5526db5b4f5ba2f48f2db2beacd19 100644
--- a/pki/base/common/src/com/netscape/certsrv/request/IRequest.java
+++ b/pki/base/common/src/com/netscape/certsrv/request/IRequest.java
@@ -643,7 +643,7 @@ public interface IRequest {
      * @param key  The extdata key
      * @return  A Vector of strings, or null on error.
      */
-    public Vector getExtDataInStringVector(String key);
+    public Vector<String> getExtDataInStringVector(String key);
 
     /**
      * Gets boolean value for given type or default value
diff --git a/pki/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java b/pki/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java
index e575c58bda1676bc01a0b9c94d33acd57b04b3d9..ff6f7be6f2aa5bca8b64a34b03f53cfa372e374b 100644
--- a/pki/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java
+++ b/pki/base/common/src/com/netscape/certsrv/usrgrp/IUGSubsystem.java
@@ -58,7 +58,7 @@ public interface IUGSubsystem extends ISubsystem, IUsrGrp {
      * @return list of users
      * @exception EUsrGrpException thrown when any internal error occurs
      */
-    public Enumeration listUsers(String filter) throws EUsrGrpException;
+    public Enumeration<IUser> listUsers(String filter) throws EUsrGrpException;
 
     /**
      * Adds the given user to the internal database
@@ -107,7 +107,7 @@ public interface IUGSubsystem extends ISubsystem, IUsrGrp {
      * @param filter the search filter
      * @return a list of groups that match the given search filter
      */
-    public Enumeration findGroups(String filter);
+    public Enumeration<IGroup> findGroups(String filter);
 
     /**
      * Find a group for the given name
@@ -125,7 +125,7 @@ public interface IUGSubsystem extends ISubsystem, IUsrGrp {
      * its description.
      * @exception EUsrGrpException thrown when failed to list groups
      */
-    public Enumeration listGroups(String filter) throws EUsrGrpException;
+    public Enumeration<IGroup> listGroups(String filter) throws EUsrGrpException;
 
     /**
      * Retrieves a group from LDAP for the given group name
diff --git a/pki/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java b/pki/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java
index 116054181f9786806f04cd0a42d585d8b9db90cf..ce60bf8de976f15eb008eba17bfe6630aaa31eea 100644
--- a/pki/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java
+++ b/pki/base/common/src/com/netscape/cms/authentication/UidPwdPinDirAuthentication.java
@@ -415,8 +415,8 @@ public class UidPwdPinDirAuthentication extends DirBasedAuthentication
     /**
      * Retrieves a list of names of the value parameter.
      */
-    public Enumeration getValueNames() {
-        Vector v = new Vector();
+    public Enumeration<String> getValueNames() {
+        Vector<String> v = new Vector<String>();
 
         v.addElement(CRED_UID);
         v.addElement(CRED_PWD);
diff --git a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java
index 1e409af8769676af9bda5c53605627608c32abef..af6515843022d84201174a2f931fc28f435bc066 100644
--- a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java
+++ b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java
@@ -170,7 +170,7 @@ public class MailNotification implements IMailNotification {
      * sets the recipients' email addresses
      * @param addresses a list of email addresses of the recipients
      */
-    public void setTo(Vector addresses) {
+    public void setTo(Vector<String> addresses) {
         // concatenate addresses into comma separated mTo String
 
     }
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java
index b5afc1c79e39049eaaad7e3cea22bd02a685255f..71cccdff5d25a65ef69eedc4092c6150ed2b87b7 100644
--- a/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java
+++ b/pki/base/common/src/com/netscape/cms/profile/def/EnrollDefault.java
@@ -80,13 +80,13 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
     public static final String GN_OID_NAME = "OIDName";
 
     protected IConfigStore mConfig = null;
-    protected Vector mConfigNames = new Vector();
-    protected Vector mValueNames = new Vector();
+    protected Vector<String> mConfigNames = new Vector<String>();
+    protected Vector<String> mValueNames = new Vector<String>();
 
     public EnrollDefault() {
     }
 
-    public Enumeration getConfigNames() {
+    public Enumeration<String> getConfigNames() {
         return mConfigNames.elements();
     }
 
@@ -212,7 +212,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
         mValueNames.addElement(name);
     }
 
-    public Enumeration getValueNames() {
+    public Enumeration<String> getValueNames() {
         return mValueNames.elements();
     }
 
@@ -291,7 +291,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
                     info.get(X509CertInfo.EXTENSIONS);
             if (exts == null)
                 return;
-            Enumeration e = exts.getNames();
+            Enumeration<?> e = exts.getNames();
 
             while (e.hasMoreElements()) {
                 String n = (String) e.nextElement();
@@ -323,7 +323,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
     protected Extension getExtension(String name, CertificateExtensions exts) {
         if (exts == null)
             return null;
-        Enumeration e = exts.getElements();
+        Enumeration<?> e = exts.getElements();
 
         while (e.hasMoreElements()) {
             Extension ext = (Extension) e.nextElement();
@@ -515,7 +515,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
               String realm = nameValue.substring(pos0 + 1, pos1).trim();
               String name_type = nameValue.substring(pos1 + 1, pos2).trim();
               String name_strings = nameValue.substring(pos2 + 1).trim();
-              Vector strings = new Vector();
+              Vector<String> strings = new Vector<String>();
               StringTokenizer st = new StringTokenizer(name_strings, ",");
               while (st.hasMoreTokens()) {
                      strings.addElement(st.nextToken());
@@ -637,7 +637,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
         return true;
     }
 
-    protected String buildRecords(Vector recs) throws EPropertyException {
+    protected String buildRecords(Vector<?> recs) throws EPropertyException {
         StringBuffer sb = new StringBuffer();
 
         for (int i = 0; i < recs.size(); i++) {
@@ -646,7 +646,7 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
             sb.append("Record #");
             sb.append(i);
             sb.append("\r\n");
-            Enumeration e = pairs.getNames();
+            Enumeration<?> e = pairs.getNames();
 
             while (e.hasMoreElements()) {
                 String key = (String) e.nextElement();
@@ -663,10 +663,10 @@ public abstract class EnrollDefault implements IPolicyDefault, ICertInfoPolicyDe
         return sb.toString();
     }
 
-    protected Vector parseRecords(String value) throws EPropertyException {
+    protected Vector<NameValuePairs> parseRecords(String value) throws EPropertyException {
         StringTokenizer st = new StringTokenizer(value, "\r\n");
         int num = 0;
-        Vector v = new Vector();
+        Vector<NameValuePairs> v = new Vector<NameValuePairs>();
         NameValuePairs nvps = null;
 
         while (st.hasMoreTokens()) {
diff --git a/pki/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java b/pki/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
index f6ddd91536a2f18dc5341c98dbad19e9ac97e390..065b30444676ade5f9c660148a1d2fbd825982b0 100644
--- a/pki/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
+++ b/pki/base/common/src/com/netscape/cms/profile/def/NameConstraintsExtDefault.java
@@ -163,7 +163,7 @@ public class NameConstraintsExtDefault extends EnrollExtDefault {
     }
 
 
-    public Enumeration getConfigNames() {
+    public Enumeration<String> getConfigNames() {
         refreshConfigAndValueNames();
         return super.getConfigNames();
     }
diff --git a/pki/base/common/src/com/netscape/cms/profile/input/SubjectDNInput.java b/pki/base/common/src/com/netscape/cms/profile/input/SubjectDNInput.java
index 8691b45c739dce570b0cc98c2b6122ff4f1a0cf6..4a8f6050568b558e28ff2af343636f349f31a620 100644
--- a/pki/base/common/src/com/netscape/cms/profile/input/SubjectDNInput.java
+++ b/pki/base/common/src/com/netscape/cms/profile/input/SubjectDNInput.java
@@ -81,8 +81,8 @@ public class SubjectDNInput extends EnrollInput implements IProfileInput {
     /**
      * Returns selected value names based on the configuration.
      */
-    public Enumeration getValueNames() {
-         Vector v = new Vector();
+    public Enumeration<String> getValueNames() {
+         Vector<String> v = new Vector<String>();
          v.addElement(VAL_SUBJECT);
          return v.elements();
     }
diff --git a/pki/base/common/src/com/netscape/cms/profile/output/EnrollOutput.java b/pki/base/common/src/com/netscape/cms/profile/output/EnrollOutput.java
index 3013e881017c0a352032a61e3833ad8e1b7c7764..5e3f077b2654cffc1d09b0d2fca0259ad74bfee3 100644
--- a/pki/base/common/src/com/netscape/cms/profile/output/EnrollOutput.java
+++ b/pki/base/common/src/com/netscape/cms/profile/output/EnrollOutput.java
@@ -39,8 +39,8 @@ import com.netscape.certsrv.request.IRequest;
  */
 public abstract class EnrollOutput implements IProfileOutput { 
     private IConfigStore mConfig = null;
-    private Vector mValueNames = new Vector();
-    protected Vector mConfigNames = new Vector();
+    private Vector<String> mValueNames = new Vector<String>();
+    protected Vector<String> mConfigNames = new Vector<String>();
  
     /**
      * Initializes this default policy.
@@ -98,7 +98,7 @@ public abstract class EnrollOutput implements IProfileOutput {
     /**
      * Retrieves a list of names of the value parameter.
      */
-    public Enumeration getValueNames() {
+    public Enumeration<String> getValueNames() {
         return mValueNames.elements();
     }
 
@@ -115,7 +115,7 @@ public abstract class EnrollOutput implements IProfileOutput {
         request.setExtData(name, value);
     }
 
-    public Enumeration getConfigNames() {
+    public Enumeration<String> getConfigNames() {
         return mConfigNames.elements();
     }
 
diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
index 6f64d81a09b89f36ec0723db7cfc2f990b950789..9c83a30c84f051613a5cb6450e63b203bf26acb9 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
@@ -51,6 +51,7 @@ import com.netscape.certsrv.property.EPropertyException;
 import com.netscape.certsrv.property.IDescriptor;
 import com.netscape.certsrv.registry.IPluginInfo;
 import com.netscape.certsrv.registry.IPluginRegistry;
+import com.netscape.cms.profile.common.ProfilePolicy;
 
 
 /**
@@ -383,7 +384,7 @@ public class ProfileAdminServlet extends AdminServlet {
         HttpServletResponse resp)
         throws ServletException, IOException {
 
-        Enumeration impls = mRegistry.getIds("profile");
+        Enumeration<String> impls = mRegistry.getIds("profile");
         NameValuePairs nvp = new NameValuePairs();
 
         while (impls.hasMoreElements()) {
@@ -592,11 +593,12 @@ public class ProfileAdminServlet extends AdminServlet {
             }
 
             IProfileInput input = null;
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
             NameValuePairs nvps = new NameValuePairs();
 
             while (names.hasMoreElements()) {
-                String name = (String) names.nextElement();
+                String name =  names.nextElement();
 
                 if (name.equals("OP_SCOPE"))
                     continue;
@@ -718,11 +720,12 @@ public class ProfileAdminServlet extends AdminServlet {
             }
 
             IProfileOutput output = null;
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
             NameValuePairs nvps = new NameValuePairs();
 
             while (names.hasMoreElements()) {
-                String name = (String) names.nextElement();
+                String name =  names.nextElement();
 
                 if (name.equals("OP_SCOPE"))
                     continue;
@@ -819,10 +822,11 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String policyId = "";
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
-                String name = (String) names.nextElement();
+                String name =  names.nextElement();
 
                 if (name.equals("OP_SCOPE"))
                     continue;
@@ -939,10 +943,11 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String inputId = "";
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
-                String name = (String) names.nextElement();
+                String name = names.nextElement();
 
                 if (name.equals("OP_SCOPE"))
                     continue;
@@ -1056,7 +1061,8 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String outputId = "";
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
                 String name = (String) names.nextElement();
@@ -1205,7 +1211,8 @@ public class ProfileAdminServlet extends AdminServlet {
             IPolicyDefault def = policy.getDefault();
             IConfigStore defConfig = def.getConfigStore();
         
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
                 String name = (String) names.nextElement();
@@ -1341,10 +1348,11 @@ public class ProfileAdminServlet extends AdminServlet {
             IPolicyConstraint con = policy.getConstraint();
             IConfigStore conConfig = con.getConfigStore();
 
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
-                String name = (String) names.nextElement();
+                String name =  names.nextElement();
 
                 if (name.equals("OP_SCOPE"))
                     continue;
@@ -1478,7 +1486,8 @@ public class ProfileAdminServlet extends AdminServlet {
             IPolicyDefault def = policy.getDefault();
             IConfigStore defConfig = def.getConfigStore();
         
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
                 String name = (String) names.nextElement();
@@ -1606,7 +1615,8 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfileInput input = profile.getProfileInput(inputId);
             IConfigStore inputConfig = input.getConfigStore();
 
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
                 String name = (String) names.nextElement();
@@ -1725,7 +1735,8 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfileOutput output = profile.getProfileOutput(outputId);
             IConfigStore outputConfig = output.getConfigStore();
 
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
                 String name = (String) names.nextElement();
@@ -1849,7 +1860,8 @@ public class ProfileAdminServlet extends AdminServlet {
             IPolicyConstraint con = policy.getConstraint();
             IConfigStore conConfig = con.getConfigStore();
 
-            Enumeration names = req.getParameterNames();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> names = req.getParameterNames();
 
             CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig policy " + policy + " con " + con); 
             while (names.hasMoreElements()) {
@@ -1959,10 +1971,10 @@ public class ProfileAdminServlet extends AdminServlet {
         rule = policy.getDefault();
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration names = rule.getConfigNames();
+        Enumeration<String> names = rule.getConfigNames();
 
         while (names.hasMoreElements()) {
-            String name = (String) names.nextElement();
+            String name = names.nextElement();
             IDescriptor desc = rule.getConfigDescriptor(getLocale(req), name);
 
             if (desc == null) {
@@ -2007,10 +2019,10 @@ public class ProfileAdminServlet extends AdminServlet {
         IPolicyConstraint rule = policy.getConstraint();
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration names = rule.getConfigNames();
+        Enumeration<String> names = rule.getConfigNames();
 
         while (names.hasMoreElements()) {
-            String name = (String) names.nextElement();
+            String name = names.nextElement();
             IDescriptor desc = rule.getConfigDescriptor(getLocale(req), name);
 
             if (desc == null) {
@@ -2040,7 +2052,7 @@ public class ProfileAdminServlet extends AdminServlet {
         }
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration setIds = profile.getProfilePolicySetIds();
+        Enumeration<String> setIds = profile.getProfilePolicySetIds();
 
         if (!setIds.hasMoreElements()) {
             // no set id; this is a brand new profile
@@ -2049,7 +2061,7 @@ public class ProfileAdminServlet extends AdminServlet {
         }
         while (setIds.hasMoreElements()) {
             String setId = (String) setIds.nextElement();
-            Enumeration policies = profile.getProfilePolicies(setId);
+            Enumeration<ProfilePolicy> policies = profile.getProfilePolicies(setId);
 
             while (policies.hasMoreElements()) {
                 IProfilePolicy policy = (IProfilePolicy) policies.nextElement();
@@ -2082,7 +2094,7 @@ public class ProfileAdminServlet extends AdminServlet {
         }
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration outputs = profile.getProfileOutputIds();
+        Enumeration<String> outputs = profile.getProfileOutputIds();
 
         while (outputs.hasMoreElements()) {
             String outputId = (String) outputs.nextElement();
@@ -2109,7 +2121,7 @@ public class ProfileAdminServlet extends AdminServlet {
         }
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration inputs = profile.getProfileInputIds();
+        Enumeration<String> inputs = profile.getProfileInputIds();
 
         while (inputs.hasMoreElements()) {
             String inputId = (String) inputs.nextElement();
@@ -2143,10 +2155,10 @@ public class ProfileAdminServlet extends AdminServlet {
         NameValuePairs nvp = new NameValuePairs();
 
         profileInput = profile.getProfileInput(inputId);
-        Enumeration names = profileInput.getConfigNames();
+        Enumeration<String> names = profileInput.getConfigNames();
 
         while (names.hasMoreElements()) {
-            String name = (String) names.nextElement();
+            String name = names.nextElement();
             IDescriptor desc = profileInput.getConfigDescriptor(
 		getLocale(req), name);
             if (desc == null) {
@@ -2184,10 +2196,10 @@ public class ProfileAdminServlet extends AdminServlet {
         NameValuePairs nvp = new NameValuePairs();
 
         profileOutput = profile.getProfileOutput(outputId);
-        Enumeration names = profileOutput.getConfigNames();
+        Enumeration<String> names = profileOutput.getConfigNames();
 
         while (names.hasMoreElements()) {
-            String name = (String) names.nextElement();
+            String name = names.nextElement();
             IDescriptor desc = profileOutput.getConfigDescriptor(
 		getLocale(req), name);
             if (desc == null) {
@@ -2208,10 +2220,10 @@ public class ProfileAdminServlet extends AdminServlet {
         throws ServletException, IOException {
 
         NameValuePairs nvp = new NameValuePairs();
-        Enumeration e = mProfileSub.getProfileIds();
+        Enumeration<String> e = mProfileSub.getProfileIds();
 
         while (e.hasMoreElements()) {
-            String profileId = (String) e.nextElement();
+            String profileId =  e.nextElement();
             IProfile profile = null;
 
             try {
diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java
index be9eb456e80dad9481d713f31c111455f12d6f9c..2ddc230658e76655b95e85c1ee881efec42aea1e 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/admin/RegistryAdminServlet.java
@@ -245,11 +245,11 @@ public class RegistryAdminServlet extends AdminServlet {
         throws ServletException, IOException {
 
         String scope = req.getParameter(Constants.OP_SCOPE);
-        Enumeration impls = mRegistry.getIds(scope);
+        Enumeration<String> impls = mRegistry.getIds(scope);
         NameValuePairs nvp = new NameValuePairs();
 
         while (impls.hasMoreElements()) {
-            String id = (String) impls.nextElement();
+            String id =  impls.nextElement();
             IPluginInfo info = mRegistry.getPluginInfo(scope, id);
 
             nvp.add(id, info.getClassName() + "," + 
@@ -276,7 +276,7 @@ public class RegistryAdminServlet extends AdminServlet {
                 Class.forName(className).newInstance();
 
             if (policyDefaultClass != null) {
-                Enumeration impls = mRegistry.getIds("constraintPolicy");
+                Enumeration<String> impls = mRegistry.getIds("constraintPolicy");
 
                 while (impls.hasMoreElements()) {
                     String constraintID = (String) impls.nextElement();
@@ -332,11 +332,11 @@ public class RegistryAdminServlet extends AdminServlet {
         } catch (Exception e) {
         }
         if (template != null) {
-            Enumeration names = template.getConfigNames();
+            Enumeration<String> names = template.getConfigNames();
 
             if (names != null) {
                 while (names.hasMoreElements()) {
-                    String name = (String) names.nextElement(); 
+                    String name = names.nextElement(); 
                         CMS.debug("RegistryAdminServlet: getProfileImpl descriptor " + name);
                     IDescriptor desc = template.getConfigDescriptor(getLocale(req), name);
 
diff --git a/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java b/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java
index 1c5062758662f2e4593c802237c87b3658089a0e..60075b6d50196020d8d1e3d3a28c8234e4b62fff 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/base/CMSServlet.java
@@ -1042,7 +1042,7 @@ public abstract class CMSServlet extends HttpServlet {
      */
     protected void saveHttpParams(
         IArgBlock httpParams, IRequest req) {
-        Hashtable<String, Object> saveParams = new Hashtable<String, Object>();
+        Hashtable<String, String> saveParams = new Hashtable<String, String>();
 
         Enumeration<String> names = httpParams.elements();
 
@@ -1065,7 +1065,7 @@ public abstract class CMSServlet extends HttpServlet {
                 // retrieves string values.
                 // TODO - when we can use JDK5 features we should typecast
                 // the params until they get here
-                saveParams.put(name, httpParams.get(name));
+                saveParams.put(name, (String) httpParams.get(name));
             }
         }
         req.setExtData(IRequest.HTTP_PARAMS, saveParams);
@@ -1477,7 +1477,7 @@ public abstract class CMSServlet extends HttpServlet {
 
         // # 56230 - expose auth token parameters to the policy predicate
         if (token != null && req != null) {
-            Enumeration e = token.getElements();
+            Enumeration<String> e = token.getElements();
             while (e.hasMoreElements()) {
                 String n = (String) e.nextElement();
                 String[] x1 = token.getInStringArray(n);
@@ -2197,7 +2197,7 @@ public abstract class CMSServlet extends HttpServlet {
             return ILogger.SIGNED_AUDIT_EMPTY_VALUE;
         }
 
-        Enumeration groups = null;
+        Enumeration<IGroup> groups = null;
 
         try {
             groups = mUG.findGroups("*");
diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileProcessServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileProcessServlet.java
index a159c0f2dfa5985587d5467564b039da7623ec28..3261535a673d3eeb06c7cb053ae3449fd0fcf58b 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileProcessServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileProcessServlet.java
@@ -703,12 +703,12 @@ public class ProfileProcessServlet extends ProfileServlet {
                     IProfileOutput profileOutput = profile.getProfileOutput(
                             outputId);
 
-                    Enumeration outputNames = profileOutput.getValueNames();
+                    Enumeration<String> outputNames = profileOutput.getValueNames();
 
                     if (outputNames != null) {
                         while (outputNames.hasMoreElements()) {
                             ArgSet outputset = new ArgSet();
-                            String outputName = (String)
+                            String outputName = 
                                 outputNames.nextElement();
                             IDescriptor outputDesc =
                                 profileOutput.getValueDescriptor(locale,
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
index aa1fd15f2ce94f0edcce600c65fdef0cbee022e0..770b5ba421044a31f5cfc978b821bb42e34a6927 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
@@ -71,8 +71,8 @@ public class EmailFormProcessor implements IEmailFormProcessor {
         };
 
     // stores the eventual content of the email
-    Vector mContent = new Vector();
-    Hashtable mTok2vals = null;
+    Vector<String> mContent = new Vector<String>();
+    Hashtable<String, Object> mTok2vals = null;
 
     public EmailFormProcessor() {
     }
@@ -87,7 +87,7 @@ public class EmailFormProcessor implements IEmailFormProcessor {
      * @return mail content
      */
     public String getEmailContent(String form,
-        Hashtable tok2vals) {
+        Hashtable<String, Object> tok2vals) {
         mTok2vals = tok2vals;
 
         if (form == null) {
@@ -154,7 +154,7 @@ public class EmailFormProcessor implements IEmailFormProcessor {
             boolean matched = false;
             String tok = null;
 
-            for (Enumeration e = mTok2vals.keys(); e.hasMoreElements();) {
+            for (Enumeration<String> e = mTok2vals.keys(); e.hasMoreElements();) {
                 // get key
                 tok = (String) e.nextElement();
 
@@ -167,7 +167,7 @@ public class EmailFormProcessor implements IEmailFormProcessor {
                         String s = (String) o;
 
                         if (!s.equals("")) {
-                            mContent.add(o);
+                            mContent.add(s);
                         } else {
                             break;
                         }
@@ -221,18 +221,18 @@ public class EmailFormProcessor implements IEmailFormProcessor {
     /**
      * takes a vector of strings and concatenate them
      */
-    public String formContent(Vector vec) {
+    public String formContent(Vector<String> vec) {
         String content = null;
 
-        Enumeration e = vec.elements();
+        Enumeration<String> e = vec.elements();
 
         // initialize content with first element
         if (e.hasMoreElements()) {
-            content = (String) e.nextElement();
+            content =  e.nextElement();
         }
 
         while (e.hasMoreElements()) {
-            String v = (String) e.nextElement();
+            String v = e.nextElement();
 
             content += v;
         }
diff --git a/pki/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java b/pki/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
index cdfb7025c70fe20c78222bab4939a3f556948152..7fbfb2db89af8d06b7739cecac72eb6fb798ca35 100644
--- a/pki/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
+++ b/pki/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java
@@ -75,13 +75,13 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         {"com.netscape.cms.policy.constraints.ManualAuthentication"};
 
     // Policies that can't be deleted nor disabled.
-    public final static Hashtable DEF_UNDELETABLE_POLICIES = 
-        new Hashtable();
+    public final static Hashtable<String, IExpression> DEF_UNDELETABLE_POLICIES = 
+        new Hashtable<String, IExpression>();
 
     private String mId = "Policy";
-    private Vector mPolicyOrder = new Vector();
-    private Hashtable mImplTable = new Hashtable();
-    private Hashtable mInstanceTable = new Hashtable();
+    private Vector<String> mPolicyOrder = new Vector<String>();
+    private Hashtable<String, RegisteredPolicy> mImplTable = new Hashtable<String, RegisteredPolicy>();
+    private Hashtable<String, PolicyInstance> mInstanceTable = new Hashtable<String, PolicyInstance>();
     PolicySet mEnrollmentRules = new PolicySet("EnrollmentRules");
     PolicySet mRenewalRules = new PolicySet("RenewalRules");
     PolicySet mRevocationRules = new PolicySet("RevocationRules");
@@ -92,7 +92,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
 
     // A Table of persistent policies and their predicates.
     // The predicates cannot be changed during configuration.
-    private Hashtable mUndeletablePolicies = null;
+    private Hashtable<String, IExpression> mUndeletablePolicies = null;
 
     public GenericPolicyProcessor() {
         mInitSystemPolicies = true; // CA & RA
@@ -208,7 +208,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         IConfigStore c;
 
         c = config.getSubStore(PROP_IMPL);
-        Enumeration mImpls = c.getSubStoreNames();
+        Enumeration<String> mImpls = c.getSubStoreNames();
 
         while (mImpls.hasMoreElements()) {
             String id = (String) mImpls.nextElement();
@@ -458,10 +458,10 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return mAuthority.getId() + ".Policy";
     }
 
-    public Enumeration getPolicyImpls() {
-        Vector impls = new Vector();
-        Enumeration enum1 = mImplTable.elements();
-        Enumeration ret = null;
+    public Enumeration<IPolicyRule> getPolicyImpls() {
+        Vector<IPolicyRule> impls = new Vector<IPolicyRule>();
+        Enumeration<RegisteredPolicy> enum1 = mImplTable.elements();
+        Enumeration<IPolicyRule> ret = null;
 
         try {
             while (enum1.hasMoreElements()) {
@@ -481,10 +481,10 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return ret;
     }
 
-    public Enumeration getPolicyImplsInfo() {
-        Vector impls = new Vector();
-        Enumeration enum1 = mImplTable.elements();
-        Enumeration ret = null;
+    public Enumeration<String> getPolicyImplsInfo() {
+        Vector<String> impls = new Vector<String>();
+        Enumeration<RegisteredPolicy> enum1 = mImplTable.elements();
+        Enumeration<String> ret = null;
 
         try {
             while (enum1.hasMoreElements()) {
@@ -518,15 +518,15 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return impl;
     }
 
-    public Vector getPolicyImplConfig(String id) {
+    public Vector<String> getPolicyImplConfig(String id) {
         IPolicyRule rp = getPolicyImpl(id);
 
         if (rp == null)
             return null;
-        Vector v = rp.getDefaultParams();
+        Vector<String>  v = rp.getDefaultParams();
 
         if (v == null)
-            v = new Vector();
+            v = new Vector<String>();
         v.insertElementAt(IPolicyRule.PROP_ENABLE + "=" + "true", 0);
         v.insertElementAt(IPolicyRule.PROP_PREDICATE + "=" + " ", 1);
         return v;
@@ -544,7 +544,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
 
             // If any instance exists for this impl, can't delete it.
         boolean instanceExist = false;
-        Enumeration e = mInstanceTable.elements();
+        Enumeration<PolicyInstance> e = mInstanceTable.elements();
 
         for (; e.hasMoreElements();) {
             PolicyInstance inst = (PolicyInstance) e.nextElement();
@@ -629,10 +629,10 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         }
     }
 
-    public Enumeration getPolicyInstances() {
-        Vector rules = new Vector();
-        Enumeration enum1 = mPolicyOrder.elements();
-        Enumeration ret = null;
+    public Enumeration<IPolicyRule> getPolicyInstances() {
+        Vector<IPolicyRule> rules = new Vector<IPolicyRule>();
+        Enumeration<String> enum1 = mPolicyOrder.elements();
+        Enumeration<IPolicyRule> ret = null;
 
         try {
             while (enum1.hasMoreElements()) {
@@ -649,17 +649,15 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return ret;
     }
 
-    public Enumeration getPolicyInstancesInfo() {
-        Vector rules = new Vector();
-        Enumeration enum1 = mPolicyOrder.elements();
-        Enumeration ret = null;
+    public Enumeration<String> getPolicyInstancesInfo() {
+        Vector<String> rules = new Vector<String>();
+        Enumeration<String> enum1 = mPolicyOrder.elements();
+        Enumeration<String> ret = null;
 
         try {
             while (enum1.hasMoreElements()) {
-                String ruleName = (String) enum1.nextElement();
-                PolicyInstance instance =
-                    (PolicyInstance) mInstanceTable.get(ruleName);
-
+                String ruleName = enum1.nextElement();
+                PolicyInstance instance = mInstanceTable.get(ruleName);
                 rules.addElement(instance.getRuleInfo());
             }
             ret = rules.elements();
@@ -676,16 +674,16 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return (policyInstance == null) ? null : policyInstance.getRule();
     }
 
-    public Vector getPolicyInstanceConfig(String id) {
+    public Vector<String> getPolicyInstanceConfig(String id) {
         PolicyInstance policyInstance = (PolicyInstance)
             mInstanceTable.get(id);
 
         if (policyInstance == null)
             return null;
-        Vector v = policyInstance.getRule().getInstanceParams();
+        Vector<String> v = policyInstance.getRule().getInstanceParams();
 
         if (v == null)
-            v = new Vector();
+            v = new Vector<String>();
         v.insertElementAt(PROP_IMPL_NAME + "=" + policyInstance.getImplId(), 0);
         v.insertElementAt(PROP_ENABLE + "=" + policyInstance.isActive(), 1);
         String predicate = " ";
@@ -757,7 +755,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         mInstanceTable.remove(id);
     }
 
-    public void addPolicyInstance(String id, Hashtable ht)
+    public void addPolicyInstance(String id, Hashtable<String, String> ht)
         throws EBaseException {
         // The instance id should be unique
         if (getPolicyInstance(id) != null)
@@ -780,9 +778,9 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
             policyStore.getSubStore(PROP_RULE);
         IConfigStore newStore = instanceStore.makeSubStore(id);
 
-        for (Enumeration keys = ht.keys(); keys.hasMoreElements();) {
-            String key = (String) keys.nextElement();
-            String val = (String) ht.get(key);
+        for (Enumeration<String> keys = ht.keys(); keys.hasMoreElements();) {
+            String key = keys.nextElement();
+            String val =  ht.get(key);
 
             newStore.put(key, val);
         }
@@ -836,7 +834,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         addRule(id, rule);
     }
 
-    public void modifyPolicyInstance(String id, Hashtable ht)
+    public void modifyPolicyInstance(String id, Hashtable<String, String> ht)
         throws EBaseException {
         // The instance id should be there already
         PolicyInstance policyInstance = (PolicyInstance)
@@ -923,7 +921,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         ht.put(IPolicyRule.PROP_ENABLE, String.valueOf(active));
 
         // put old config store parameters first. 
-        for (Enumeration oldkeys = oldStore.keys(); 
+        for (Enumeration<String> oldkeys = oldStore.keys(); 
             oldkeys.hasMoreElements();) {
             String k = (String) oldkeys.nextElement();
             String v = (String) oldStore.getString(k);
@@ -932,7 +930,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         }
 
         // put modified params.
-        for (Enumeration newkeys = ht.keys(); 
+        for (Enumeration<String> newkeys = ht.keys(); 
             newkeys.hasMoreElements();) {
             String k = (String) newkeys.nextElement();
             String v = (String) ht.get(k);
@@ -973,7 +971,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
 
             // Store the changes in the file.
         try {
-            for (Enumeration e = newStore.keys(); e.hasMoreElements();) {
+            for (Enumeration<String> e = newStore.keys(); e.hasMoreElements();) {
                 String key = (String) e.nextElement();
 
                 if (key != null) {
@@ -1022,7 +1020,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
     public synchronized void changePolicyInstanceOrdering(
         String policyOrderStr)
         throws EBaseException {
-        Vector policyOrder = new Vector();
+        Vector<String> policyOrder = new Vector<String>();
         StringTokenizer tokens = new StringTokenizer(policyOrderStr, ",");
 
         // Get all the elements
@@ -1082,7 +1080,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         }
 
         // add rules specified in the new order.
-        for (Enumeration enum1 = policyOrder.elements();
+        for (Enumeration<String> enum1 = policyOrder.elements();
             enum1.hasMoreElements();) {
             String instanceName = (String) enum1.nextElement();
             PolicyInstance pInstance = (PolicyInstance)
@@ -1131,7 +1129,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         }
     }
 
-    private boolean areSameVectors(Vector v1, Vector v2) {
+    private boolean areSameVectors(Vector<String> v1, Vector<String> v2) {
         if (v1.size() != v2.size())
             return false;
         int size = v1.size();
@@ -1143,10 +1141,10 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return (i == size ? true : false);
     }
 
-    private String getRuleOrderString(Vector rules) {
+    private String getRuleOrderString(Vector<String> rules) {
         StringBuffer sb = new StringBuffer();
 
-        for (Enumeration e = rules.elements(); e.hasMoreElements();) {
+        for (Enumeration<String> e = rules.elements(); e.hasMoreElements();) {
             sb.append((String) e.nextElement());
             sb.append(",");
         }
@@ -1155,7 +1153,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         return new String(sb);
     }
 
-    private String getRuleOrderString(Vector rules, String newRule) {
+    private String getRuleOrderString(Vector<String> rules, String newRule) {
         String currentRules = getRuleOrderString(rules);
 
         if (currentRules == null || currentRules.length() == 0)
@@ -1211,7 +1209,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
             configuredDefaults.trim().length() == 0)
             mSystemDefaults = DEF_POLICIES;
         else {
-            Vector rules = new Vector();
+            Vector<String> rules = new Vector<String>();
             StringTokenizer tokenizer = new 
                 StringTokenizer(configuredDefaults.trim(), ",");
 	
@@ -1364,7 +1362,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
             return;
         }
 
-        Vector rules = new Vector();
+        Vector<String> rules = new Vector<String>();
         StringTokenizer tokenizer = new 
             StringTokenizer(configuredUndeletables.trim(), ",");
 	
@@ -1381,8 +1379,8 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
 
         // For each rule read from the config file, see if any 
         // predicate is set.
-        mUndeletablePolicies = new Hashtable();
-        for (Enumeration e = rules.elements(); e.hasMoreElements();) {
+        mUndeletablePolicies = new Hashtable<String, IExpression>();
+        for (Enumeration<String> e = rules.elements(); e.hasMoreElements();) {
             String urn = (String) e.nextElement();
 			
             // See if there is predicate in the file
@@ -1429,7 +1427,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor {
         // For each policy in undeletable list make sure that
         // the policy is present, is not disabled and its predicate
         // is not tampered with.
-        for (Enumeration e = mUndeletablePolicies.keys(); 
+        for (Enumeration<String> e = mUndeletablePolicies.keys(); 
             e.hasMoreElements();) {
             String urn = (String) e.nextElement();
 
diff --git a/pki/base/common/src/com/netscape/cmscore/policy/PolicySet.java b/pki/base/common/src/com/netscape/cmscore/policy/PolicySet.java
index 17a19e9d49d12639564eca0fd3d0fd975ff4e6f9..24918a336f5af957a56de21a0e5c5d14f075020e 100644
--- a/pki/base/common/src/com/netscape/cmscore/policy/PolicySet.java
+++ b/pki/base/common/src/com/netscape/cmscore/policy/PolicySet.java
@@ -40,8 +40,8 @@ import com.netscape.cmscore.util.Debug;
  */
 public class PolicySet implements IPolicySet {
     private String mName;
-    private Vector mRuleNames = new Vector();
-    private Vector mRules = new Vector();
+    private Vector<String> mRuleNames = new Vector<String>();
+    private Vector<IPolicyRule> mRules = new Vector<IPolicyRule>();
     private ILogger mLogger = CMS.getLogger();
 
     public PolicySet(String name) {
@@ -140,7 +140,7 @@ public class PolicySet implements IPolicySet {
      *
      * @return An enumeration of rules.
      */
-    public Enumeration getRules() {
+    public Enumeration<IPolicyRule> getRules() {
         return mRules.elements();
     }
 
diff --git a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
index 3af3321d1ff42897ef3a2177dd890e1384d5b942..4f38625946041e3c9eff4cb74bf7d9053246f113 100644
--- a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
@@ -46,9 +46,9 @@ public class ProfileSubsystem implements IProfileSubsystem {
 
     private IConfigStore mConfig = null;
     private ISubsystem mOwner = null;
-    private Vector mProfileIds = new Vector();
-    private Hashtable mProfiles = new Hashtable();
-    private Hashtable mProfileClassIds = new Hashtable();
+    private Vector<String> mProfileIds = new Vector<String>();
+    private Hashtable<String, IProfile> mProfiles = new Hashtable<String, IProfile>();
+    private Hashtable<String, String> mProfileClassIds = new Hashtable<String, String>();
 
     /**
      * Retrieves the name of this subsystem.
@@ -106,7 +106,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
             CMS.debug("Done Profile Creation - " + id);
         }
 
-        Enumeration ee = getProfileIds();
+        Enumeration<String> ee = getProfileIds();
 
         while (ee.hasMoreElements()) {
             String id = (String) ee.nextElement();
@@ -308,7 +308,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
      * Retrieves a list of profile ids. The return
      * list is of type String.
      */
-    public Enumeration getProfileIds() {
+    public Enumeration<String> getProfileIds() {
         return mProfileIds.elements();
     }
 
diff --git a/pki/base/common/src/com/netscape/cmscore/registry/PluginRegistry.java b/pki/base/common/src/com/netscape/cmscore/registry/PluginRegistry.java
index cde61d6651ee2aa731fafe4497e1b8dd932e5f31..3e1c13fef795895cb1a498011db366076899cbde 100644
--- a/pki/base/common/src/com/netscape/cmscore/registry/PluginRegistry.java
+++ b/pki/base/common/src/com/netscape/cmscore/registry/PluginRegistry.java
@@ -44,7 +44,7 @@ public class PluginRegistry implements IPluginRegistry {
     private IConfigStore mConfig = null;
     private IConfigStore mFileConfig = null;
     private ISubsystem mOwner = null;
-    private Hashtable mTypes = new Hashtable();
+    private Hashtable<String, Hashtable <String ,IPluginInfo>> mTypes = new Hashtable<String, Hashtable<String, IPluginInfo>>();
 
     public PluginRegistry() {
     }
@@ -158,7 +158,7 @@ public class PluginRegistry implements IPluginRegistry {
 
     public void removePluginInfo(String type, String id)
         throws ERegistryException {
-        Hashtable plugins = (Hashtable)mTypes.get(type);
+        Hashtable<String, IPluginInfo> plugins = mTypes.get(type);
         if (plugins == null)
           return;
         plugins.remove(id);
@@ -173,10 +173,10 @@ public class PluginRegistry implements IPluginRegistry {
 
     public void addPluginInfo(String type, String id, IPluginInfo info, int saveConfig)
         throws ERegistryException {
-        Hashtable plugins = (Hashtable) mTypes.get(type); 
+        Hashtable<String, IPluginInfo> plugins =  mTypes.get(type); 
 
         if (plugins == null) {
-            plugins = new Hashtable();
+            plugins = new Hashtable<String, IPluginInfo>();
             mTypes.put(type, plugins);
         }
         Locale locale = Locale.getDefault();
@@ -192,7 +192,7 @@ public class PluginRegistry implements IPluginRegistry {
 
     public void rebuildConfigStore(Locale locale)
         throws ERegistryException {
-        Enumeration types = mTypes.keys();
+        Enumeration<String> types = mTypes.keys();
         StringBuffer typesBuf = new StringBuffer();
 
         while (types.hasMoreElements()) {
@@ -202,9 +202,9 @@ public class PluginRegistry implements IPluginRegistry {
             if (types.hasMoreElements()) {
                 typesBuf.append(",");
             }
-            Hashtable mPlugins = (Hashtable) mTypes.get(type);
+            Hashtable<String, IPluginInfo> mPlugins = mTypes.get(type);
             StringBuffer idsBuf = new StringBuffer();
-            Enumeration plugins = mPlugins.keys();
+            Enumeration<String> plugins = mPlugins.keys();
 
             while (plugins.hasMoreElements()) {
                 String id = (String) plugins.nextElement();
@@ -266,15 +266,15 @@ public class PluginRegistry implements IPluginRegistry {
     /**
      * Returns all type names.
      */
-    public Enumeration getTypeNames() {
+    public Enumeration<String> getTypeNames() {
         return mTypes.keys();
     }
 
     /**
      * Returns a list of identifiers of the given type.
      */
-    public Enumeration getIds(String type) {
-        Hashtable plugins = (Hashtable) mTypes.get(type);
+    public Enumeration<String> getIds(String type) {
+        Hashtable<String, IPluginInfo> plugins =  mTypes.get(type);
 
         if (plugins == null)
             return null;
@@ -285,11 +285,11 @@ public class PluginRegistry implements IPluginRegistry {
      * Retrieves the plugin information.
      */
     public IPluginInfo getPluginInfo(String type, String id) {
-        Hashtable plugins = (Hashtable) mTypes.get(type);
+        Hashtable <String ,IPluginInfo> plugins = mTypes.get(type);
 
         if (plugins == null)
             return null;
-        return (IPluginInfo) plugins.get(id);
+        return plugins.get(id);
     }
 
 }
diff --git a/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java b/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java
index 2da14467ecb746b7f3cd17d7c2947b6ed7a1896f..e7bc05f645d5b2f8492fc1b3a9386ef4ed76399f 100644
--- a/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java
+++ b/pki/base/common/src/com/netscape/cmscore/request/ARequestQueue.java
@@ -830,7 +830,7 @@ class Request
      * this isn't that efficient but will do for now.
      */
     public void copyContents(IRequest req) {
-        Enumeration e = req.getExtDataKeys();
+        Enumeration<String> e = req.getExtDataKeys();
         while (e.hasMoreElements()) {
             String key = (String) e.nextElement();
             if (!key.equals(IRequest.ISSUED_CERTS) &&
@@ -858,11 +858,11 @@ class Request
                (! key.equals(""));
     }
 
-    protected boolean isValidExtDataHashtableValue(Hashtable hash) {
+    protected boolean isValidExtDataHashtableValue(Hashtable<String, String> hash) {
         if (hash == null) {
             return false;
         }
-        Enumeration keys = hash.keys();
+        Enumeration<String> keys = hash.keys();
         while (keys.hasMoreElements()) {
             Object key = keys.nextElement();
             if (! ((key instanceof String) &&
diff --git a/pki/base/common/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java b/pki/base/common/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
index ba3a8d550680b38df71db2f258d3df1d54e03eb7..8104210d946f61b83506673f4b221c768503cf97 100644
--- a/pki/base/common/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
@@ -275,7 +275,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         int i = 0;
 
@@ -320,7 +320,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -382,7 +382,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -427,7 +427,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -471,7 +471,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -511,7 +511,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed on demand
-        Enumeration instances = mOnDemandOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mOnDemandOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -600,7 +600,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed at server startup
-        Enumeration instances = mStartupOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
         int i = 0;
 
@@ -645,7 +645,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed at server startup
-        Enumeration instances = mStartupOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -707,7 +707,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed at server startup
-        Enumeration instances = mStartupOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -753,7 +753,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed at server startup
-        Enumeration instances = mStartupOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -797,7 +797,7 @@ public class SelfTestSubsystem
 
         // loop through all self test plugin instances
         // specified to be executed at server startup
-        Enumeration instances = mStartupOrder.elements();
+        Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
         while (instances.hasMoreElements()) {
             SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -846,7 +846,7 @@ public class SelfTestSubsystem
 
             // loop through all self test plugin instances
             // specified to be executed at server startup
-            Enumeration instances = mStartupOrder.elements();
+            Enumeration<SelfTestOrderedInstance> instances = mStartupOrder.elements();
 
             while (instances.hasMoreElements()) {
                 SelfTestOrderedInstance instance = (SelfTestOrderedInstance)
@@ -980,7 +980,7 @@ public class SelfTestSubsystem
         }
 
         // loop through all self test plugin instances
-        Enumeration instances = mSelfTestInstances.elements();
+        Enumeration<ISelfTest> instances = mSelfTestInstances.elements();
 
         while (instances.hasMoreElements()) {
             ISelfTest instance = (ISelfTest) instances.nextElement();
@@ -1355,7 +1355,7 @@ public class SelfTestSubsystem
             throw new EMissingSelfTestException();
         }
 
-        Enumeration loggerInstances = loggerConfig.getPropertyNames();
+        Enumeration<String> loggerInstances = loggerConfig.getPropertyNames();
 
         if (loggerInstances.hasMoreElements()) {
             loadStatus++;
@@ -1495,7 +1495,7 @@ public class SelfTestSubsystem
             throw new EMissingSelfTestException();
         }
 
-        Enumeration instances = instanceConfig.getPropertyNames();
+        Enumeration<String> instances = instanceConfig.getPropertyNames();
 
         if (instances.hasMoreElements()) {
             loadStatus++;
@@ -1842,7 +1842,7 @@ public class SelfTestSubsystem
     public void startup()
         throws EBaseException {
         // loop through all self test plugin instances
-        Enumeration instances = mSelfTestInstances.elements();
+        Enumeration<ISelfTest> instances = mSelfTestInstances.elements();
 
         while (instances.hasMoreElements()) {
             ISelfTest instance = (ISelfTest) instances.nextElement();
@@ -1852,7 +1852,7 @@ public class SelfTestSubsystem
 
         if (!CMS.isPreOpMode()) {
             // run all self test plugin instances (designated at startup)
-            Enumeration selftests = mStartupOrder.elements();
+            Enumeration<SelfTestOrderedInstance> selftests = mStartupOrder.elements();
 
             if (selftests.hasMoreElements()) {
                 // log that execution of startup self tests has begun
@@ -1883,13 +1883,13 @@ public class SelfTestSubsystem
      */
     public void shutdown() {
         // reverse order of all self test plugin instances
-        Collection  collection = mSelfTestInstances.values();
-        Vector list = new Vector(collection);
+        Collection<ISelfTest>  collection = mSelfTestInstances.values();
+        Vector<ISelfTest> list = new Vector<ISelfTest>(collection);
 
         Collections.reverse(list);
 
         // loop through all self test plugin instances
-        ListIterator instances = list.listIterator();
+        ListIterator<ISelfTest> instances = list.listIterator();
 
         while (instances.hasNext()) {
             ISelfTest instance = (ISelfTest) instances.next();
diff --git a/pki/base/common/src/com/netscape/cmscore/usrgrp/Group.java b/pki/base/common/src/com/netscape/cmscore/usrgrp/Group.java
index 40f3281eed5173fd3dfe43b51dde6b8dd58aad68..d91eedf93a4f2d34983a5bae555207afd7641258 100644
--- a/pki/base/common/src/com/netscape/cmscore/usrgrp/Group.java
+++ b/pki/base/common/src/com/netscape/cmscore/usrgrp/Group.java
@@ -40,10 +40,10 @@ public class Group implements IGroup {
     private static final long serialVersionUID = -1264387079578766750L;
     private IUsrGrp mBase = null;
     private String mName = null;
-    private Vector mMembers = new Vector();
+    private Vector<String> mMembers = new Vector<String>();
     private String mDescription = null;
 
-    private static final Vector mNames = new Vector();
+    private static final Vector<String> mNames = new Vector<String>();
     static {
         mNames.addElement(ATTR_NAME);
         mNames.addElement(ATTR_ID);
@@ -75,7 +75,7 @@ public class Group implements IGroup {
         mMembers.addElement(name);
     }
 
-    public Enumeration getMemberNames() {
+    public Enumeration<String> getMemberNames() {
         return mMembers.elements();
     }
 
@@ -90,13 +90,14 @@ public class Group implements IGroup {
         return false;
     }
 
-    public void set(String name, Object object) throws EBaseException {
+    @SuppressWarnings("unchecked")
+	public void set(String name, Object object) throws EBaseException {
         if (name.equals(ATTR_NAME)) {
             throw new EBaseException(CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name));
         } else if (name.equals(ATTR_ID)) {
             throw new EBaseException(CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name));
         } else if (name.equals(ATTR_MEMBERS)) {
-            mMembers = (Vector) object;
+            mMembers = (Vector<String>) object;
         } else if (name.equals(ATTR_DESCRIPTION)) {
             mDescription = (String) object;
         } else {
@@ -120,7 +121,7 @@ public class Group implements IGroup {
         throw new EBaseException(CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name));
     }
 
-    public Enumeration getElements() {
+    public Enumeration<String> getElements() {
         return mNames.elements();
     }
 }
diff --git a/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java b/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
index 0c11803620f1f97308b648ce78dbc99c982a36d1..6b25410eb5a49f55f37e1ffe422397ee2e5cf17a 100644
--- a/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/usrgrp/UGSubsystem.java
@@ -197,7 +197,7 @@ public final class UGSubsystem implements IUGSubsystem {
 
         try {
             if (userid.indexOf('=') == -1) {
-                Enumeration e = findUsers(userid);
+                Enumeration<IUser> e = findUsers(userid);
 
                 if (e != null && e.hasMoreElements()) {
                     IUser u = (IUser) e.nextElement();
@@ -215,7 +215,7 @@ public final class UGSubsystem implements IUGSubsystem {
                     LDAPSearchResults res = 
                         ldapconn.search(userid,
                             LDAPv2.SCOPE_SUB, "(objectclass=*)", null, false);
-                    Enumeration e = buildUsers(res);
+                    Enumeration<IUser> e = buildUsers(res);
 
                     if (e.hasMoreElements()) {
                         return (IUser) e.nextElement();
@@ -248,7 +248,7 @@ public final class UGSubsystem implements IUGSubsystem {
             LDAPSearchResults res = 
                 ldapconn.search(getUserBaseDN(),
                     LDAPConnection.SCOPE_SUB, filter, null, false);
-            Enumeration e = buildUsers(res);
+            Enumeration<IUser> e = buildUsers(res);
 
             return (User) e.nextElement();
         } catch (LDAPException e) {
@@ -306,7 +306,7 @@ public final class UGSubsystem implements IUGSubsystem {
                     LDAPv2.SCOPE_SUB, "(" + filter + ")", 
                     null, false);
 
-            Enumeration e = buildUsers(res);
+            Enumeration<IUser> e = buildUsers(res);
 
             return (User) e.nextElement();
         } catch (LDAPException e) {
@@ -333,7 +333,7 @@ public final class UGSubsystem implements IUGSubsystem {
     /**
      * Searchs for identities that matches the filter.
      */
-    public Enumeration findUsers(String filter) throws EUsrGrpException {
+    public Enumeration<IUser> findUsers(String filter) throws EUsrGrpException {
         if (filter == null) {
             return null;
         }
@@ -346,7 +346,7 @@ public final class UGSubsystem implements IUGSubsystem {
                     LDAPv2.SCOPE_SUB, "(uid=" + filter + ")", 
                     null, false);
 
-            Enumeration e = buildUsers(res);
+            Enumeration<IUser> e = buildUsers(res);
 
             return e;
         } catch (LDAPException e) {
@@ -373,7 +373,7 @@ public final class UGSubsystem implements IUGSubsystem {
      * Searchs for identities that matches the filter.
      * retrieves uid only, for efficiency of user listing
      */
-    public Enumeration listUsers(String filter) throws EUsrGrpException {
+    public Enumeration<IUser> listUsers(String filter) throws EUsrGrpException {
         if (filter == null) {
             return null;
         }
@@ -392,7 +392,7 @@ public final class UGSubsystem implements IUGSubsystem {
             cons.setMaxResults(0);
             LDAPSearchResults res = ldapconn.search(getUserBaseDN(),
                     LDAPv2.SCOPE_SUB, "(uid=" + filter + ")", attrs, false, cons);
-            Enumeration e = lbuildUsers(res);
+            Enumeration<IUser> e = lbuildUsers(res);
 
             return e;
         } catch (LDAPException e) {
@@ -412,9 +412,9 @@ public final class UGSubsystem implements IUGSubsystem {
         return null;
     }
 
-    protected Enumeration lbuildUsers(LDAPSearchResults res) throws
+    protected Enumeration<IUser> lbuildUsers(LDAPSearchResults res) throws
             EUsrGrpException {
-        Vector v = new Vector();
+        Vector<IUser> v = new Vector<IUser>();
 
         while (res.hasMoreElements()) {
             LDAPEntry entry = (LDAPEntry) res.nextElement();
@@ -425,9 +425,9 @@ public final class UGSubsystem implements IUGSubsystem {
         return v.elements();
     }
 
-    protected Enumeration buildUsers(LDAPSearchResults res) throws
+    protected Enumeration<IUser> buildUsers(LDAPSearchResults res) throws
             EUsrGrpException {
-        Vector v = new Vector();
+        Vector<IUser> v = new Vector<IUser>();
 
         if (res != null) {
             while (res.hasMoreElements()) {
@@ -469,13 +469,14 @@ public final class UGSubsystem implements IUGSubsystem {
             entry.getAttribute(LDAP_ATTR_USER_CERT);
 
         if (certAttr != null) {
-            Vector certVector = new Vector();
-            Enumeration e = certAttr.getByteValues();
+            Vector<X509Certificate> certVector = new Vector<X509Certificate>();
+            @SuppressWarnings("unchecked")
+			Enumeration<byte[]> e = certAttr.getByteValues();
 
             try {
                 for (; e != null && e.hasMoreElements();) {
                     X509Certificate cert = new X509CertImpl(
-                            (byte[]) e.nextElement());
+                             e.nextElement());
 
                     certVector.addElement(cert);
                 }
@@ -486,7 +487,7 @@ public final class UGSubsystem implements IUGSubsystem {
             if (certVector != null && certVector.size() != 0) {
                 // Make an array of certs
                 X509Certificate[] certArray = new X509Certificate[certVector.size()];
-                Enumeration en = certVector.elements();
+                Enumeration<X509Certificate> en = certVector.elements();
                 int i = 0;
 
                 while (en.hasMoreElements()) {
@@ -544,10 +545,11 @@ public final class UGSubsystem implements IUGSubsystem {
         LDAPAttribute mailAttr = entry.getAttribute("mail");
 
         if (mailAttr != null) {
-            Enumeration en = mailAttr.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = mailAttr.getStringValues();
 
             if (en != null && en.hasMoreElements()) {
-                String mail = (String) en.nextElement();
+                String mail =  en.nextElement();
 
                 if (mail != null) {
                     id.setEmail(mail);
@@ -570,7 +572,8 @@ public final class UGSubsystem implements IUGSubsystem {
         LDAPAttribute phoneAttr = entry.getAttribute("telephonenumber");
 
         if (phoneAttr != null) {
-            Enumeration en = phoneAttr.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = phoneAttr.getStringValues();
 
             if (en != null && en.hasMoreElements()) {
                 String phone = (String) en.nextElement();
@@ -589,7 +592,8 @@ public final class UGSubsystem implements IUGSubsystem {
         if (userTypeAttr == null) 
             id.setUserType("");
         else {
-            Enumeration en = userTypeAttr.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = userTypeAttr.getStringValues();
 
             if (en != null && en.hasMoreElements()) {
                 String userType = (String) en.nextElement();
@@ -607,7 +611,8 @@ public final class UGSubsystem implements IUGSubsystem {
         if (userStateAttr == null)
             id.setState("");
         else {
-            Enumeration en = userStateAttr.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = userStateAttr.getStringValues();
 
             if (en != null && en.hasMoreElements()) {
                 String userState = (String) en.nextElement();
@@ -624,8 +629,9 @@ public final class UGSubsystem implements IUGSubsystem {
             entry.getAttribute(LDAP_ATTR_USER_CERT);
 
         if (certAttr != null) {
-            Vector certVector = new Vector();
-            Enumeration e = certAttr.getByteValues();
+            Vector<X509Certificate> certVector = new Vector<X509Certificate>();
+            @SuppressWarnings("unchecked")
+			Enumeration<byte[]> e = certAttr.getByteValues();
 
             try {
                 for (; e != null && e.hasMoreElements();) {
@@ -641,7 +647,7 @@ public final class UGSubsystem implements IUGSubsystem {
             if (certVector != null && certVector.size() != 0) {
                 // Make an array of certs
                 X509Certificate[] certArray = new X509Certificate[certVector.size()];
-                Enumeration en = certVector.elements();
+                Enumeration<X509Certificate> en = certVector.elements();
                 int i = 0;
 
                 while (en.hasMoreElements()) {
@@ -1132,8 +1138,8 @@ public final class UGSubsystem implements IUGSubsystem {
         }
     }
 
-    protected Enumeration buildGroups(LDAPSearchResults res) {
-        Vector v = new Vector();
+    protected Enumeration<IGroup> buildGroups(LDAPSearchResults res) {
+        Vector<IGroup> v = new Vector<IGroup>();
 
         while (res.hasMoreElements()) {
             LDAPEntry entry = (LDAPEntry) res.nextElement();
@@ -1146,7 +1152,7 @@ public final class UGSubsystem implements IUGSubsystem {
     /**
      * Finds groups.
      */
-    public Enumeration findGroups(String filter) {
+    public Enumeration<IGroup> findGroups(String filter) {
         if (filter == null) {
             return null;
         }
@@ -1183,7 +1189,7 @@ public final class UGSubsystem implements IUGSubsystem {
     }
 
     public IGroup findGroup(String filter) {
-        Enumeration groups = findGroups(filter);
+        Enumeration<IGroup> groups = findGroups(filter);
 
         if (groups == null || !groups.hasMoreElements())
             return null;
@@ -1194,7 +1200,7 @@ public final class UGSubsystem implements IUGSubsystem {
      * List groups.  more efficient than find Groups.  only retrieves
      *	 group names and description.
      */
-    public Enumeration listGroups(String filter) throws EUsrGrpException {
+    public Enumeration<IGroup>  listGroups(String filter) throws EUsrGrpException {
         if (filter == null) {
             return null;
         }
@@ -1243,7 +1249,8 @@ public final class UGSubsystem implements IUGSubsystem {
         LDAPAttribute grpDesc = entry.getAttribute("description");
 
         if (grpDesc != null) {
-            Enumeration en = grpDesc.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = grpDesc.getStringValues();
 
             if (en != null && en.hasMoreElements()) {
                 String desc = (String) en.nextElement();
@@ -1274,7 +1281,8 @@ public final class UGSubsystem implements IUGSubsystem {
             return grp;
         }
 
-        Enumeration e = attr.getStringValues();
+        @SuppressWarnings("unchecked")
+		Enumeration<String> e = attr.getStringValues();
 
         while (e.hasMoreElements()) {
             String v = (String) e.nextElement();
@@ -1331,7 +1339,7 @@ public final class UGSubsystem implements IUGSubsystem {
             // read the group object
             LDAPSearchResults res = ldapconn.search(name,
                     LDAPConnection.SCOPE_BASE, "(objectclass=*)", null, false);
-            Enumeration e = buildGroups(res);
+            Enumeration<IGroup> e = buildGroups(res);
 
             if (e == null || e.hasMoreElements() == false)
                 return null;
@@ -1363,7 +1371,8 @@ public final class UGSubsystem implements IUGSubsystem {
             if (attr == null) {
                 return false;
             }
-            Enumeration en = attr.getStringValues();
+            @SuppressWarnings("unchecked")
+			Enumeration<String> en = attr.getStringValues();
 
             for (; en.hasMoreElements();) {
                 String v = (String) en.nextElement();
@@ -1491,7 +1500,7 @@ public final class UGSubsystem implements IUGSubsystem {
             attrs.add(new LDAPAttribute("objectclass", oc));
             attrs.add(new LDAPAttribute("cn", group.getGroupID()));
             attrs.add(new LDAPAttribute("description", group.getDescription()));
-            Enumeration e = grp.getMemberNames();
+            Enumeration<String> e = grp.getMemberNames();
 
             if (e.hasMoreElements() == true) {
                 LDAPAttribute attrMembers = new LDAPAttribute("uniquemember");
@@ -1589,7 +1598,7 @@ public final class UGSubsystem implements IUGSubsystem {
                     new LDAPAttribute("description", desc));
             }
 
-            Enumeration e = grp.getMemberNames();
+            Enumeration<String> e = grp.getMemberNames();
 
             if (e.hasMoreElements() == true) {
                 while (e.hasMoreElements()) {
-- 
1.7.7.3

