atg.userprofiling
Class ProfileRequest

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.userprofiling.ProfileRequest
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ProfileRequestConstants, java.util.EventListener

public class ProfileRequest
extends GenericService
implements ProfileRequestConstants

This represents Profile information associated with a request in an HTTP-specific usage of profiles. This contains information about how the request was associated with that Profile, including what profile id was requested and how that id was requested.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.Object mRequestedId
          Returns the object used in the attempt to request a profile.
protected  int mRequestSource
          An identifier signifying where the request for a profile originated from.
protected  int mStatus
          An identifier signifying the status of the profile for this request.
static int PRFSRC_BASICAUTH
          Profile request came from HTTP Basic Authentication.
static int PRFSRC_CERTIFICATE
          Profile request came from a X.509 Certificate.
static int PRFSRC_COOKIE
          Profile request came from a cookie.
static int PRFSRC_NONE
          No source in the request for a profile.
static int PRFSRC_URL
          Profile request came from a URL parameter, including form submissions.
static int PRFSTATUS_ERROR
          There was some error during the request for the profile.
static int PRFSTATUS_NEW
          The profile is new.
static int PRFSTATUS_OLD
          The profile is old.
static int PRFSTATUS_REFUSED
          A ProfileRequestFilter denied the creation of a new profile.
static int PRFSTATUS_UNKNOWN
          The profile status is unknown.
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.userprofiling.ProfileRequestConstants
PROFILE_PARAMETER_NAME, PROFILE_VERFICATION_PARAMETER_NAME
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ProfileRequest()
          Constructs an instanceof ProfileRequest
 
Method Summary
 void doStartService()
          Invokes the service method to initialize the object
