org.apache.jetspeed.profiler.impl
Class JetspeedProfileLocator

java.lang.Object
  extended by org.apache.jetspeed.profiler.impl.JetspeedProfileLocator
All Implemented Interfaces:
ProfileLocatorControl, ProfileLocator

public class JetspeedProfileLocator
extends java.lang.Object
implements ProfileLocatorControl

ProfileLocatorImpl

Version:
$Id: JetspeedProfileLocator.java 517719 2007-03-13 15:05:48Z ate $
Author:
David Sean Taylor

Field Summary
 
Fields inherited from interface org.apache.jetspeed.profiler.ProfileLocator
PAGE_LOCATOR, PATH_SEPARATOR, SECURITY_LOCATOR
 
Constructor Summary
JetspeedProfileLocator()
           
 
Method Summary
 void add(RuleCriterion criterion, boolean isControl, boolean isNavigation, java.lang.String value)
          Add a property based on a @link org.apache.jetspeed.profiler.rules.RuleCriterion and a value.
 void add(java.lang.String name, boolean isControl, boolean isNavigation, java.lang.String value)
          Add a property based on a Simple name and value.
 void add(java.lang.String name, java.lang.String value)
          Add a property based on a Simple name and value assumed to be control property.
 void createFromLocatorPath(java.lang.String path)
          Profiles can be created from a normalized Profile Locator Path The format of the path is name:value pairs of all property, separated by a path separator.
 java.util.List getElements()
           
 java.lang.String getLocatorPath()
          Profiles can be converted to a normalized Profile Locator Path The format of the path is name/value pairs of all property, separated by a path separator.
 java.lang.String getLocatorPath(ProfileLocatorProperty[] properties)
          Normalize profile properties obtained from profile locator iterators into a Profile Locator Path.
 java.lang.String getRequestPath()
          Locators are intended to be sufficient to locate managed pages, so the request path must be generally available in the event it is not otherwise captured in a rule criterion.
 java.lang.String getValue(java.lang.String name)
          For a given property name, get a property of type @link ProfileLocatorProperty
 void init(Profiler profiler, java.lang.String requestPath)
          Initialize this page context.
 boolean isControl(java.lang.String name)
          For a given property name, return control status of property.
 boolean isNavigation(java.lang.String name)
          For a given property name, return navigation status of property.
 java.util.Iterator iterator()
          Get an iterator over the locator's properties.
 java.lang.String toString()
          Returns a normalized path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JetspeedProfileLocator

public JetspeedProfileLocator()
Method Detail

getElements

public java.util.List getElements()
Specified by:
getElements in interface ProfileLocatorControl

init

public void init(Profiler profiler,
                 java.lang.String requestPath)
Description copied from interface: ProfileLocator
Initialize this page context.

Specified by:
init in interface ProfileLocator
Parameters:
profiler - The profiler initializing this locator.
requestPath - The request path used to create this locator.

iterator

public java.util.Iterator iterator()
Description copied from interface: ProfileLocator
Get an iterator over the locator's properties. Elements are returned as @link ProfileLocatorProperty array.

Specified by:
iterator in interface ProfileLocator
Returns:
an iterator over the profile locator properties

getValue

public java.lang.String getValue(java.lang.String name)
Description copied from interface: ProfileLocator
For a given property name, get a property of type @link ProfileLocatorProperty

Specified by:
getValue in interface ProfileLocator
Parameters:
name - The name of the property
Returns:
a property of type @link ProfileLocatorProperty

isControl

public boolean isControl(java.lang.String name)
Description copied from interface: ProfileLocator
For a given property name, return control status of property.

Specified by:
isControl in interface ProfileLocator
Parameters:
name - The name of the property
Returns:
control classification flag

isNavigation

public boolean isNavigation(java.lang.String name)
Description copied from interface: ProfileLocator
For a given property name, return navigation status of property.

Specified by:
isNavigation in interface ProfileLocator
Parameters:
name - The name of the property
Returns:
navigation classification flag

add

public void add(RuleCriterion criterion,
                boolean isControl,
                boolean isNavigation,
                java.lang.String value)
Description copied from interface: ProfileLocator
Add a property based on a @link org.apache.jetspeed.profiler.rules.RuleCriterion and a value. Rule criteria are templates for locating profile properties. The value is combined with the rule to create a property.

Specified by:
add in interface ProfileLocator
Parameters:
criterion - The rule criterion on which this property is based.
isControl - The control classification for property.
isNavigation - The navigation classification for property.
value - The value to set on the property.

add

public void add(java.lang.String name,
                boolean isControl,
                boolean isNavigation,
                java.lang.String value)
Description copied from interface: ProfileLocator
Add a property based on a Simple name and value.

Specified by:
add in interface ProfileLocator
Parameters:
name - The name of the property.
isControl - The control classification for property.
isNavigation - The control classification for property.
value - The value to set on the property.

add

public void add(java.lang.String name,
                java.lang.String value)
Description copied from interface: ProfileLocator
Add a property based on a Simple name and value assumed to be control property.

Specified by:
add in interface ProfileLocator
Parameters:
name - The name of the property.
value - The value to set on the property.

createFromLocatorPath

public void createFromLocatorPath(java.lang.String path)
Description copied from interface: ProfileLocator

Profiles can be created from a normalized Profile Locator Path The format of the path is name:value pairs of all property, separated by a path separator. Note: all locator property elements are assumed to be control properties. An example locator path:

:page:default.psml:artist:air:song:all-i-need

Specified by:
createFromLocatorPath in interface ProfileLocator
Parameters:
path - The normalized path as shown above from which the locator is created.

getLocatorPath

public java.lang.String getLocatorPath()
Description copied from interface: ProfileLocator

Profiles can be converted to a normalized Profile Locator Path The format of the path is name/value pairs of all property, separated by a path separator. An example locator path:

:page:default.psml:artist:joni-mitchell:song:cary

Specified by:
getLocatorPath in interface ProfileLocator
Returns:
The normalized path as shown above.

getLocatorPath

public java.lang.String getLocatorPath(ProfileLocatorProperty[] properties)
Description copied from interface: ProfileLocator

Normalize profile properties obtained from profile locator iterators into a Profile Locator Path.

Specified by:
getLocatorPath in interface ProfileLocator
Parameters:
properties - The array of profile properties.
Returns:
The normalized path for properties.

toString

public java.lang.String toString()
Description copied from interface: ProfileLocator
Returns a normalized path. @see #getLocatorPath()

Specified by:
toString in interface ProfileLocator
Overrides:
toString in class java.lang.Object
Returns:
The normalized path representation of this locator.

getRequestPath

public java.lang.String getRequestPath()
Description copied from interface: ProfileLocator

Locators are intended to be sufficient to locate managed pages, so the request path must be generally available in the event it is not otherwise captured in a rule criterion.

Specified by:
getRequestPath in interface ProfileLocator
Returns:
The request path.


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