org.norther.tammi.spray.filter
Interface BranchingFilter

All Superinterfaces:
AccessController, Container, ContainerFilter, ContainerKeyFilter, Filter, KeyFilter, SecureContainerFilter, SecureContainerKeyFilter, SecureFilter
All Known Subinterfaces:
HostFilter, LinkFilter, PipeFilter, ServiceFilter
All Known Implementing Classes:
DefaultBranchingFilter, DefaultHostFilter, DefaultLinkFilter, DefaultPipeFilter, DefaultServiceFilter

public interface BranchingFilter
extends SecureContainerKeyFilter

BranchingFilter extends SecureContainerKeyFilter by passing an incoming request to one of its contained filters based on some implementation specific mapping.

The mappings can be protected with an access controller. Permissions for a mapping are granted using its key as a resource. Execute permission is required. Note that authentication must be performed before the protected branching filter.

Author:
Ilkka Priha

Method Summary
 boolean checkPermission(Principal principal, ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether or not the specified principal has an execute permission to the selected branch.
 boolean checkPermission(ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether or not the specified request has an execute permission to the selected branch.
 String getBranchKey(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the branch key of the selected branch for the specified request.
 String getDefaultKey()
          Gets the default branch key.
 Filter getFilter(String key)
          Gets referent of the filter MBean of the specified key.
 void setDefaultKey(String key)
          Sets the default branch key.
 
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 javax.servlet.Filter
destroy, doFilter, init
 
Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter
checkPermission, checkPermission, checkPermission
 
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 javax.servlet.Filter
destroy, doFilter, init
 
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 javax.servlet.Filter
destroy, doFilter, init
 
Methods inherited from interface org.norther.tammi.spray.filter.KeyFilter
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Method Detail

getDefaultKey

String getDefaultKey()
Gets the default branch key.

Returns:
the default key or null.

setDefaultKey

void setDefaultKey(String key)
Sets the default branch key. The default key is applied, if the request doesn't specify an explicit branch key.

Parameters:
key - the default key.

getFilter

Filter getFilter(String key)
Gets referent of the filter MBean of the specified key.

Parameters:
key - the branch key.
Returns:
the referent of the filter MBean or null.

getBranchKey

String getBranchKey(ServletRequest request,
                    ServletResponse response,
                    FilterChain chain)
Gets the branch key of the selected branch for the specified request.

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

boolean checkPermission(ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Checks whether or not the specified request has an execute permission to the selected branch.

Parameters:
request - the authenticated request.
response - the corresponding response.
chain - the active filter chain.
Returns:
true if the request has the permission, false otherwise.
Throws:
SecurityException - if the access control list is invalid.

checkPermission

boolean checkPermission(Principal principal,
                        ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Checks whether or not the specified principal has an execute permission to the selected branch.

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.
Throws:
SecurityException - if the access control list is invalid.


Copyright © 2004 The Norther Organization. All rights reserved.