public class AuthorizedPaymentTypesDroplet extends DynamoServlet
AuthorizedPaymentTypesDroplet
DynamoServlet determines the
payment types that a user is authorized to use.
To use this DynamoServlet there is a ServiceMap of payment types, to the Nucleus
paths of UserPaymentTypeAuthorizer components. The payment types correspond to those
types that are registered with the OrderTools service. The UserPaymentTypeAuthorizer
is an interface whose contract authorizes a user payment type.
The service method takes a user Profile as input. As a convenience to different
applications the authorized payment types are exposed as two output parameters.
One parameter specifies the List of all payment types authorized for the user.
The other parameter specifies a Map of all tested payment types, to the boolean
results that indicate user authorization or not for each type.
In the event that a UserPaymentTypeAuthorizer fails to determine authorization,
there is a global authorization property used to specify a default authorization for
any problematic payment type.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTHORIZED_PAYMENT_TYPES |
static java.lang.String |
CLASS_VERSION |
static ParameterName |
OUTPUT |
static java.lang.String |
POTENTIAL_PAYMENT_TYPES |
static ParameterName |
PROFILE |
mAllowCleanupRequest, mParameters
SERVLET_INFO_KEY
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
AuthorizedPaymentTypesDroplet()
Creates a new
AuthorizedPaymentTypesDroplet instance. |
Modifier and Type | Method and Description |
---|---|
java.util.List |
getAuthorizedPaymentTypes()
Return the AuthorizedPaymentTypes property.
|
ServiceMap |
getPaymentTypeAuthorizers()
Return the PaymentTypeAuthorizers property.
|
java.util.Map |
getPotentialPaymentTypes()
Return the PotentialPaymentTypes property.
|
boolean |
isGlobalAuthorization()
Return the GlobalAuthorization property.
|
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
DynamoServlet service method.
|
void |
setAuthorizedPaymentTypes(java.util.List pAuthorizedPaymentTypes)
Set the AuthorizedPaymentTypes property.
|
void |
setGlobalAuthorization(boolean pGlobalAuthorization)
Set the GlobalAuthorization property.
|
void |
setPaymentTypeAuthorizers(ServiceMap pPaymentTypeAuthorizers)
Set the PaymentTypeAuthorizers property.
|
void |
setPotentialPaymentTypes(java.util.Map pPotentialPaymentTypes)
Set the PotentialPaymentTypes property.
|
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final java.lang.String AUTHORIZED_PAYMENT_TYPES
public static final java.lang.String POTENTIAL_PAYMENT_TYPES
public static final ParameterName PROFILE
public static final ParameterName OUTPUT
public AuthorizedPaymentTypesDroplet()
AuthorizedPaymentTypesDroplet
instance.public void setPaymentTypeAuthorizers(ServiceMap pPaymentTypeAuthorizers)
pPaymentTypeAuthorizers
- a ServiceMap
valuepublic ServiceMap getPaymentTypeAuthorizers()
ServiceMap
valuepublic void setGlobalAuthorization(boolean pGlobalAuthorization)
pGlobalAuthorization
- a boolean
valuepublic boolean isGlobalAuthorization()
boolean
valuepublic void setAuthorizedPaymentTypes(java.util.List pAuthorizedPaymentTypes)
pAuthorizedPaymentTypes
- a List
valuepublic java.util.List getAuthorizedPaymentTypes()
List
valuepublic void setPotentialPaymentTypes(java.util.Map pPotentialPaymentTypes)
pPotentialPaymentTypes
- a Map
valuepublic java.util.Map getPotentialPaymentTypes()
Map
valuepublic void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
service
in class DynamoServlet
pRequest
- a DynamoHttpServletRequest
valuepResponse
- a DynamoHttpServletResponse
valuejavax.servlet.ServletException
- if an error occursjava.io.IOException
- if an error occurs