|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bowstreet.profiles.SelectionHandlerBase
public abstract class SelectionHandlerBase
Base class for creating a ProfileSelection implementation. This class provides the base functionality for matching segments to a profile and handling the processing of explicit profile validation and selection.
Field Summary | |
---|---|
static java.lang.String |
BOWSTREET_ADMINISTRATORS_NAME_PROPERTY
Name of the property for getting the name of the Factory Administrator Role |
static java.util.Iterator |
emptyIterator
|
static java.lang.String |
FROM_DESIGNER_SESSION_KEY
Name of the session attribute for specifying we are in development mode, where explicit profile selection rules are relaxed for testing purposes |
Constructor Summary | |
---|---|
SelectionHandlerBase()
|
Method Summary | |
---|---|
java.lang.String |
getProfileBySegment(java.lang.String profileSetName,
java.util.Iterator segments)
Gets the name of the Profile that matches one of the specified segments. |
java.lang.String |
getUserID(javax.servlet.http.HttpServletRequest request)
Gets the id of the user by calling the getUserID() method on the UserInfo class. |
void |
init(java.util.Map properties)
Initialization method that is used to pass handler properties to implementers of the ProfileSelection interface. |
boolean |
isSegmentInProfile(javax.servlet.http.HttpServletRequest request,
Profile profile,
java.util.Iterator segments)
Tests to see if there is a matching segment for the specified profile. |
boolean |
validateExplicitProfile(javax.servlet.http.HttpServletRequest request,
java.lang.String explicitProfile,
ProfileSet profileSet,
java.util.Iterator segments)
Validates the explicit profile to see if it should be used as the selection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.bowstreet.profiles.ProfileSelection |
---|
selectProfile |
Field Detail |
---|
public static final java.lang.String BOWSTREET_ADMINISTRATORS_NAME_PROPERTY
public static final java.util.Iterator emptyIterator
public static final java.lang.String FROM_DESIGNER_SESSION_KEY
Constructor Detail |
---|
public SelectionHandlerBase()
Method Detail |
---|
public java.lang.String getProfileBySegment(java.lang.String profileSetName, java.util.Iterator segments)
profileSetName
- The name of the ProfileSet to find the matching profile in.segments
- An Iterator of segment names that the user is in.
public java.lang.String getUserID(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest for the current request.
public void init(java.util.Map properties)
init
in interface ProfileSelection
properties
- A Map of name value pairs specified in the handler definition file. The Map key and values are both of type java.lang.String.public boolean isSegmentInProfile(javax.servlet.http.HttpServletRequest request, Profile profile, java.util.Iterator segments)
request
- The HttpServletRequest for the current request. This can be used to get additional information about the requestor. Implementers of this method should test this for null.profile
- The profile that the match will be performed on.segments
- an Iterator on segment names that the used is a member of.
public boolean validateExplicitProfile(javax.servlet.http.HttpServletRequest request, java.lang.String explicitProfile, ProfileSet profileSet, java.util.Iterator segments)
request
- The HttpServletRequest for the current request. This can be used to get additional information about the requestor. Implementers of this method should test this for null.explicitProfile
- The name of the explicit profile to validate.profileSet
- The profile set name to validate against. This method will make sure that the explicit profile exists in this profile set.segments
- The segments for the current user. This method will check if the user's segment matches one of the profiles segments
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |