You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2013/07/26 01:59:58 UTC

svn commit: r1507157 [2/2] - in /portals/jetspeed-2/portal/trunk: ./ components/jetspeed-locator/src/main/java/org/apache/jetspeed/profiler/impl/ components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/ components/jetspeed-por...

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java Thu Jul 25 23:59:57 2013
@@ -16,24 +16,6 @@
  */
 package org.apache.jetspeed.profiler.impl;
 
-import java.io.Serializable;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.security.auth.Subject;
-import javax.servlet.http.HttpSessionActivationListener;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.servlet.http.HttpSessionEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.administration.PortalConfiguration;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
@@ -51,95 +33,142 @@ import org.apache.jetspeed.security.Subj
 import org.apache.jetspeed.security.UserSubjectPrincipal;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.BeanFactoryAware;
 
+import javax.security.auth.Subject;
+import javax.servlet.http.HttpSessionActivationListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpSessionEvent;
+import java.io.Serializable;
+import java.security.Principal;
+import java.util.*;
+
 /**
  * JetspeedTransactionalProfiler
- * 
+ *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
  * @version $Id$
  */
-public class JetspeedProfilerImpl extends InitablePersistenceBrokerDaoSupport 
-        implements Profiler, BeanFactoryAware
-{
-    /** Profiler context session attribute name */
+public class JetspeedProfilerImpl extends InitablePersistenceBrokerDaoSupport
+        implements Profiler, BeanFactoryAware {
+    /**
+     * Profiler context session attribute name
+     */
     public final static String PROFILER_CONTEXT_ATTRIBUTE_NAME = "org.apache.jetspeed.profiler.ProfilerContext";
-    
-    /** Default guest principal name */
+
+    /**
+     * Default guest principal name
+     */
     public final static String DEFAULT_GUEST_PRINCIPAL_NAME = "guest";
-    
-    /** Default rule principal name */
+
+    /**
+     * Default rule principal name
+     */
     public final static String DEFAULT_RULE_PRINCIPAL_NAME = "*";
-    
-    /** Default and guest rule cache reaping interval */
+
+    /**
+     * Default and guest rule cache reaping interval
+     */
     public final static long DEFAULT_AND_GUEST_RULE_REAPING_INTERVAL = 30000;
 
-    /** The default rule. */
+    /**
+     * The default rule.
+     */
     public final static String DEFAULT_RULE = "j1";
-    
-    /** Commons logging */
+
+    /**
+     * Commons logging
+     */
     protected final static Logger log = LoggerFactory.getLogger(JetspeedProfilerImpl.class);
 
     /**
      * This is the principal that is used if there are no principal to rule associations for the current principal
      */
     public final static Principal DEFAULT_RULE_PRINCIPAL = new Principal() {
-        public String getName()
-        {
+        public String getName() {
             return DEFAULT_RULE_PRINCIPAL_NAME;
         }
     };
 
-    /** The default locator class implementation */
+    /**
+     * The default locator class implementation
+     */
     private String locatorBean = "ProfileLocator";
 
-    /** The default principalRule association class implementation */
+    /**
+     * The default principalRule association class implementation
+     */
     private Class prRuleClass;
-    
+
     private String principalRuleBean = "PrincipalRule";
-    
-    /** The base (abstract) profilingRule class implementation */
+
+    /**
+     * The base (abstract) profilingRule class implementation
+     */
     private String profilingRuleStandardBean = "StandardProfilingRule";
-    
-    /** The base (abstract) profilingRule class implementation */
-    private String profilingRuleFallbackBean = "RoleFallbackProfilingRule";    
-    
-    /** The base (abstract) profilingRule class implementation */
+
+    /**
+     * The base (abstract) profilingRule class implementation
+     */
+    private String profilingRuleFallbackBean = "RoleFallbackProfilingRule";
+
+    /**
+     * The base (abstract) profilingRule class implementation
+     */
     private Class profilingRuleClass = AbstractProfilingRule.class;
 
-    /** The configured default rule for this portal */
+    /**
+     * The configured default rule for this portal
+     */
     private String defaultRule = DEFAULT_RULE;
 
-    /** list of transient and persistent rules cached by principal and locator name */
-    private Map principalRules = Collections.synchronizedMap(new HashMap());
+    /**
+     * list of transient and persistent rules cached by principal and locator name
+     */
+    private Map<String, PrincipalRule> principalRules =
+            Collections.synchronizedMap(new HashMap<String, PrincipalRule>());
 
-    /** list of persistent rules cached by principal */
-    private Map rulesPerPrincipal = Collections.synchronizedMap(new HashMap());
+    /**
+     * list of persistent rules cached by principal
+     */
+    private Map<String, Collection<PrincipalRule>> rulesPerPrincipal =
+            Collections.synchronizedMap(new HashMap<String, Collection<PrincipalRule>>());
 
-    /** list of all transient and persistent rules cached by principal */
-    private Map allRulesPerPrincipal = Collections.synchronizedMap(new HashMap());
+    /**
+     * list of all transient and persistent rules cached by principal
+     */
+    private Map<String, Collection<PrincipalRule>> allRulesPerPrincipal =
+            Collections.synchronizedMap(new HashMap<String, Collection<PrincipalRule>>());
 
     private ProfileResolvers resolvers;
 
-    /** the default criterion bean name */
+    /**
+     * the default criterion bean name
+     */
     private String ruleCriterionBean = "RuleCriterion";
 
     /**
      * added support for bean factory to create profile rules
      */
     private BeanFactory beanFactory;
-    
-    /** last default and guest reap time */
+
+    /**
+     * last default and guest reap time
+     */
     private volatile long lastDefaultGuestReapTime = System.currentTimeMillis();
-    
-    /** configured guest principal name */
+
+    /**
+     * configured guest principal name
+     */
     private String guestPrincipalName;
 
     public JetspeedProfilerImpl(String repositoryPath,
-            ProfileResolvers resolvers)
-    {
+                                ProfileResolvers resolvers) {
         super(repositoryPath);
         this.resolvers = resolvers;
     }
@@ -152,16 +181,12 @@ public class JetspeedProfilerImpl extend
      * impl services.profiler.principalRule.impl = the pluggable Principal Rule
      * impl services.profiler.profilingRule.impl = the pluggable Profiling Rule
      * impl
-     * 
-     * @param properties
-     *            Properties for this component described above
-     * @throws ClassNotFoundException
-     *             if any the implementation classes defined within the
-     *             <code>properties</code> argument could not be found.
+     *
+     * @throws ClassNotFoundException if any the implementation classes defined within the
+     *                                <code>properties</code> argument could not be found.
      */
     public JetspeedProfilerImpl(String repositoryPath, String defaultRule,
-            ProfileResolvers resolvers) throws ClassNotFoundException
-    {
+                                ProfileResolvers resolvers) throws ClassNotFoundException {
         this(repositoryPath, resolvers);
         this.defaultRule = defaultRule;
     }
@@ -171,9 +196,8 @@ public class JetspeedProfilerImpl extend
      *             by container managed bean factory
      */
     public JetspeedProfilerImpl(String repositoryPath, String defaultRule,
-            Properties properties, ProfileResolvers resolvers)
-            throws ClassNotFoundException
-    {
+                                Properties properties, ProfileResolvers resolvers)
+            throws ClassNotFoundException {
         this(repositoryPath, defaultRule, resolvers);
         initModelClasses(properties); // TODO: move this to
         // start()
@@ -183,20 +207,17 @@ public class JetspeedProfilerImpl extend
      * support passing of rule creation classes
      */
     public JetspeedProfilerImpl(String repositoryPath, String defaultRule,
-            ProfileResolvers resolvers, Map ruleConstructors,
-            String ruleCriterionBean) throws ClassNotFoundException
-    {
+                                ProfileResolvers resolvers, Map<String,String> ruleConstructors,
+                                String ruleCriterionBean) throws ClassNotFoundException {
         this(repositoryPath, defaultRule, resolvers);
         this.ruleCriterionBean = ruleCriterionBean;
         initRuleClasses(ruleConstructors);
     }
 
     /**
-     * @param defaultRule
-     *            The default rule to set.
+     * @param defaultRule The default rule to set.
      */
-    public void setDefaultRule(String defaultRule)
-    {
+    public void setDefaultRule(String defaultRule) {
         this.defaultRule = defaultRule;
     }
 
@@ -205,12 +226,11 @@ public class JetspeedProfilerImpl extend
      *             by container managed bean factory
      */
     private void initModelClasses(Properties properties)
-            throws ClassNotFoundException
-    {
+            throws ClassNotFoundException {
 
         /**
          * String modelName = "";
-         * 
+         *
          * if ((modelName = properties.getProperty("locator.impl")) != null) { //
          * locatorClassName = modelName; } if ((modelName =
          * properties.getProperty("principalRule.impl")) != null) {
@@ -221,12 +241,10 @@ public class JetspeedProfilerImpl extend
     }
 
     public ProfileLocator getProfile(RequestContext context, String locatorName)
-            throws ProfilerException
-    {
+            throws ProfilerException {
         // get the principal representing the currently logged on user
         Subject subject = context.getSubject();
-        if (subject == null)
-        {
+        if (subject == null) {
             String msg = "Invalid (null) Subject in request pipeline";
             log.error(msg);
             throw new ProfilerException(msg);
@@ -235,27 +253,24 @@ public class JetspeedProfilerImpl extend
         // find the first principal if no UserPrincipal isn't available
         Principal principal = SubjectHelper.getBestPrincipal(subject,
                 UserSubjectPrincipal.class);
-        if (principal == null)
-        {
+        if (principal == null) {
             String msg = "Could not find a principle for subject in request pipeline";
             log.error(msg);
             throw new ProfilerException(msg);
         }
 
         // setup/maintain profiler context for session end notification
-        setupProfilerContext(context);        
+        setupProfilerContext(context);
 
         // find a profiling rule for this principal
         ProfilingRule rule = getRuleForPrincipal(principal, locatorName);
-        if (null == rule)
-        {
+        if (null == rule) {
             log.warn("Could not find profiling rule for principal: "
                     + principal);
             rule = this.getDefaultRule();
         }
 
-        if (null == rule)
-        {
+        if (null == rule) {
             String msg = "Couldn't find any profiling rules including default rule for principal "
                     + principal;
             log.error(msg);
@@ -266,20 +281,17 @@ public class JetspeedProfilerImpl extend
     }
 
     public ProfileLocator getDefaultProfile(RequestContext context,
-            String locatorName) throws ProfilerException
-    {
+                                            String locatorName) throws ProfilerException {
         // find a profiling rule for the default principal
         ProfilingRule rule = getRuleForPrincipal(DEFAULT_RULE_PRINCIPAL,
                 locatorName);
-        if (null == rule)
-        {
+        if (null == rule) {
             log.warn("Could not find profiling rule for principal: "
                     + DEFAULT_RULE_PRINCIPAL);
             rule = this.getDefaultRule();
         }
 
-        if (null == rule)
-        {
+        if (null == rule) {
             String msg = "Couldn't find any profiling rules including default rule for principal "
                     + DEFAULT_RULE_PRINCIPAL;
             log.error(msg);
@@ -296,8 +308,7 @@ public class JetspeedProfilerImpl extend
      *      org.apache.jetspeed.profiler.rules.ProfilingRule)
      */
     public ProfileLocator getProfile(RequestContext context, ProfilingRule rule)
-            throws ProfilerException
-    {
+            throws ProfilerException {
         // create a profile locator for given rule
         return rule.apply(context, this);
     }
@@ -309,20 +320,17 @@ public class JetspeedProfilerImpl extend
      *      java.lang.String)
      */
     public ProfilingRule getRuleForPrincipal(Principal principal,
-            String locatorName)
-    {
+                                             String locatorName) {
         ProfilingRule rule = null;
         // lookup the rule for the given principal in our user/rule table
         PrincipalRule pr = lookupPrincipalRule(principal.getName(), locatorName);
 
         // if not found, fallback to the locator named rule or system wide rule
-        if (pr == null)
-        {
+        if (pr == null) {
             // find rule on locator name
             rule = getRule(locatorName);
 
-            if (rule == null)
-            {
+            if (rule == null) {
                 // if not found, fallback to the system wide rule
                 rule = getDefaultRule();
             }
@@ -334,8 +342,7 @@ public class JetspeedProfilerImpl extend
                     locatorName), pr);
             // track cached principal rules
             trackCachedPrincipalRulesPut(principal.getName(), pr);
-        } else
-        {
+        } else {
             // Get the associated rule
             rule = pr.getProfilingRule();
         }
@@ -345,19 +352,15 @@ public class JetspeedProfilerImpl extend
 
     /**
      * Internal method to ensure we have a valid principalRule class for queries
-     * 
+     *
      * @return the class object for the principalRule
      */
-    private Class getPrincipalRuleClass()
-    {
-        if (this.prRuleClass == null)
-        {
-            try
-            {
+    private Class getPrincipalRuleClass() {
+        if (this.prRuleClass == null) {
+            try {
                 PrincipalRule tempRule = createPrincipalRule();
                 this.prRuleClass = tempRule.getClass();
-            } catch (Exception e)
-            {
+            } catch (Exception e) {
                 e.printStackTrace();
             }
         }
@@ -371,8 +374,7 @@ public class JetspeedProfilerImpl extend
      *      org.apache.jetspeed.profiler.rules.ProfilingRule, java.lang.String)
      */
     public void setRuleForPrincipal(Principal principal, ProfilingRule rule,
-            String locatorName)
-    {
+                                    String locatorName) {
         Criteria c = new Criteria();
         c.addEqualTo("principalName", principal.getName());
         c.addEqualTo("locatorName", locatorName);
@@ -380,8 +382,7 @@ public class JetspeedProfilerImpl extend
                 .getObjectByQuery(
                         QueryFactory.newQuery(getPrincipalRuleClass(), c));
 
-        if (pr == null)
-        {
+        if (pr == null) {
             pr = new PrincipalRuleImpl(); // TODO: factory
             pr.setPrincipalName(principal.getName());
             pr.setLocatorName(locatorName);
@@ -398,25 +399,23 @@ public class JetspeedProfilerImpl extend
         rulesPerPrincipal.remove(principal.getName());
     }
 
-    private String makePrincipalRuleKey(String principal, String locator)
-    {
+    private String makePrincipalRuleKey(String principal, String locator) {
         return principal + ":" + locator;
     }
 
     /**
      * Helper function to lookup principal rule associations by principal
-     * 
-     * @param principal
-     *            The string representation of the principal name.
+     *
+     * @param principal The string representation of the principal name.
      * @return The found PrincipalRule associated with the principal key or null
      *         if not found.
      */
     private PrincipalRule lookupPrincipalRule(String principal,
-            String locatorName)
-    {
-        PrincipalRule pr = (PrincipalRule) principalRules
-                .get(makePrincipalRuleKey(principal, locatorName));
-        if (pr != null) { return pr; }
+                                              String locatorName) {
+        PrincipalRule pr = principalRules.get(makePrincipalRuleKey(principal, locatorName));
+        if (pr != null) {
+            return pr;
+        }
         Criteria c = new Criteria();
         c.addEqualTo("principalName", principal);
         c.addEqualTo("locatorName", locatorName);
@@ -436,8 +435,7 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#getDefaultRule()
      */
-    public ProfilingRule getDefaultRule()
-    {
+    public ProfilingRule getDefaultRule() {
         return getRule(this.defaultRule);
     }
 
@@ -446,14 +444,10 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#getRules()
      */
-    public Collection getRules()
-    {
-        Collection rules = getPersistenceBrokerTemplate().getCollectionByQuery(
+    public Collection<ProfilingRule> getRules() {
+        Collection<ProfilingRule> rules = getPersistenceBrokerTemplate().getCollectionByQuery(
                 QueryFactory.newQuery(profilingRuleClass, new Criteria()));
-        Iterator r = rules.iterator();
-        while (r.hasNext())
-        {
-            ProfilingRule rule = (ProfilingRule) r.next();
+        for (ProfilingRule rule : rules) {
             rule.setResolvers(resolvers);
         }
         return rules;
@@ -464,15 +458,12 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#getRule(java.lang.String)
      */
-    public ProfilingRule getRule(String id)
-    {
+    public ProfilingRule getRule(String id) {
         Criteria c = new Criteria();
         c.addEqualTo("id", id);
-
         ProfilingRule rule = (ProfilingRule) getPersistenceBrokerTemplate()
                 .getObjectByQuery(QueryFactory.newQuery(profilingRuleClass, c));
-        if (rule != null)
-        {
+        if (rule != null) {
             rule.setResolvers(resolvers);
         }
         return rule;
@@ -483,22 +474,19 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#getLocatorNamesForPrincipal(java.security.Principal)
      */
-    public String[] getLocatorNamesForPrincipal(Principal principal)
-    {
+    public String[] getLocatorNamesForPrincipal(Principal principal) {
         Criteria c = new Criteria();
         c.addEqualTo("principalName", principal.getName());
 
-        Collection result = getPersistenceBrokerTemplate()
+        Collection<PrincipalRule> result = getPersistenceBrokerTemplate()
                 .getCollectionByQuery(
                         QueryFactory.newQuery(getPrincipalRuleClass(), c));
-        if (result.size() == 0) { return new String[]
-        {}; }
+        if (result.size() == 0) {
+            return new String[]{};
+        }
         String[] names = new String[result.size()];
-        Iterator it = result.iterator();
         int ix = 0;
-        while (it.hasNext())
-        {
-            PrincipalRule pr = (PrincipalRule) it.next();
+        for (PrincipalRule pr : result) {
             names[ix] = pr.getLocatorName();
             pr.getProfilingRule().setResolvers(resolvers);
             ix++;
@@ -511,20 +499,14 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#getRulesForPrincipal(java.security.Principal)
      */
-    public Collection getRulesForPrincipal(Principal principal)
-    {
-
-        Collection rules = (Collection) this.rulesPerPrincipal.get(principal
-                .getName());
+    public Collection<PrincipalRule> getRulesForPrincipal(Principal principal) {
+        Collection<PrincipalRule> rules = this.rulesPerPrincipal.get(principal.getName());
         if (rules != null) return rules;
         Criteria c = new Criteria();
         c.addEqualTo("principalName", principal.getName());
         rules = getPersistenceBrokerTemplate().getCollectionByQuery(
                 QueryFactory.newQuery(getPrincipalRuleClass(), c));
-        Iterator r = rules.iterator();
-        while (r.hasNext())
-        {
-            PrincipalRule pr = (PrincipalRule) r.next();
+        for (PrincipalRule pr : rules) {
             ProfilingRule rule = pr.getProfilingRule();
             if (rule != null) rule.setResolvers(resolvers);
         }
@@ -538,39 +520,28 @@ public class JetspeedProfilerImpl extend
      * @see org.apache.jetspeed.profiler.Profiler#getProfileLocators(org.apache.jetspeed.request.RequestContext,
      *      java.security.Principal)
      */
-    public Map getProfileLocators(RequestContext context, Principal principal)
-            throws ProfilerException
-    {
+    public Map<String, ProfileLocator> getProfileLocators(RequestContext context, Principal principal)
+            throws ProfilerException {
         // setup/maintain profiler context for session end notification
         setupProfilerContext(context);
-        
+
         // get profile locators
-        Map locators = new HashMap();
-        Collection rules = getRulesForPrincipal(principal);
+        Map<String, ProfileLocator> locators = new HashMap<String, ProfileLocator>();
+        Collection<PrincipalRule> rules = getRulesForPrincipal(principal);
 
-        Iterator it = rules.iterator();
-        while (it.hasNext())
-        {
-            PrincipalRule pr = (PrincipalRule) it.next();
-            locators.put(pr.getLocatorName(), getProfile(context, pr
-                    .getLocatorName()));
+        for (PrincipalRule pr : rules) {
+            locators.put(pr.getLocatorName(), getProfile(context, pr.getLocatorName()));
         }
         return locators;
     }
 
-    public Map getDefaultProfileLocators(RequestContext context)
-            throws ProfilerException
-    {
+    public Map<String, ProfileLocator> getDefaultProfileLocators(RequestContext context)
+            throws ProfilerException {
         // get default profile locators
-        Map locators = new HashMap();
-        Collection rules = getRulesForPrincipal(DEFAULT_RULE_PRINCIPAL);
-
-        Iterator it = rules.iterator();
-        while (it.hasNext())
-        {
-            PrincipalRule pr = (PrincipalRule) it.next();
-            locators.put(pr.getLocatorName(), getDefaultProfile(context, pr
-                    .getLocatorName()));
+        Map<String, ProfileLocator> locators = new HashMap<String, ProfileLocator>();
+        Collection<PrincipalRule> rules = getRulesForPrincipal(DEFAULT_RULE_PRINCIPAL);
+        for (PrincipalRule pr : rules) {
+            locators.put(pr.getLocatorName(), getDefaultProfile(context, pr.getLocatorName()));
         }
         return locators;
     }
@@ -580,8 +551,7 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#storeProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule)
      */
-    public void storeProfilingRule(ProfilingRule rule) throws ProfilerException
-    {
+    public void storeProfilingRule(ProfilingRule rule) throws ProfilerException {
         getPersistenceBrokerTemplate().store(rule);
     }
 
@@ -591,8 +561,7 @@ public class JetspeedProfilerImpl extend
      * @see org.apache.jetspeed.profiler.Profiler#deleteProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule)
      */
     public void deleteProfilingRule(ProfilingRule rule)
-            throws ProfilerException
-    {
+            throws ProfilerException {
         getPersistenceBrokerTemplate().delete(rule);
     }
 
@@ -601,8 +570,7 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#storePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule)
      */
-    public void storePrincipalRule(PrincipalRule rule) throws ProfilerException
-    {
+    public void storePrincipalRule(PrincipalRule rule) throws ProfilerException {
         getPersistenceBrokerTemplate().store(rule);
     }
 
@@ -612,8 +580,7 @@ public class JetspeedProfilerImpl extend
      * @see org.apache.jetspeed.profiler.Profiler#deletePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule)
      */
     public void deletePrincipalRule(PrincipalRule rule)
-            throws ProfilerException
-    {
+            throws ProfilerException {
         getPersistenceBrokerTemplate().delete(rule);
         // reset persistent rules per principal
         rulesPerPrincipal.remove(rule.getPrincipalName());
@@ -630,66 +597,52 @@ public class JetspeedProfilerImpl extend
      * @param beanFactory automatically provided by framework @throws
      * BeansException
      */
-    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
-    {
+    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
         this.beanFactory = beanFactory;
     }
 
     /**
      * added logic to get the settings for creating the various rule related
      * instances
-     * 
-     * @param classes
+     *
+     * @param beans
      * @throws ClassNotFoundException
      */
-    private void initRuleClasses(Map beans) throws ClassNotFoundException
-    {
+    private void initRuleClasses(Map<String,String> beans) throws ClassNotFoundException {
 
         String beanName = "";
-        try
-        {
-            if ((beanName = (String) beans.get("locator")) != null)
-            {
+        try {
+            if ((beanName = (String) beans.get("locator")) != null) {
                 this.locatorBean = beanName;
             }
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             String msg = "Exception in setting locatorbeanName : "
                     + e.getLocalizedMessage();
             log.error(msg);
         }
-        try
-        {
-            if ((beanName = (String) beans.get("principal")) != null)
-            {
+        try {
+            if ((beanName = (String) beans.get("principal")) != null) {
                 this.principalRuleBean = beanName;
             }
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             String msg = "Exception in setting principalRulebeanName : "
                     + e.getLocalizedMessage();
             log.error(msg);
         }
-        try
-        {
-            if ((beanName = (String) beans.get("standard")) != null)
-            {
+        try {
+            if ((beanName = (String) beans.get("standard")) != null) {
                 this.profilingRuleStandardBean = beanName;
             }
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             String msg = "Exception in setting profilingRuleStandardbeanName : "
                     + e.getLocalizedMessage();
             log.error(msg);
         }
-        try
-        {
-            if ((beanName = (String) beans.get("fallback")) != null)
-            {
+        try {
+            if ((beanName = (String) beans.get("fallback")) != null) {
                 this.profilingRuleFallbackBean = beanName;
             }
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             String msg = "Exception in setting profilingRuleFallback : "
                     + e.getLocalizedMessage();
             log.error(msg);
@@ -703,10 +656,8 @@ public class JetspeedProfilerImpl extend
      * @see org.apache.jetspeed.profiler.Profiler#createProfilingRule(boolean)
      */
     public ProfilingRule createProfilingRule(boolean standard)
-            throws ClassNotFoundException
-    {
-        try
-        {
+            throws ClassNotFoundException {
+        try {
             if (standard)
                 return (ProfilingRule) beanFactory.getBean(
                         this.profilingRuleStandardBean, ProfilingRule.class);
@@ -714,8 +665,7 @@ public class JetspeedProfilerImpl extend
                 return (ProfilingRule) beanFactory.getBean(
                         this.profilingRuleFallbackBean, ProfilingRule.class);
 
-        } catch (BeansException e)
-        {
+        } catch (BeansException e) {
             throw new ClassNotFoundException("Spring failed to create the "
                     + (standard ? "standard" : "fallback")
                     + " profiling rule bean.", e);
@@ -727,16 +677,13 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#createLocator(RequestContext)
      */
-    public ProfileLocator createLocator(RequestContext context)
-    {
-        try
-        {
+    public ProfileLocator createLocator(RequestContext context) {
+        try {
             ProfileLocator locator = (ProfileLocator) beanFactory.getBean(
                     this.locatorBean, ProfileLocator.class);
             locator.init(this, context.getPath(), ((context.getRequest() != null) ? context.getRequest().getServerName() : null));
             return locator;
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("Failed to create locator for " + this.locatorBean
                     + " error : " + e.getLocalizedMessage());
         }
@@ -748,15 +695,12 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#createPrincipalRule()
      */
-    public PrincipalRule createPrincipalRule() throws ClassNotFoundException
-    {
-        try
-        {
+    public PrincipalRule createPrincipalRule() throws ClassNotFoundException {
+        try {
             PrincipalRule principalRule = (PrincipalRule) beanFactory.getBean(
                     this.principalRuleBean, PrincipalRule.class);
             return principalRule;
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("Failed to create principalRule for " + principalRuleBean
                     + " error : " + e.getLocalizedMessage());
             throw new ClassNotFoundException("Spring failed to create the "
@@ -770,15 +714,12 @@ public class JetspeedProfilerImpl extend
      * 
      * @see org.apache.jetspeed.profiler.Profiler#createRuleCriterion()
      */
-    public RuleCriterion createRuleCriterion() throws ClassNotFoundException
-    {
-        try
-        {
+    public RuleCriterion createRuleCriterion() throws ClassNotFoundException {
+        try {
             RuleCriterion ruleCriterion = (RuleCriterion) beanFactory.getBean(
                     this.ruleCriterionBean, RuleCriterion.class);
             return ruleCriterion;
-        } catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("Failed to create principalRule for " + ruleCriterionBean
                     + " error : " + e.getLocalizedMessage());
             throw new ClassNotFoundException("Spring failed to create the "
@@ -786,56 +727,46 @@ public class JetspeedProfilerImpl extend
         }
 
     }
-    
+
     /**
      * Setup and maintain profiler context to be used to reap rule caches
      * for principals on session end.
-     * 
+     *
      * @param context request context
      * @throws ProfilerException when subject or principal not available
      */
-    private void setupProfilerContext(RequestContext context) throws ProfilerException
-    {
+    private void setupProfilerContext(RequestContext context) throws ProfilerException {
         // validate profiler context
         ProfilerContext profilerContext = (ProfilerContext) context.getSessionAttribute(PROFILER_CONTEXT_ATTRIBUTE_NAME);
-        try
-        {
+        try {
             // access session principal and test for change
             Principal principal = SubjectHelper.getBestPrincipal(context.getSubject(), UserSubjectPrincipal.class);
-            if (principal == null)
-            {
+            if (principal == null) {
                 throw new NullPointerException("Principal not found");
             }
-            if ((profilerContext == null) || (profilerContext.getPrincipal() != principal))
-            {
+            if ((profilerContext == null) || (profilerContext.getPrincipal() != principal)) {
                 // setup/reset profiler context
                 context.setSessionAttribute(PROFILER_CONTEXT_ATTRIBUTE_NAME, new ProfilerContext(this, principal));
             }
-        }
-        catch (Exception e)
-        {
-            String message = "Unable to access principal in pipeline: "+e;
+        } catch (Exception e) {
+            String message = "Unable to access principal in pipeline: " + e;
             log.error(message, e);
             throw new ProfilerException(message, e);
         }
     }
-    
+
     /**
      * Track all put rules, (persistent and transient), cached for a principal.
-     * 
+     *
      * @param principalName name of principal rules is cached under
-     * @param rule rule cached
+     * @param rule          rule cached
      */
-    private void trackCachedPrincipalRulesPut(String principalName, PrincipalRule rule)
-    {
-        if (rule != null)
-        {
+    private void trackCachedPrincipalRulesPut(String principalName, PrincipalRule rule) {
+        if (rule != null) {
             // maintain list of all rules cached per principal
-            synchronized (allRulesPerPrincipal)
-            {
-                Collection allRules = (Collection)allRulesPerPrincipal.get(principalName);
-                if (allRules == null)
-                {
+            synchronized (allRulesPerPrincipal) {
+                Collection<PrincipalRule> allRules = allRulesPerPrincipal.get(principalName);
+                if (allRules == null) {
                     allRules = new ArrayList(4);
                     allRulesPerPrincipal.put(principalName, allRules);
                 }
@@ -846,20 +777,16 @@ public class JetspeedProfilerImpl extend
 
     /**
      * Track all removed rules, (persistent and transient), cached for a principal.
-     * 
+     *
      * @param principalName name of principal rules is cached under
-     * @param rule rule cached
+     * @param rule          rule cached
      */
-    private void trackCachedPrincipalRulesRemoved(String principalName, PrincipalRule rule)
-    {
-        if (rule != null)
-        {
+    private void trackCachedPrincipalRulesRemoved(String principalName, PrincipalRule rule) {
+        if (rule != null) {
             // maintain list of all rules cached per principal
-            synchronized (allRulesPerPrincipal)
-            {
-                Collection allRules = (Collection)allRulesPerPrincipal.get(principalName);
-                if (allRules != null)
-                {
+            synchronized (allRulesPerPrincipal) {
+                Collection<PrincipalRule> allRules = allRulesPerPrincipal.get(principalName);
+                if (allRules != null) {
                     allRules.remove(rule);
                 }
             }
@@ -868,27 +795,20 @@ public class JetspeedProfilerImpl extend
 
     /**
      * Evict cached profiler rule information for principal.
-     * 
+     *
      * @param principalName cached profiler rule key
-     * @param force force eviction of guest and default rules
+     * @param force         force eviction of guest and default rules
      */
-    private void evictCachedPrincipalRules(String principalName, boolean force)
-    {
-        if (principalName != null)
-        {
+    private void evictCachedPrincipalRules(String principalName, boolean force) {
+        if (principalName != null) {
             // do not evict guest and default principal profiler rules by
             // default since they would be evicted all too frequently
-            if (force || (!principalName.equals(getGuestPrincipalName()) && !principalName.equals(DEFAULT_RULE_PRINCIPAL_NAME)))
-            {
+            if (force || (!principalName.equals(getGuestPrincipalName()) && !principalName.equals(DEFAULT_RULE_PRINCIPAL_NAME))) {
                 // evict cached profiler rules
-                Collection rules = (Collection)allRulesPerPrincipal.remove(principalName);
-                if (rules != null)
-                {
+                Collection<PrincipalRule> rules = allRulesPerPrincipal.remove(principalName);
+                if (rules != null) {
                     rulesPerPrincipal.remove(principalName);
-                    Iterator it = rules.iterator();
-                    while (it.hasNext())
-                    {
-                        PrincipalRule rule = (PrincipalRule)it.next();
+                    for (PrincipalRule rule : rules) {
                         String key = this.makePrincipalRuleKey(rule.getPrincipalName(), rule.getLocatorName());
                         principalRules.remove(key);
                     }
@@ -896,44 +816,41 @@ public class JetspeedProfilerImpl extend
             }
         }
     }
-        
+
     /**
      * ProfilerContext
-     * 
+     * <p/>
      * Class used to track session lifetime within profiler implementation
      * so that cached profiler rule information per principal can be evicted
      * from cache on session end. Note that this serializable class must be
      * static to prevent owning JetspeedProfilerImpl from being persisted
      * in the session.
      */
-    public static class ProfilerContext implements HttpSessionActivationListener, HttpSessionBindingListener, Serializable
-    {
+    public static class ProfilerContext implements HttpSessionActivationListener, HttpSessionBindingListener, Serializable {
         private static final long serialVersionUID = 1L;
-        
+
         private transient JetspeedProfilerImpl profiler;
         private transient Principal principal;
         private transient boolean guestPrincipal;
-        
+
         /**
          * Construct new profiler context with specified principal.
-         * 
-         * @param profiler profiler implementation
+         *
+         * @param profiler  profiler implementation
          * @param principal profiler context principal
          */
-        private ProfilerContext(JetspeedProfilerImpl profiler, Principal principal)
-        {
+        private ProfilerContext(JetspeedProfilerImpl profiler, Principal principal) {
             this.profiler = profiler;
             this.principal = principal;
             this.guestPrincipal = ((principal != null) && principal.getName().equals(profiler.getGuestPrincipalName()));
         }
-        
+
         /**
          * Notification that the session has just been activated.
          *
          * @param event session activation event
          */
-        public void sessionDidActivate(HttpSessionEvent event)
-        {
+        public void sessionDidActivate(HttpSessionEvent event) {
         }
 
         /**
@@ -941,19 +858,17 @@ public class JetspeedProfilerImpl extend
          *
          * @param event session activation event
          */
-        public void sessionWillPassivate(HttpSessionEvent event)
-        {
-            evictPrincipal();            
+        public void sessionWillPassivate(HttpSessionEvent event) {
+            evictPrincipal();
         }
- 
+
         /**
          * Notifies this context that it is being bound to
          * a session and identifies the session.
          *
          * @param event session binding event
          */
-        public void valueBound(HttpSessionBindingEvent event)
-        {
+        public void valueBound(HttpSessionBindingEvent event) {
         }
 
         /**
@@ -962,65 +877,55 @@ public class JetspeedProfilerImpl extend
          *
          * @param event session binding event
          */
-        public void valueUnbound(HttpSessionBindingEvent event)
-        {
+        public void valueUnbound(HttpSessionBindingEvent event) {
             evictPrincipal();
-        }  
+        }
 
         /**
          * Evict cached principal rules.
          */
-        private void evictPrincipal()
-        {
+        private void evictPrincipal() {
             // profiler can be null for reactivated sessions
-            if (profiler != null)
-            {
+            if (profiler != null) {
                 // evict cached principal rules on session end
-                if ((principal != null) && !guestPrincipal)
-                {
+                if ((principal != null) && !guestPrincipal) {
                     profiler.evictCachedPrincipalRules(principal.getName(), false);
                 }
                 principal = null;
 
                 // evict default and guest principal rules periodically
                 long now = System.currentTimeMillis();
-                if (now-profiler.lastDefaultGuestReapTime > DEFAULT_AND_GUEST_RULE_REAPING_INTERVAL)
-                {
+                if (now - profiler.lastDefaultGuestReapTime > DEFAULT_AND_GUEST_RULE_REAPING_INTERVAL) {
                     profiler.lastDefaultGuestReapTime = now;
                     profiler.evictCachedPrincipalRules(profiler.getGuestPrincipalName(), true);
                     profiler.evictCachedPrincipalRules(DEFAULT_RULE_PRINCIPAL_NAME, true);
                 }
             }
         }
-        
+
         /**
          * Get context principal.
-         * 
+         *
          * @return context principal
          */
-        private Principal getPrincipal()
-        {
+        private Principal getPrincipal() {
             return principal;
         }
     }
 
     /**
      * Get configured guest principal name.
-     * 
+     *
      * @return guest principal name
      */
-    private String getGuestPrincipalName()
-    {
+    private String getGuestPrincipalName() {
         // lazily access configured guest principal name 
-        if (guestPrincipalName == null)
-        {
+        if (guestPrincipalName == null) {
             guestPrincipalName = DEFAULT_GUEST_PRINCIPAL_NAME;
             PortalConfiguration config = Jetspeed.getConfiguration();
-            if (config != null)
-            {
+            if (config != null) {
                 String configGuestPrincipalName = config.getString("default.user.principal");
-                if (configGuestPrincipalName != null)
-                {
+                if (configGuestPrincipalName != null) {
                     guestPrincipalName = configGuestPrincipalName;
                 }
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/ProfileResolversImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/ProfileResolversImpl.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/ProfileResolversImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/ProfileResolversImpl.java Thu Jul 25 23:59:57 2013
@@ -16,12 +16,12 @@
  */
 package org.apache.jetspeed.profiler.rules.impl;
 
-import java.io.Serializable;
-import java.util.Map;
-
 import org.apache.jetspeed.profiler.rules.ProfileResolvers;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 
+import java.io.Serializable;
+import java.util.Map;
+
 /**
  * Profile Resolvers 
  *
@@ -30,7 +30,7 @@ import org.apache.jetspeed.profiler.rule
  */
 public class ProfileResolversImpl implements ProfileResolvers, Serializable
 {
-    private Map resolvers;
+    private Map<String, RuleCriterionResolver> resolvers;
     
     public ProfileResolversImpl(Map resolvers)
     {
@@ -39,13 +39,13 @@ public class ProfileResolversImpl implem
     
     public RuleCriterionResolver get(String resolverName)
     {
-        return (RuleCriterionResolver)resolvers.get(resolverName);
+        return resolvers.get(resolverName);
     }
     
     /**
      * return the map of resolver
      */
-    public Map getResolvers()
+    public Map<String, RuleCriterionResolver> getResolvers()
     {
     	return resolvers;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleFallbackProfilingRule.java Thu Jul 25 23:59:57 2013
@@ -16,11 +16,6 @@
  */
 package org.apache.jetspeed.profiler.rules.impl;
 
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.profiler.ProfileLocator;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.profiler.rules.FallbackCriterionResolver;
@@ -29,6 +24,11 @@ import org.apache.jetspeed.profiler.rule
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+import java.util.StringTokenizer;
 
 /**
  * RoleFallbackProfilingRule
@@ -68,7 +68,7 @@ public class RoleFallbackProfilingRule
         Iterator<RuleCriterion> criteria = this.getRuleCriteria().iterator();
         while (criteria.hasNext())
         {
-            RuleCriterion criterion = (RuleCriterion)criteria.next();
+            RuleCriterion criterion = criteria.next();
             if (criterion.getType() == null)
             {
                 log.warn("Invalid criterion provided - type null on rule " + this);
@@ -121,7 +121,7 @@ public class RoleFallbackProfilingRule
         criteria = this.getRuleCriteria().iterator();
         while (criteria.hasNext())
         {
-            RuleCriterion criterion = (RuleCriterion)criteria.next();
+            RuleCriterion criterion = criteria.next();
             if (criterion.getType() == null)
             {
                 log.warn("Invalid criterion provided - name or type null on rule " + this);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/StandardProfilingRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/StandardProfilingRule.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/StandardProfilingRule.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/StandardProfilingRule.java Thu Jul 25 23:59:57 2013
@@ -16,10 +16,6 @@
  */
 package org.apache.jetspeed.profiler.rules.impl;
 
-import java.util.Iterator;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.profiler.ProfileLocator;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.profiler.rules.ProfileResolvers;
@@ -27,6 +23,10 @@ import org.apache.jetspeed.profiler.rule
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
 
 /**
  * StandardProfilingRule applies the standard Jetspeed-1 profiling rules.
@@ -62,10 +62,10 @@ public class StandardProfilingRule
         int count = 0;
         
         // first pass, build the key
-        Iterator criteria = this.getRuleCriteria().iterator();
+        Iterator<RuleCriterion> criteria = this.getRuleCriteria().iterator();
         while (criteria.hasNext())
         {
-            RuleCriterion criterion = (RuleCriterion)criteria.next();
+            RuleCriterion criterion = criteria.next();
             if (criterion.getType() == null)
             {
                 log.warn("Invalid criterion provided - type null on rule " + this);
@@ -101,7 +101,7 @@ public class StandardProfilingRule
         criteria = this.getRuleCriteria().iterator();
         while (criteria.hasNext())
         {
-            RuleCriterion criterion = (RuleCriterion)criteria.next();
+            RuleCriterion criterion = criteria.next();
             if (criterion.getType() == null)
             {
                 log.warn("Invalid criterion provided - type null on rule " + this);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java Thu Jul 25 23:59:57 2013
@@ -16,13 +16,6 @@
  */
 package org.apache.jetspeed.serializer;
 
-import java.security.Principal;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.slf4j.Logger;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.profiler.ProfilerException;
 import org.apache.jetspeed.profiler.rules.PrincipalRule;
@@ -31,6 +24,7 @@ import org.apache.jetspeed.profiler.rule
 import org.apache.jetspeed.security.JetspeedPrincipalType;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.serializer.objects.JSPrincipal;
 import org.apache.jetspeed.serializer.objects.JSPrincipalRule;
 import org.apache.jetspeed.serializer.objects.JSPrincipalRules;
 import org.apache.jetspeed.serializer.objects.JSProfilingRule;
@@ -38,8 +32,14 @@ import org.apache.jetspeed.serializer.ob
 import org.apache.jetspeed.serializer.objects.JSRuleCriterion;
 import org.apache.jetspeed.serializer.objects.JSRuleCriterions;
 import org.apache.jetspeed.serializer.objects.JSSnapshot;
-import org.apache.jetspeed.serializer.objects.JSPrincipal;
 import org.apache.jetspeed.serializer.objects.JSUser;
+import org.slf4j.Logger;
+
+import java.security.Principal;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * JetspeedProfilerSerializer - Profiler component serializer
@@ -86,17 +86,15 @@ public class JetspeedProfilerSerializer 
                 String anonymousUser = userManager.getAnonymousUser();
                 for (User _user : userManager.getUsers(""))    
                 {
-                    Collection col = pm.getRulesForPrincipal(_user);
-                    Iterator _itCol = col.iterator();
-                    while (_itCol.hasNext())
+                    for (PrincipalRule rule : pm.getRulesForPrincipal(_user))
                     {
-                        pm.deletePrincipalRule((PrincipalRule)_itCol.next());
+                        pm.deletePrincipalRule(rule);
                     }
                 }
-                Iterator _itRules = pm.getRules().iterator();
+                Iterator<ProfilingRule> _itRules = pm.getRules().iterator();
                 while ( _itRules.hasNext() )
                 {
-                    pm.deleteProfilingRule((ProfilingRule)_itRules.next());
+                    pm.deleteProfilingRule(_itRules.next());
                 }                
             }
             catch (Exception e)
@@ -306,7 +304,7 @@ public class JetspeedProfilerSerializer 
             RuleCriterion c = recreateRuleCriterion(profiler, (JSRuleCriterion) _it.next(), rule);
             if (c != null)
             {
-                Collection cHelp = rule.getRuleCriteria();
+                Collection<RuleCriterion> cHelp = rule.getRuleCriteria();
                 if (!(existing && (cHelp.contains(c))))
                 {
                     cHelp.add(c);
@@ -339,7 +337,7 @@ public class JetspeedProfilerSerializer 
                     "Standard Rule", e.getMessage() }));
         }
 
-        Iterator list = null;
+        Iterator<ProfilingRule> list = null;
         try
         {
             list = pm.getRules().iterator();
@@ -353,7 +351,7 @@ public class JetspeedProfilerSerializer 
         {
             try
             {
-                ProfilingRule p = (ProfilingRule) list.next();
+                ProfilingRule p = list.next();
                 if (!(rulesMap.containsKey(p.getId())))
                 {
                     JSProfilingRule rule = createProfilingRule(p, (standardRuleClass == p.getClass()));
@@ -387,7 +385,7 @@ public class JetspeedProfilerSerializer 
                 
                 if (principal != null)
                 {
-                    for (PrincipalRule p1 : (Collection<PrincipalRule>) pm.getRulesForPrincipal(principal))
+                    for (PrincipalRule p1 : pm.getRulesForPrincipal(principal))
                     {
                         JSPrincipalRule pr = new JSPrincipalRule(p1.getLocatorName(), p1.getProfilingRule().getId());
                         _user.getRules().add(pr);
@@ -411,11 +409,7 @@ public class JetspeedProfilerSerializer 
         rule.setDescription(p.getTitle());
         rule.setId(p.getId());
 
-        Collection col = p.getRuleCriteria();
-        Iterator keys = col.iterator();
-        while (keys.hasNext())
-        {
-            RuleCriterion rc = (RuleCriterion) keys.next();
+        for (RuleCriterion rc : p.getRuleCriteria()) {
             rule.getCriterions().add(new JSRuleCriterion(rc));
         }
         return rule;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java Thu Jul 25 23:59:57 2013
@@ -16,22 +16,7 @@
  */
 package org.apache.jetspeed.profiler;
 
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-import javax.servlet.http.HttpServletRequest;
-
 import junit.framework.Test;
-
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
 import org.apache.jetspeed.mockobjects.MockHttpServletRequest;
 import org.apache.jetspeed.mockobjects.request.MockRequestContext;
@@ -52,6 +37,19 @@ import org.apache.jetspeed.security.spi.
 import org.apache.jetspeed.security.spi.SecurityDomainStorageManager;
 import org.apache.jetspeed.serializer.JetspeedSerializer;
 
+import javax.security.auth.Subject;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.Principal;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
 /**
  * TestProfiler
  * 
@@ -208,11 +206,11 @@ public class TestProfiler extends Dataso
         // make sure rule is set correctly
         ProfilingRule rule = profiler.getRule("user-role-fallback");
         assertNotNull("rule is null ", rule);
-        Iterator c = rule.getRuleCriteria().iterator();
+        Iterator<RuleCriterion> iterator = rule.getRuleCriteria().iterator();
         int ix = 0;
-        while (c.hasNext())
+        while (iterator.hasNext())
         {
-            RuleCriterion rc = (RuleCriterion)c.next();
+            RuleCriterion rc = iterator.next();
             assertTrue("criterion type check " + rc.getType(), rc.getType().equals(URF_CRITERIA[ix]));
             System.out.println(rc.getType());
             ix++;
@@ -239,11 +237,11 @@ public class TestProfiler extends Dataso
         // make sure rule is set correctly
         ProfilingRule rule = profiler.getRule("user-rolecombo-fallback");
         assertNotNull("rule is null ", rule);
-        Iterator c = rule.getRuleCriteria().iterator();
+        Iterator<RuleCriterion> iterator = rule.getRuleCriteria().iterator();
         int ix = 0;
-        while (c.hasNext())
+        while (iterator.hasNext())
         {
-            RuleCriterion rc = (RuleCriterion)c.next();
+            RuleCriterion rc = iterator.next();
             assertTrue("criterion type check " + rc.getType(), rc.getType().equals(URCF_CRITERIA[ix]));
             System.out.println(rc.getType());
             ix++;
@@ -263,9 +261,9 @@ public class TestProfiler extends Dataso
     
     protected Subject createSubject()
     {
-        Set principals = new PrincipalsSet();
-        Set publicCredentials = new HashSet();
-        Set privateCredentials = new HashSet();
+        PrincipalsSet principals = new PrincipalsSet();
+        Set<Principal> publicCredentials = new HashSet<Principal>();
+        Set<Principal> privateCredentials = new HashSet<Principal>();
         
         principals.add(new UserImpl("david"));
         principals.add(new RoleImpl("ATP"));
@@ -278,9 +276,9 @@ public class TestProfiler extends Dataso
 
     protected Subject createSubject2()
     {
-        Set principals = new PrincipalsSet();
-        Set publicCredentials = new HashSet();
-        Set privateCredentials = new HashSet();
+        PrincipalsSet principals = new PrincipalsSet();
+        Set<Principal> publicCredentials = new HashSet<Principal>();
+        Set<Principal> privateCredentials = new HashSet<Principal>();
 
         principals.add(new UserImpl("david"));
         principals.add(new RoleImpl("ATP"));
@@ -300,10 +298,10 @@ public class TestProfiler extends Dataso
         assertNotNull("profiler service is null", profiler);
 
         // Test Default Rule
-        ProfilingRule rule = profiler.getDefaultRule();
-        assertNotNull("Default profiling rule is null", rule);
-        assertTrue("default rule unexpected, = " + rule.getId(), rule.getId().equals(DEFAULT_RULE));
-        assertTrue("default rule class not mapped", rule instanceof StandardProfilingRule);
+        ProfilingRule defaultRule = profiler.getDefaultRule();
+        assertNotNull("Default profiling rule is null", defaultRule);
+        assertTrue("default rule unexpected, = " + defaultRule.getId(), defaultRule.getId().equals(DEFAULT_RULE));
+        assertTrue("default rule class not mapped", defaultRule instanceof StandardProfilingRule);
 
         // Test anonymous principal-rule
         ProfilingRule anonRule = profiler.getRuleForPrincipal(new UserImpl("anon"),
@@ -314,10 +312,8 @@ public class TestProfiler extends Dataso
         // Test Retrieving All Rules
         int standardCount = 0;
         int fallbackCount = 0;
-        Iterator rules = profiler.getRules().iterator();
-        while (rules.hasNext())
+        for (ProfilingRule rule : profiler.getRules())
         {
-            rule = (ProfilingRule) rules.next();
             if (rule.getId().equals(DEFAULT_RULE))
             {
                 assertTrue("standard rule class not mapped", rule instanceof StandardProfilingRule);
@@ -344,13 +340,11 @@ public class TestProfiler extends Dataso
 
     private void checkStandardCriteria(ProfilingRule rule)
     {
-        Collection criteriaCollection = rule.getRuleCriteria();
+        Collection<RuleCriterion> criteriaCollection = rule.getRuleCriteria();
         assertNotNull("Criteria is null", criteriaCollection);
-        Iterator criteria = criteriaCollection.iterator();
         int count = 0;
-        while (criteria.hasNext())
+        for (RuleCriterion criterion : criteriaCollection)
         {
-            RuleCriterion criterion = (RuleCriterion) criteria.next();
             assertNotNull("criteria type ", criterion.getType());
             System.out.println("criteria name = " + criterion.getName());
             switch (count)
@@ -386,20 +380,17 @@ public class TestProfiler extends Dataso
             count++;
         }
     }
-    
+
 
 
     private void checkFallbackCriteria(ProfilingRule rule)
     {
-        Collection criteriaCollection = rule.getRuleCriteria();
+        Collection<RuleCriterion> criteriaCollection = rule.getRuleCriteria();
         assertNotNull("Criteria is null", criteriaCollection);
-        Iterator criteria = criteriaCollection.iterator();
         int count = 0;
-        while (criteria.hasNext())
+        for (RuleCriterion criterion : criteriaCollection)
         {
-            RuleCriterion criterion = (RuleCriterion) criteria.next();
             assertNotNull("fallback criteria type", criterion.getType());
-
             switch (count)
             {
             case 0:
@@ -454,11 +445,11 @@ public class TestProfiler extends Dataso
                 .equals("page:default-other:user:anon:mediatype:HTML:language:en:country:US"));
 
         // test fallback
-        Iterator fallback = locator.iterator();
+        Iterator<ProfileLocatorProperty[]> fallback = locator.iterator();
         int count = 0;
         while (fallback.hasNext())
         {
-            ProfileLocatorProperty[] locatorProperties = (ProfileLocatorProperty[]) fallback.next();
+            ProfileLocatorProperty[] locatorProperties = fallback.next();
             assertTrue("locatorProperties is not null", (locatorProperties != null));
             String locatorPath = locator.getLocatorPath(locatorProperties);
             switch (count)
@@ -493,7 +484,7 @@ public class TestProfiler extends Dataso
         count = 0;
         while (fallback.hasNext())
         {
-            ProfileLocatorProperty[] locatorProperties = (ProfileLocatorProperty[]) fallback.next();
+            ProfileLocatorProperty[] locatorProperties = fallback.next();
             assertTrue("locatorProperties is not null", (locatorProperties != null));
             String locatorPath = locator.getLocatorPath(locatorProperties);
             assertTrue("locatorPath: " + locatorPath, locatorPath.equals("page:test"));
@@ -757,20 +748,18 @@ public class TestProfiler extends Dataso
         // Test Retrieving All Rules
         int standardCount = 0;
         int fallbackCount = 0;
-        Iterator rules = profiler.getRules().iterator();
-        while (rules.hasNext())
+        for (ProfilingRule profilingRule : profiler.getRules())
         {
-            rule = (ProfilingRule) rules.next();
-            if (rule.getId().equals(ruleId1))
+            if (profilingRule.getId().equals(ruleId1))
             {
-                assertTrue("standard rule class not mapped", rule instanceof StandardProfilingRule);
-                checkStandardCriteria(rule);
+                assertTrue("standard rule class not mapped", profilingRule instanceof StandardProfilingRule);
+                checkStandardCriteria(profilingRule);
                 standardCount++;
             }
-            else if (rule.getId().equals(ruleId2))
+            else if (profilingRule.getId().equals(ruleId2))
             {
-                assertTrue("role fallback rule class not mapped", rule instanceof RoleFallbackProfilingRule);
-                checkFallbackCriteria(rule);
+                assertTrue("role fallback rule class not mapped", profilingRule instanceof RoleFallbackProfilingRule);
+                checkFallbackCriteria(profilingRule);
                 fallbackCount++;
             }
             else

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/ojb/ConnectionRepositoryEntry.java Thu Jul 25 23:59:57 2013
@@ -16,20 +16,7 @@
  */
 package org.apache.jetspeed.components.rdbms.ojb;
 
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-
 import org.apache.commons.dbcp.BasicDataSource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.ojb.broker.PBKey;
 import org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl;
 import org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl;
@@ -40,9 +27,22 @@ import org.apache.ojb.broker.metadata.Jd
 import org.apache.ojb.broker.metadata.JdbcMetadataUtils;
 import org.apache.ojb.broker.metadata.MetadataManager;
 import org.apache.ojb.broker.util.ClassHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.BeanNameAware;
 import org.springframework.beans.factory.InitializingBean;
 
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Map;
+
 /**
  * A JavaBean that configures an entry in OJB's ConnectionRepository
  * according to its properties. If a JCD alias is not specified, it defaults
@@ -238,7 +238,6 @@ public class ConnectionRepositoryEntry
     }
 
     /**
-     * @see setJetspeedEngineScoped
      * @return Returns if Jetspeed engine's ENC is used for JNDI lookups.
      */
     public boolean isJetspeedEngineScoped() 
@@ -408,7 +407,7 @@ public class ConnectionRepositoryEntry
      * a minimal DataSource implementation that satisfies the requirements
      * of JdbcMetadataUtil.
      */
-    private class MinimalDataSource implements DataSource 
+    public class MinimalDataSource implements DataSource
     {
         private JdbcConnectionDescriptor jcd = null;
         
@@ -420,18 +419,22 @@ public class ConnectionRepositoryEntry
             this.jcd = jcd;
         }
 
+        public java.util.logging.Logger getParentLogger()
+                throws SQLFeatureNotSupportedException
+        {
+            return null;
+        }
+
         public boolean isWrapperFor(Class<?> iface) throws SQLException
         {
-            return false;
-            // #ifdef JDBC4 return getConnection().isWrapperFor(iface);
+            return getConnection().isWrapperFor(iface);
         }
 
         public <T> T unwrap(Class<T> iface) throws SQLException
         {
-            throw new SQLException("PoolingDataSource is not a wrapper.");
-            //#ifdef JDBC4 return getConnection().unwrap(iface);
+            return getConnection().unwrap(iface);
         }
-        
+
         /* (non-Javadoc)
          * @see javax.sql.DataSource#getConnection()
          */
@@ -492,8 +495,9 @@ public class ConnectionRepositoryEntry
          */
         public void setLogWriter(PrintWriter out) throws SQLException {
         }
+
     }
-	
+
 	public Connection getConnection() throws SQLException {
 		if(externalDs != null)
 		{

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalAdministration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalAdministration.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalAdministration.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalAdministration.java Thu Jul 25 23:59:57 2013
@@ -16,15 +16,14 @@
  */
 package org.apache.jetspeed.administration;
 
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
+import org.apache.jetspeed.security.User;
 
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
-
-import org.apache.jetspeed.security.User;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
 
 /**
  * PortalAdministration
@@ -60,13 +59,13 @@ public interface PortalAdministration
      *                   if subsite not specified
      * @since 2.1.2              
      */
-    public void registerUser(
+     void registerUser(
             String userName, 
             String password, 
-            List roles, 
-            List groups, 
-            Map userInfo, 
-            Map rules, 
+            List<String> roles,
+            List<String> groups,
+            Map<String,String> userInfo,
+            Map<String,String> rules,
             String folderTemplate,
             String subsite,
             Locale locale,
@@ -75,20 +74,20 @@ public interface PortalAdministration
 
     void registerUser(String userName, 
                       String password, 
-                      List roles, 
-                      List groups,
-                      Map userInfo,                       
-                      Map rules,
+                      List<String> roles,
+                      List<String> groups,
+                      Map<String,String> userInfo,
+                      Map<String,String> rules,
                       String template,
                       String subsiteFolder)
         throws RegistrationException;
 
     void registerUser(String userName, 
             String password, 
-            List roles, 
-            List groups,
-            Map userInfo,                       
-            Map rules,
+            List<String> roles,
+            List<String> groups,
+            Map<String,String> userInfo,
+            Map<String,String> rules,
             String template)
         throws RegistrationException;
 
@@ -110,18 +109,19 @@ public interface PortalAdministration
     
     /**
      * Helper to send an email to a recipient
-     * 
-     * @param recipient the email address of the recipient
+     *
+     * @param portletConfig portlet configuration
+     * @param emailAddress the email address of the recipient
      * @param localizedSubject the subject of the email as a localized string
-     * @param message the email message content
+     * @param templatePath path to templates
      * @parm userAttributes map of user attributes
      * @throws AdministrationEmailException
      */
-    public void sendEmail(PortletConfig portletConfig,
+     void sendEmail(PortletConfig portletConfig,
                           String emailAddress, 
                           String localizedSubject, 
                           String templatePath,
-                          Map userAttributes)
+                          Map<String,String> userAttributes)
         throws AdministrationEmailException;
     
     /**
@@ -133,7 +133,7 @@ public interface PortalAdministration
      * @param text the message text
      * @throws AdministrationEmailException
      */
-    public void sendEmail(String from, String subject, String to, String text) throws AdministrationEmailException;    
+     void sendEmail(String from, String subject, String to, String text) throws AdministrationEmailException;
     
     /**
      * Lookup a user given an email address
@@ -142,8 +142,8 @@ public interface PortalAdministration
      * @return a Jetspeed <code>User</code>, or throw exception if not found
      * @throws AdministrationEmailException
      */
-    public User lookupUserFromEmail(String email)
-    throws AdministrationEmailException;
+     User lookupUserFromEmail(String email)
+        throws AdministrationEmailException;
     
     /**
      * Provide a common way to get portal URLs
@@ -168,33 +168,34 @@ public interface PortalAdministration
      * @param guid    The ID which is passed throughte URL to the user
      * @return
      */
-    public Map getNewLoginInfo(String guid);
+     Map<String,String> getNewLoginInfo(String guid);
+
     /**
      * @param guid    the ID which is passed through the URL to the user.. 
      * @param info    a Map, info from which will be used to reset the password
      *                the password in this case is NOT encrypted, but this should probably
      *                change if this information is stored on disk... ie a database
      */
-    public void putNewLoginInfo(String guid, Map info);
+     void putNewLoginInfo(String guid, Map<String,String> info);
     
     /**
      * @param guid    the ID which will be removed from the storage when the info is no longer valid
      */
-    public void removeNewLoginInfo(String guid);
+     void removeNewLoginInfo(String guid);
     
     /**
      * Returns true if the current request user principal's name is the name of the portal admin user.
      * @param request
      * @return
      */
-    public boolean isAdminUser(PortletRequest request);
+    boolean isAdminUser(PortletRequest request);
     
     /**
      * Returns true if the current request user principal is in the portal admin role.
      * @param request
      * @return
      */
-    public boolean isUserInAdminRole(PortletRequest request);
+    boolean isUserInAdminRole(PortletRequest request);
     
     /**
      * Returns PSML user folder path for specified user by
@@ -206,7 +207,7 @@ public interface PortalAdministration
      * @param serverName server name, (required for subsite profiling rules)
      * @return PSML user folder path
      */
-    public String getUserFolderPath(String userName, Locale locale, String serverName);
+    String getUserFolderPath(String userName, Locale locale, String serverName);
 
     /**
      * Returns PSML base folder path for specified user by
@@ -218,5 +219,5 @@ public interface PortalAdministration
      * @param serverName server name, (required for subsite profiling rules)
      * @return PSML base folder path
      */
-    public String getBaseFolderPath(String userName, Locale locale, String serverName);
+    String getBaseFolderPath(String userName, Locale locale, String serverName);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/ProfileLocator.java Thu Jul 25 23:59:57 2013
@@ -16,11 +16,10 @@
  */
 package org.apache.jetspeed.profiler;
 
-import java.util.Iterator;
-
-import org.apache.jetspeed.profiler.ProfileLocatorProperty;
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 
+import java.util.Iterator;
+
 /**
  * <p>Profile Locators are used to locate profiled portal resources such as
  * pages, documents, and fragments. A locator contains properties describing
@@ -69,7 +68,7 @@ public interface ProfileLocator 
      *  
      * @return an iterator over the profile locator properties
      */
-    Iterator iterator();    
+    Iterator<ProfileLocatorProperty []> iterator();
         
     /**
      * Add a property based on a @link org.apache.jetspeed.profiler.rules.RuleCriterion

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/Profiler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/Profiler.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/Profiler.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/Profiler.java Thu Jul 25 23:59:57 2013
@@ -16,15 +16,15 @@
  */
 package org.apache.jetspeed.profiler;
 
-import java.security.Principal;
-import java.util.Collection;
-import java.util.Map;
-
 import org.apache.jetspeed.profiler.rules.PrincipalRule;
 import org.apache.jetspeed.profiler.rules.ProfilingRule;
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.request.RequestContext;
 
+import java.security.Principal;
+import java.util.Collection;
+import java.util.Map;
+
 /**
  * ProfilerService
  * Jetspeed-2 Profiler service. 
@@ -101,13 +101,12 @@ public interface Profiler
      * 
      * @param principal
      *            Lookup the profiling rule based on this principal.
+     * @param rule
+     *            rule used to find profiles for this user
      * @param locatorName
      *            the unique name of a locator for this principal/rule/locator
-     * @param The
-     *            rule used to find profiles for this user
      */
-    void setRuleForPrincipal(Principal principal, ProfilingRule rule,
-            String locatorName);
+    void setRuleForPrincipal(Principal principal, ProfilingRule rule, String locatorName);
 
     /**
      * Lookup the portal's default profiling rule.
@@ -117,9 +116,11 @@ public interface Profiler
     ProfilingRule getDefaultRule();
 
     /**
-     * @return
+     * Retrieves all profiling rules
+     *
+     * @return a collection of all rules
      */
-    Collection getRules();
+    Collection<ProfilingRule> getRules();
 
     /**
      * Given a rule id, get the rule
@@ -147,7 +148,7 @@ public interface Profiler
      *            The given principal.
      * @return collection of PrincipalRules
      */
-    Collection getRulesForPrincipal(Principal principal);
+    Collection<PrincipalRule> getRulesForPrincipal(Principal principal);
 
     /**
      * Gets all supported locators for a principal.
@@ -157,7 +158,7 @@ public interface Profiler
      * @return
      * @throws ProfilerException
      */
-    Map getProfileLocators(RequestContext context, Principal principal)
+    Map<String,ProfileLocator> getProfileLocators(RequestContext context, Principal principal)
             throws ProfilerException;
 
     /**
@@ -171,7 +172,7 @@ public interface Profiler
      * @return
      * @throws ProfilerException
      */
-    Map getDefaultProfileLocators(RequestContext context)
+    Map<String,ProfileLocator> getDefaultProfileLocators(RequestContext context)
             throws ProfilerException;
 
     /*

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/ProfileResolvers.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/ProfileResolvers.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/ProfileResolvers.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/ProfileResolvers.java Thu Jul 25 23:59:57 2013
@@ -30,5 +30,5 @@ public interface ProfileResolvers 
     /**
      * return the map of resolver
      */
-    Map getResolvers();
+    Map<String,RuleCriterionResolver> getResolvers();
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/RuleCriterion.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/RuleCriterion.java?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/RuleCriterion.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/profiler/rules/RuleCriterion.java Thu Jul 25 23:59:57 2013
@@ -46,7 +46,7 @@ public interface RuleCriterion extends S
      * Rule types determine which type of request property, parameter or attribute
      * to look at when building a profiling locator.
      *  
-     * @param The request type associated with this criterion.
+     * @param type The request type associated with this criterion.
      */    
     void setType(String type);
 
@@ -95,7 +95,7 @@ public interface RuleCriterion extends S
      *   FALLBACK_STOP - evaluate this criterion and if it fails stop evaluation criteria for this rule
      *   FALLBACK_LOOP - evaluate this criterion and if it fails continue evaluating
      * 
-     * @param The fallback type for this criterion, should be a valid value as shown above.
+     * @param order The fallback type for this criterion, should be a valid value as shown above.
      */    
     void setFallbackType(int order);
     
@@ -113,7 +113,7 @@ public interface RuleCriterion extends S
      * This name is used to lookup the value of the request parameter, attribute, or 
      * property when building a profile locator.
      *  
-     * @param The name of the request parameter, attribute or property.
+     * @param name The name of the request parameter, attribute or property.
      */        
     void setName(String name);
 
@@ -128,7 +128,7 @@ public interface RuleCriterion extends S
     /**
      * Sets the value of the parameter, attribute or property in the portal request.
      *  
-     * @param The value of the request parameter, attribute or property.
+     * @param value The value of the request parameter, attribute or property.
      */        
     void setValue(String value);
 
@@ -142,7 +142,7 @@ public interface RuleCriterion extends S
     /**
      * Sets the unique rule identifier for the associated owner rule 
      * 
-     * @param id The rule's unique identifier
+     * @param ruleId The rule's unique identifier
      */    
     void setRuleId(String ruleId);
     

Modified: portals/jetspeed-2/portal/trunk/jetspeed-archetype/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-archetype/src/main/resources/archetype-resources/pom.xml?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-archetype/src/main/resources/archetype-resources/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-archetype/src/main/resources/archetype-resources/pom.xml Thu Jul 25 23:59:57 2013
@@ -80,8 +80,8 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
-            <source>1.5</source>
-            <target>1.5</target>
+            <source>1.6</source>
+            <target>1.6</target>
             <debug>true</debug>
             <showDeprecation>true</showDeprecation>
             <showWarnings>true</showWarnings>

Modified: portals/jetspeed-2/portal/trunk/openid-step2/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/openid-step2/pom.xml?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/openid-step2/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/openid-step2/pom.xml Thu Jul 25 23:59:57 2013
@@ -40,8 +40,8 @@
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
+          <source>1.6</source>
+          <target>1.6</target>
         </configuration>
       </plugin>
     </plugins>

Modified: portals/jetspeed-2/portal/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/pom.xml?rev=1507157&r1=1507156&r2=1507157&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/pom.xml Thu Jul 25 23:59:57 2013
@@ -1568,8 +1568,8 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
-            <source>1.5</source>
-            <target>1.5</target>
+            <source>1.6</source>
+            <target>1.6</target>
             <debug>true</debug>
             <showDeprecation>false</showDeprecation>
             <showWarnings>false</showWarnings>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org