public class AccessControlServlet extends PipelineableServletImpl
This servlet comes with a list of AccessAllowedListeners and a list of AccessDeniedListeners, to allow logging or other functions to be performed when access is granted or denied.
AccessController
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
NO_ACCESS_CONTROLLER
Indicates the absence of an access controller in the path cache
|
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 |
---|
AccessControlServlet() |
Modifier and Type | Method and Description |
---|---|
void |
addAccessAllowedListener(AccessAllowedListener pListener)
Adds a listener to the list of "access allowed" listeners.
|
void |
addAccessDeniedListener(AccessDeniedListener pListener)
Adds a listener to the list of "access denied" listeners.
|
void |
doStartService()
Called after the service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
int |
getAccessAllowedListenerCount()
Returns the number of "access allowed" listeners.
|
AccessAllowedListener[] |
getAccessAllowedListeners()
Returns the array of "access allowed" listeners.
|
AccessController |
getAccessController(atg.userprofiling.AccessControlServlet.ControllerArrayMember[] pControllerArray,
java.lang.String pRequestPath)
Returns the AccessController which should be used to perform
access control for the given path.
|
AccessController |
getAccessController(java.lang.String pRequestPath)
Returns the AccessController which should be used to perform
access control for the given path.
|
ServiceMap |
getAccessControllers()
Returns the AccessControllers used to control access to paths.
|
int |
getAccessDeniedListenerCount()
Returns the number of "access denied" listeners.
|
AccessDeniedListener[] |
getAccessDeniedListeners()
Returns the array of "access denied" listeners.
|
boolean |
getCacheResults()
Do we cache results when looking up AccessControllers?
|
java.lang.String |
getDeniedAccessURL()
Returns the default URL to redirect to if access is denied.
|
boolean |
getIgnoreCaseInPath()
Returns true if the case should be ignored when the path info is
compared to an access controlled path, false otherwise.
|
java.lang.String |
getProfilePath()
Gets the Nucleus path of the Profile object.
|
VirtualContextRootService |
getVirtualContextRootService()
Gets the VirtualContextRootService
|
boolean |
isEnabled()
Is access control enabled?
|
boolean |
isUseContextPath()
Get property
UseContextPath |
void |
removeAccessAllowedListener(AccessAllowedListener pListener)
Removes a listener from the list of "access allowed" listeners.
|
void |
removeAccessDeniedListener(AccessDeniedListener pListener)
Removes a listener from the list of "access denied" listeners.
|
void |
sendAccessAllowedEvent(AccessAllowedEvent pEvent)
Sends an "access allowed" event to all the "access allowed"
listeners.
|
void |
sendAccessDeniedEvent(AccessDeniedEvent pEvent)
Sends an "access denied" event to all the "access denied"
listeners.
|
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Services a DynamoHttpServletRequest/Response pair.
|
void |
setAccessControllers(ServiceMap pAccessControllers)
Sets the AccessControllers used to control access to paths.
|
void |
setCacheResults(boolean pCacheResults)
Sets whether to cache results when looking up
AccessControllers.
|
void |
setDeniedAccessURL(java.lang.String pDeniedAccessURL)
Sets the default URL to redirect to if access is denied.
|
void |
setEnabled(boolean pEnabled)
Sets whether or not access control is enabled.
|
void |
setIgnoreCaseInPath(boolean pIgnoreCaseInPath)
Sets the flag indicating whether case should be ignored when the
path info is compared to an access controlled path.
|
void |
setProfilePath(java.lang.String pProfilePath)
Sets the Nucleus path of the Profile object.
|
void |
setUseContextPath(boolean pUseContextPath)
Set property
UseContextPath |
void |
setVirtualContextRootService(VirtualContextRootService pVirtualContextRootService)
Sets the VirtualContextRootService
|
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, doStopService, getAbsoluteName, 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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String NO_ACCESS_CONTROLLER
public void setUseContextPath(boolean pUseContextPath)
UseContextPath
pUseContextPath
- if true, use the request's context path
as part of the access control path. Default is truepublic boolean isUseContextPath()
UseContextPath
public boolean isEnabled()
public void setEnabled(boolean pEnabled)
public boolean getCacheResults()
public void setCacheResults(boolean pCacheResults)
public java.lang.String getProfilePath()
public void setProfilePath(java.lang.String pProfilePath)
public ServiceMap getAccessControllers()
public void setAccessControllers(ServiceMap pAccessControllers)
public VirtualContextRootService getVirtualContextRootService()
public void setVirtualContextRootService(VirtualContextRootService pVirtualContextRootService)
public AccessController getAccessController(java.lang.String pRequestPath)
public AccessController getAccessController(atg.userprofiling.AccessControlServlet.ControllerArrayMember[] pControllerArray, java.lang.String pRequestPath)
pControllerArray
- array of ControllerArrayMemberpRequestPath
- request pathpublic boolean getIgnoreCaseInPath()
public void setIgnoreCaseInPath(boolean pIgnoreCaseInPath)
public void addAccessAllowedListener(AccessAllowedListener pListener)
public void removeAccessAllowedListener(AccessAllowedListener pListener)
public AccessAllowedListener[] getAccessAllowedListeners()
public int getAccessAllowedListenerCount()
public void sendAccessAllowedEvent(AccessAllowedEvent pEvent)
public void addAccessDeniedListener(AccessDeniedListener pListener)
public void removeAccessDeniedListener(AccessDeniedListener pListener)
public AccessDeniedListener[] getAccessDeniedListeners()
public int getAccessDeniedListenerCount()
public void sendAccessDeniedEvent(AccessDeniedEvent pEvent)
public java.lang.String getDeniedAccessURL()
public void setDeniedAccessURL(java.lang.String pDeniedAccessURL)
public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service
in class PipelineableServletImpl
javax.servlet.ServletException
- if an error occurred while
processing the servlet requestjava.io.IOException
- if an error occurred while reading or
writing the servlet requestpublic void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the service had a problem
starting up