org.apache.jetspeed.profiler.impl
Class JetspeedProfilerImpl

java.lang.Object
  extended byorg.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
      extended byorg.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
          extended byorg.apache.jetspeed.profiler.impl.JetspeedProfilerImpl
All Implemented Interfaces:
org.apache.jetspeed.profiler.Profiler

public class JetspeedProfilerImpl
extends org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
implements org.apache.jetspeed.profiler.Profiler

JetspeedTransactionalProfiler

Version:
$Id: JetspeedProfilerImpl.java 225857 2005-07-28 19:34:51Z dlestrat $
Author:
David Sean Taylor

Field Summary
static String DEFAULT_RULE
          The default rule.
static Principal DEFAULT_RULE_PRINCIPAL
          This is the princapl that is used if there are no principal to rule associations for the current principal
private  String defaultRule
          The configured default rule for this portal
private  Class locatorClass
          The default locator class implementation
protected static org.apache.commons.logging.Log log
          Commons logging
private  Class principalRuleClass
          The default principalRule association class implementation
private  Map principalRules
           
private  Class profilingRuleClass
          The base (abstract) profilingRule class implementation
private  Map rulesPerPrincipal
           
 
Fields inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
repositoryPath
 
Fields inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
logger
 
Constructor Summary
JetspeedProfilerImpl(String repositoryPath)
           
JetspeedProfilerImpl(String repositoryPath, String defaultRule)
          Create a JetspeedProfiler with properties.
JetspeedProfilerImpl(String repositoryPath, String defaultRule, Properties properties)
           
 
Method Summary
 org.apache.jetspeed.profiler.ProfileLocator createLocator(org.apache.jetspeed.request.RequestContext context)
           
 void deletePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule rule)
           
 void deleteProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule rule)
           
 org.apache.jetspeed.profiler.ProfileLocator getDefaultProfile(org.apache.jetspeed.request.RequestContext context, String locatorName)
           
 Map getDefaultProfileLocators(org.apache.jetspeed.request.RequestContext context)
           
 org.apache.jetspeed.profiler.rules.ProfilingRule getDefaultRule()
           
 String[] getLocatorNamesForPrincipal(Principal principal)
           
 org.apache.jetspeed.profiler.ProfileLocator getProfile(org.apache.jetspeed.request.RequestContext context, org.apache.jetspeed.profiler.rules.ProfilingRule rule)
           
 org.apache.jetspeed.profiler.ProfileLocator getProfile(org.apache.jetspeed.request.RequestContext context, String locatorName)
           
 Map getProfileLocators(org.apache.jetspeed.request.RequestContext context, Principal principal)
           
 org.apache.jetspeed.profiler.rules.ProfilingRule getRule(String id)
           
 org.apache.jetspeed.profiler.rules.ProfilingRule getRuleForPrincipal(Principal principal, String locatorName)
           
 Collection getRules()
           
 Collection getRulesForPrincipal(Principal principal)
           
private  void initModelClasses(Properties properties)
           
private  org.apache.jetspeed.profiler.rules.PrincipalRule lookupPrincipalRule(String principal, String locatorName)
          Helper function to lookup principal rule associations by principal
private  String makePrincipalRuleKey(String principal, String locator)
           
 void setDefaultRule(String defaultRule)
           
 void setRuleForPrincipal(Principal principal, org.apache.jetspeed.profiler.rules.ProfilingRule rule, String locatorName)
           
 void storePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule rule)
           
 void storeProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule rule)
           
 
Methods inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
init
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
afterPropertiesSet, closePersistenceBrokerIfNecessary, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, initDao, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RULE

public static final String DEFAULT_RULE
The default rule.

See Also:
Constant Field Values

log

protected static final org.apache.commons.logging.Log log
Commons logging


DEFAULT_RULE_PRINCIPAL

public static final Principal DEFAULT_RULE_PRINCIPAL
This is the princapl that is used if there are no principal to rule associations for the current principal


locatorClass

private Class locatorClass
The default locator class implementation


principalRuleClass

private Class principalRuleClass
The default principalRule association class implementation


profilingRuleClass

private Class profilingRuleClass
The base (abstract) profilingRule class implementation


defaultRule

private String defaultRule
The configured default rule for this portal


principalRules

private Map principalRules

rulesPerPrincipal

private Map rulesPerPrincipal
Constructor Detail

JetspeedProfilerImpl

public JetspeedProfilerImpl(String repositoryPath)

JetspeedProfilerImpl

public JetspeedProfilerImpl(String repositoryPath,
                            String defaultRule)
                     throws ClassNotFoundException
Create a JetspeedProfiler with properties. Expected properties are: defaultRule = the default profiling rule anonymousUser = the name of the anonymous user storeName = The name of the persistence store component to connect to services.profiler.locator.impl = the pluggable Profile Locator impl services.profiler.principalRule.impl = the pluggable Principal Rule impl services.profiler.profilingRule.impl = the pluggable Profiling Rule impl

Throws:
ClassNotFoundException - if any the implementation classes defined within the properties argument could not be found.

JetspeedProfilerImpl

public JetspeedProfilerImpl(String repositoryPath,
                            String defaultRule,
                            Properties properties)
                     throws ClassNotFoundException
Method Detail

setDefaultRule

public void setDefaultRule(String defaultRule)
Parameters:
defaultRule - The default rule to set.

initModelClasses

private void initModelClasses(Properties properties)
                       throws ClassNotFoundException
Throws:
ClassNotFoundException

getProfile

public org.apache.jetspeed.profiler.ProfileLocator getProfile(org.apache.jetspeed.request.RequestContext context,
                                                              String locatorName)
                                                       throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
getProfile in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

getDefaultProfile

public org.apache.jetspeed.profiler.ProfileLocator getDefaultProfile(org.apache.jetspeed.request.RequestContext context,
                                                                     String locatorName)
                                                              throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
getDefaultProfile in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

getProfile

public org.apache.jetspeed.profiler.ProfileLocator getProfile(org.apache.jetspeed.request.RequestContext context,
                                                              org.apache.jetspeed.profiler.rules.ProfilingRule rule)
                                                       throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
getProfile in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

createLocator

public org.apache.jetspeed.profiler.ProfileLocator createLocator(org.apache.jetspeed.request.RequestContext context)
Specified by:
createLocator in interface org.apache.jetspeed.profiler.Profiler

getRuleForPrincipal

public org.apache.jetspeed.profiler.rules.ProfilingRule getRuleForPrincipal(Principal principal,
                                                                            String locatorName)
Specified by:
getRuleForPrincipal in interface org.apache.jetspeed.profiler.Profiler

setRuleForPrincipal

public void setRuleForPrincipal(Principal principal,
                                org.apache.jetspeed.profiler.rules.ProfilingRule rule,
                                String locatorName)
Specified by:
setRuleForPrincipal in interface org.apache.jetspeed.profiler.Profiler

makePrincipalRuleKey

private String makePrincipalRuleKey(String principal,
                                    String locator)

lookupPrincipalRule

private org.apache.jetspeed.profiler.rules.PrincipalRule lookupPrincipalRule(String principal,
                                                                             String locatorName)
Helper function to lookup principal rule associations by principal

Parameters:
principal - The string representation of the principal name.
Returns:
The found PrincipalRule associated with the principal key or null if not found.

getDefaultRule

public org.apache.jetspeed.profiler.rules.ProfilingRule getDefaultRule()
Specified by:
getDefaultRule in interface org.apache.jetspeed.profiler.Profiler

getRules

public Collection getRules()
Specified by:
getRules in interface org.apache.jetspeed.profiler.Profiler

getRule

public org.apache.jetspeed.profiler.rules.ProfilingRule getRule(String id)
Specified by:
getRule in interface org.apache.jetspeed.profiler.Profiler

getLocatorNamesForPrincipal

public String[] getLocatorNamesForPrincipal(Principal principal)
Specified by:
getLocatorNamesForPrincipal in interface org.apache.jetspeed.profiler.Profiler

getRulesForPrincipal

public Collection getRulesForPrincipal(Principal principal)
Specified by:
getRulesForPrincipal in interface org.apache.jetspeed.profiler.Profiler

getProfileLocators

public Map getProfileLocators(org.apache.jetspeed.request.RequestContext context,
                              Principal principal)
                       throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
getProfileLocators in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

getDefaultProfileLocators

public Map getDefaultProfileLocators(org.apache.jetspeed.request.RequestContext context)
                              throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
getDefaultProfileLocators in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

storeProfilingRule

public void storeProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule rule)
                        throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
storeProfilingRule in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

deleteProfilingRule

public void deleteProfilingRule(org.apache.jetspeed.profiler.rules.ProfilingRule rule)
                         throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
deleteProfilingRule in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

storePrincipalRule

public void storePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule rule)
                        throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
storePrincipalRule in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException

deletePrincipalRule

public void deletePrincipalRule(org.apache.jetspeed.profiler.rules.PrincipalRule rule)
                         throws org.apache.jetspeed.profiler.ProfilerException
Specified by:
deletePrincipalRule in interface org.apache.jetspeed.profiler.Profiler
Throws:
org.apache.jetspeed.profiler.ProfilerException


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.