public interface Profiler
ProfileLocator
.
The locator is then added to the request context RequestContext
, from which subsequent components
on the Jetspeed pipeline, most notably the Page Manager PageManager
and
Portal Site PortalSite
components, can take the profile locator
and use it to find a requested resource. For example, the Page Manager uses the locator to find a page or folder.
The Portal Site component uses the locator build the options on a menu. The profile locator is
the output from the profiler. The input is a normalized set of runtime parameters and state. The profiler input is
defined in profiling rules ProfilingRule
, and can be made of any Java class
available on the pipeline. Jetspeed comes with quite a few predefined rules for taking
criteria RuleCriterion
RuleCriterionResolver
from request parameters,
HTTP headers, security information, language and session attributes.
The profiler is invoked during the request processing pipeline Pipeline
in the profiler valve Valve
.Modifier and Type | Method and Description |
---|---|
ProfileLocator |
createLocator(RequestContext context)
Creates a new ProfileLocator object that can be managed by
the current Profiler implementation
|
PrincipalRule |
createPrincipalRule()
Factory for PrincipalRule, the container to connect profiling rule and
(user) principals
Replaces the previous Class.forName and .instantiate logic with the
Spring based factory.
|
ProfilingRule |
createProfilingRule(boolean standard)
Factory for creating Profiling Rules.
|
RuleCriterion |
createRuleCriterion()
Factory for creating Rule Criterion
|
void |
deletePrincipalRule(PrincipalRule rule) |
void |
deleteProfilingRule(ProfilingRule rule) |
ProfileLocator |
getDefaultProfile(RequestContext context,
String locatorName)
Retrieve the default profile locator
ProfileLocator for the given runtime parameters represented in the request
context and for the locatorName. |
Map<String,ProfileLocator> |
getDefaultProfileLocators(RequestContext context)
Retrieves a map of all default locators, mapping locator name to profile locator
|
ProfilingRule |
getDefaultRule()
Lookup the portal's default profiling rule.
|
String[] |
getLocatorNamesForPrincipal(Principal principal)
For a given principal, find all supported locators and return a string
array of locator names.
|
ProfileLocator |
getProfile(RequestContext context,
ProfilingRule rule)
Retrieve a profile locator
ProfileLocator for the given runtime parameters represented in the request
context and for the provided ProfilingRule . |
ProfileLocator |
getProfile(RequestContext context,
String locatorName)
Retrieve a profile locator
ProfileLocator for the given runtime parameters represented in the request
context and for the locatorName. |
Map<String,ProfileLocator> |
getProfileLocators(RequestContext context,
Principal principal)
Retrieves a map of all supported locators for a principal, mapping locator name to profile locator
|
ProfilingRule |
getRule(String id)
Given a rule id, get the rule
|
ProfilingRule |
getRuleForPrincipal(Principal principal,
String locatorName)
For a given principal, lookup the associated profiling rule to that principal name.
|
Collection<ProfilingRule> |
getRules()
Retrieves all profiling rules
|
Collection<PrincipalRule> |
getRulesForPrincipal(Principal principal)
For a given principal, find all supported locators and return a
collection of principal rules.
|
void |
setDefaultRule(String defaultRule)
Resets the default rule for this portal
|
void |
setRuleForPrincipal(Principal principal,
ProfilingRule rule,
String locatorName)
For a given principal, associate a profiling rule to that principal name.
|
void |
storePrincipalRule(PrincipalRule rule) |
void |
storeProfilingRule(ProfilingRule rule) |
ProfileLocator getProfile(RequestContext context, String locatorName) throws ProfilerException
ProfileLocator
for the given runtime parameters represented in the request
context and for the locatorName. Commonly used locator names are:
ProfileLocator.PAGE_LOCATOR
ProfileLocator.SECURITY_LOCATOR
ProfilingRule
for
the current user on the request context and for the locator name. That rule is then applied to return a
normalized profile. The profile locator holds the normalized set of rules that are used further in the
pipeline to locate the resource to be retrieved and rendered.context
- the request context holding runtime request parameters to be normalizedlocatorName
- the commonly known name of the profile locator such as ProfileLocator.PAGE_LOCATOR
ProfilerException
ProfilingRule.apply(org.apache.jetspeed.request.RequestContext, Profiler)
ProfileLocator getDefaultProfile(RequestContext context, String locatorName) throws ProfilerException
ProfileLocator
for the given runtime parameters represented in the request
context and for the locatorName. Differs from getProfile(org.apache.jetspeed.request.RequestContext, java.lang.String)
in that instead of using the user principal
found within the request context's subject, a default, global principal is used.
Commonly used locator names are:
ProfileLocator.PAGE_LOCATOR
ProfileLocator.SECURITY_LOCATOR
ProfilingRule
for
the default principal and for the locator name. That rule is then applied to return a
normalized profile. The profile locator holds the normalized set of rules that are used further in the
pipeline to locate the resource to be retrieved and rendered.context
- the request context holding runtime request parameters to be normalizedlocatorName
- the commonly known name of the profile locator such as ProfileLocator.PAGE_LOCATOR
ProfilerException
ProfilingRule.apply(org.apache.jetspeed.request.RequestContext, Profiler)
ProfileLocator getProfile(RequestContext context, ProfilingRule rule) throws ProfilerException
ProfileLocator
for the given runtime parameters represented in the request
context and for the provided ProfilingRule
.
The algorithm for this method takes the ProfilingRule
directly and applies that rule
to return a normalized profile. The profile locator holds the normalized set of rules that are used further in the
pipeline to locate the resource to be retrieved and rendered.
context
- The request context holding runtime request parameters to be normalizedrule
- The ProfilingRule to apply and find a ProfileLocator
ProfilerException
ProfilingRule.apply(org.apache.jetspeed.request.RequestContext, Profiler)
ProfileLocator createLocator(RequestContext context)
context
- The request context containing runtime parameters to determine which locator to createProfilingRule getRuleForPrincipal(Principal principal, String locatorName)
principal
- Lookup the profiling rule based on this principallocatorName
- the unique name of a locator for this principal/rule/locatorvoid setRuleForPrincipal(Principal principal, ProfilingRule rule, String locatorName)
principal
- Lookup the profiling rule based on this principal.rule
- rule used to find profiles for this userlocatorName
- the unique name of a locator for this principal/rule/locatorProfilingRule getDefaultRule()
Collection<ProfilingRule> getRules()
ProfilingRule getRule(String id)
id
- String[] getLocatorNamesForPrincipal(Principal principal)
principal
- The given principal.Collection<PrincipalRule> getRulesForPrincipal(Principal principal)
principal
- The given principal such as a user principalMap<String,ProfileLocator> getProfileLocators(RequestContext context, Principal principal) throws ProfilerException
context
- the request context holding runtime request parameters to be normalizedprincipal
- the given principal such a User PrincipalProfilerException
Map<String,ProfileLocator> getDefaultProfileLocators(RequestContext context) throws ProfilerException
context
- the request context holding runtime request parameters to be normalizedProfilerException
void storeProfilingRule(ProfilingRule rule) throws ProfilerException
ProfilerException
void deleteProfilingRule(ProfilingRule rule) throws ProfilerException
ProfilerException
void storePrincipalRule(PrincipalRule rule) throws ProfilerException
ProfilerException
void deletePrincipalRule(PrincipalRule rule) throws ProfilerException
ProfilerException
ProfilingRule createProfilingRule(boolean standard) throws ClassNotFoundException
standard
- true if standard rule is requested, false if fallbackClassNotFoundException
- if the bean factory couldn't instantiate the beanPrincipalRule createPrincipalRule() throws ClassNotFoundException
ClassNotFoundException
- if the bean factory couldn't instantiate the beanRuleCriterion createRuleCriterion() throws ClassNotFoundException
ClassNotFoundException
- if the beanfactory couldn't instantiate the beanvoid setDefaultRule(String defaultRule)
defaultRule
- The name of the rule to set as defaultCopyright © 1999–2016 The Apache Software Foundation. All rights reserved.