org.norther.tammi.spray.filter
Class DefaultBranchingFilter
java.lang.Object
org.norther.tammi.core.base.Adaptee
org.norther.tammi.core.base.DefaultContainer
org.norther.tammi.core.security.DefaultSecureContainer
org.norther.tammi.spray.filter.AbstractSecureContainerFilter
org.norther.tammi.spray.filter.AbstractSecureContainerKeyFilter
org.norther.tammi.spray.filter.DefaultSecureContainerKeyFilter
org.norther.tammi.spray.filter.DefaultBranchingFilter
- All Implemented Interfaces:
- Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Container, Manageable, MBeanDelegate, AccessController, SecureContainer, BranchingFilter, ContainerFilter, ContainerKeyFilter, KeyFilter, SecureContainerFilter, SecureContainerKeyFilter, SecureFilter
- Direct Known Subclasses:
- DefaultLinkFilter
public class DefaultBranchingFilter
- extends DefaultSecureContainerKeyFilter
- implements BranchingFilter
A default implementation of BranchingFilter applying the filter key first to
request attributes and then to request parameters to obtain the mapping key
of the filter branch.
- Author:
- Ilkka Priha
- See Also:
- Serialized Form
| Methods inherited from class org.norther.tammi.core.security.DefaultSecureContainer |
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from class org.norther.tammi.core.base.DefaultContainer |
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanHandle, getMBeanHandles, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.base.Container |
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
| Methods inherited from interface org.norther.tammi.core.security.AccessController |
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from interface org.norther.tammi.core.base.Container |
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
BRANCH_KEY
public static final String BRANCH_KEY
- The branch key.
- See Also:
- Constant Field Values
DefaultBranchingFilter
public DefaultBranchingFilter()
- Constructs a new filter.
DefaultBranchingFilter
public DefaultBranchingFilter(String key)
- Constructs a new filter with a key.
- Parameters:
key - the filter key.
getDefaultKey
public String getDefaultKey()
- Description copied from interface:
BranchingFilter
- Gets the default branch key.
- Specified by:
getDefaultKey in interface BranchingFilter
- Returns:
- the default key or null.
setDefaultKey
public void setDefaultKey(String key)
- Description copied from interface:
BranchingFilter
- Sets the default branch key. The default key is applied, if the request
doesn't specify an explicit branch key.
- Specified by:
setDefaultKey in interface BranchingFilter
- Parameters:
key - the default key.
getFilter
public Filter getFilter(String key)
- Description copied from interface:
BranchingFilter
- Gets referent of the filter MBean of the specified key.
- Specified by:
getFilter in interface BranchingFilter
- Parameters:
key - the branch key.
- Returns:
- the referent of the filter MBean or null.
getBranchKey
public String getBranchKey(ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
BranchingFilter
- Gets the branch key of the selected branch for the specified request.
- Specified by:
getBranchKey in interface BranchingFilter
- Parameters:
request - the request to process.response - the response to return.chain - the current filter chain.
- Returns:
- the branch key to apply or null.
checkPermission
public boolean checkPermission(ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
BranchingFilter
- Checks whether or not the specified request has an execute permission to
the selected branch.
- Specified by:
checkPermission in interface BranchingFilter
- Parameters:
request - the authenticated request.response - the corresponding response.chain - the active filter chain.
- Returns:
- true if the request has the permission, false otherwise.
checkPermission
public boolean checkPermission(Principal principal,
ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
BranchingFilter
- Checks whether or not the specified principal has an execute permission
to the selected branch.
- Specified by:
checkPermission in interface BranchingFilter
- Parameters:
principal - the authenticated principal.request - the request of the branch.response - the corresponding response.chain - the active filter chain.
- Returns:
- true if the principal has the permission, false otherwise.
doFilter
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws ServletException,
IOException
- Invokes a filter mapped to the branch key. If none is found, it passes
the request forward.
- Specified by:
doFilter in interface Filter- Overrides:
doFilter in class AbstractSecureContainerFilter
- Parameters:
request - the request to process.response - the response to return.chain - the current filter chain.
- Throws:
ServletException - for servlet errors.
IOException - for general errors.
Copyright © 2004 The Norther Organization. All rights reserved.