protected  java.lang.String extractId(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Returns the user id for a profile from the given request.
 CookieManager getCookieManager()
          Returns property CookieManager
 DynamoHttpServletRequest getOriginatingRequest()
          Returns property OriginatingRequest
 java.lang.Object getRequestedId()
          Returns the object used in the attempt to request a profile.
 int getRequestSource()
          Returns an identifier signifying where the request for a profile originated from.
 int getStatus()
          Returns an identifier signifying the status the profile for this request.
 boolean isExtractProfileFromBasicAuthentication()
          Returns property ExtractProfileFromBasicAuthentication
 boolean isExtractProfileFromCookieParameter()
          Returns property ExtractProfileFromCookieParameter
 boolean isExtractProfileFromPostParameter()
          Returns property ExtractProfileFromPostParameter
 boolean isExtractProfileFromQueryParameter()
          Returns property ExtractProfileFromQueryParameter
 boolean isExtractProfileFromURLParameter()
          Returns property ExtractProfileFromURLParameter
 boolean isRequestInvalid()
          Returns true if the request for a profile was invalid.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Decodes the necessary information out of the request and fills the appropriate properties
 void setCookieManager(CookieManager pCookieManager)
          Sets property CookieManager
 void setExtractProfileFromBasicAuthentication(boolean pExtractProfileFromBasicAuthentication)
          Sets property ExtractProfileFromBasicAuthentication
 void setExtractProfileFromCookieParameter(boolean pExtractProfileFromCookieParameter)
          Sets property ExtractProfileFromCookieParameter
 void setExtractProfileFromPostParameter(boolean pExtractProfileFromPostParameter)
          Sets property ExtractProfileFromPostParameter
 void setExtractProfileFromQueryParameter(boolean pExtractProfileFromQueryParameter)
          Sets property ExtractProfileFromQueryParameter
 void setExtractProfileFromURLParameter(boolean pExtractProfileFromURLParameter)
          Sets property ExtractProfileFromURLParameter
 void setOriginatingRequest(DynamoHttpServletRequest pOriginatingRequest)
          Sets property OriginatingRequest
 void setRequestInvalid(boolean pRequestInvalid)
          Sets property RequestInvalid
 void setStatusCode(int pCode)
          A "property setter" for the status property which is only available by other profiler classes.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


PRFSRC_NONE

public static final int PRFSRC_NONE
No source in the request for a profile. value:0

See Also:
#getProfileRequestSource, Constant Field Values

PRFSRC_COOKIE

public static final int PRFSRC_COOKIE
Profile request came from a cookie. value:1

See Also:
#getProfileRequestSource, Constant Field Values

PRFSRC_URL

public static final int PRFSRC_URL
Profile request came from a URL parameter, including form submissions. value:2

See Also:
#getProfileRequestSource, Constant Field Values

PRFSRC_BASICAUTH

public static final int PRFSRC_BASICAUTH
Profile request came from HTTP Basic Authentication. value:3

See Also:
#getProfileRequestSource, Constant Field Values

PRFSRC_CERTIFICATE

public static final int PRFSRC_CERTIFICATE
Profile request came from a X.509 Certificate. value:4

See Also:
#getProfileRequestSource, Constant Field Values

PRFSTATUS_UNKNOWN

public static final int PRFSTATUS_UNKNOWN
The profile status is unknown. value:0

See Also:
#getProfileStatus, Constant Field Values

PRFSTATUS_NEW

public static final int PRFSTATUS_NEW
The profile is new. value:1

See Also:
#getProfileStatus, Constant Field Values

PRFSTATUS_OLD

public static final int PRFSTATUS_OLD
The profile is old. value:2

See Also:
#getProfileStatus, Constant Field Values

PRFSTATUS_REFUSED

public static final int PRFSTATUS_REFUSED
A ProfileRequestFilter denied the creation of a new profile. value:3

See Also:
#getProfileStatus, Constant Field Values

PRFSTATUS_ERROR

public static final int PRFSTATUS_ERROR
There was some error during the request for the profile. value:4

See Also:
#getProfileStatus, Constant Field Values

mRequestedId

protected java.lang.Object mRequestedId
Returns the object used in the attempt to request a profile. This value is exposed through the requestedId property.

See Also:
getRequestedId()

mRequestSource

protected int mRequestSource
An identifier signifying where the request for a profile originated from. This value is exposed through the requestSource property. Default value is PRFSRC_NONE;

See Also:
PRFSRC_NONE, PRFSRC_COOKIE, PRFSRC_URL, PRFSRC_BASICAUTH, PRFSRC_CERTIFICATE, getRequestSource

mStatus

protected int mStatus
An identifier signifying the status of the profile for this request. This value is exposed through the status property.

See Also:
PRFSTATUS_NEW, PRFSTATUS_OLD, getStatus()
Constructor Detail

ProfileRequest

public ProfileRequest()
Constructs an instanceof ProfileRequest

Method Detail

getStatus

public int getStatus()
Returns an identifier signifying the status the profile for this request.

See Also:
PRFSTATUS_NEW, PRFSTATUS_OLD

setStatusCode

public void setStatusCode(int pCode)
A "property setter" for the status property which is only available by other profiler classes.


getRequestedId

public java.lang.Object getRequestedId()
Returns the object used in the attempt to request a profile. Depending on the request type this may mean either a profile id (String), a login name from Basic Authentication, or an object which encapsulates a certificate. The value may be null if there was no request for a profile.


setRequestInvalid

public void setRequestInvalid(boolean pRequestInvalid)
Sets property RequestInvalid


isRequestInvalid

public boolean isRequestInvalid()
Returns true if the request for a profile was invalid. An invalid request may arise because of a profile id or login that does not exist.


getRequestSource

public int getRequestSource()
Returns an identifier signifying where the request for a profile originated from.

See Also:
PRFSRC_NONE, PRFSRC_COOKIE, PRFSRC_URL, PRFSRC_BASICAUTH, PRFSRC_CERTIFICATE

setOriginatingRequest

public void setOriginatingRequest(DynamoHttpServletRequest pOriginatingRequest)
Sets property OriginatingRequest


getOriginatingRequest

public DynamoHttpServletRequest getOriginatingRequest()
Returns property OriginatingRequest


setCookieManager

public void setCookieManager(CookieManager pCookieManager)
Sets property CookieManager


getCookieManager

public CookieManager getCookieManager()
Returns property CookieManager


setExtractProfileFromQueryParameter

public void setExtractProfileFromQueryParameter(boolean pExtractProfileFromQueryParameter)
Sets property ExtractProfileFromQueryParameter


isExtractProfileFromQueryParameter

public boolean isExtractProfileFromQueryParameter()
Returns property ExtractProfileFromQueryParameter


setExtractProfileFromPostParameter

public void setExtractProfileFromPostParameter(boolean pExtractProfileFromPostParameter)
Sets property ExtractProfileFromPostParameter


isExtractProfileFromPostParameter

public boolean isExtractProfileFromPostParameter()
Returns property ExtractProfileFromPostParameter


setExtractProfileFromURLParameter

public void setExtractProfileFromURLParameter(boolean pExtractProfileFromURLParameter)
Sets property ExtractProfileFromURLParameter


isExtractProfileFromURLParameter

public boolean isExtractProfileFromURLParameter()
Returns property ExtractProfileFromURLParameter


setExtractProfileFromCookieParameter

public void setExtractProfileFromCookieParameter(boolean pExtractProfileFromCookieParameter)
Sets property ExtractProfileFromCookieParameter


isExtractProfileFromCookieParameter

public boolean isExtractProfileFromCookieParameter()
Returns property ExtractProfileFromCookieParameter


setExtractProfileFromBasicAuthentication

public void setExtractProfileFromBasicAuthentication(boolean pExtractProfileFromBasicAuthentication)
Sets property ExtractProfileFromBasicAuthentication


isExtractProfileFromBasicAuthentication

public boolean isExtractProfileFromBasicAuthentication()
Returns property ExtractProfileFromBasicAuthentication


doStartService

public void doStartService()
                    throws ServiceException
Invokes the service method to initialize the object

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Decodes the necessary information out of the request and fills the appropriate properties

Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

extractId

protected java.lang.String extractId(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws java.io.IOException,
                                     javax.servlet.ServletException
Returns the user id for a profile from the given request. It first searches the URL parameters then Cookies looking for the profile id parameter.

Throws:
java.io.IOException
javax.servlet.ServletException