org.norther.tammi.spray.media
Class DefaultServiceFilter<F extends Filter>

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.base.DefaultContainer<V>
          extended by org.norther.tammi.core.security.DefaultSecureContainer<V>
              extended by org.norther.tammi.spray.filter.DefaultSecureContainerFilter<V>
                  extended by org.norther.tammi.spray.filter.DefaultSecureContainerKeyFilter<F>
                      extended by org.norther.tammi.spray.filter.DefaultBranchFilter<F>
                          extended by org.norther.tammi.spray.filter.DefaultLinkFilter<F>
                              extended by org.norther.tammi.spray.locale.DefaultPipeFilter<F>
                                  extended by org.norther.tammi.spray.media.DefaultServiceFilter<F>
Type Parameters:
F - the registered filter type.
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Localizer, Container<F>, Manageable, MBeanDelegate, Refreshable, CacheClient<String,String>, FallbackMap, FallbackResources, ResourceMap, AccessController, SecureContainer<F>, BranchFilter<F>, ContainerFilter<F>, ContainerKeyFilter<F>, KeyFilter, LinkFilter<F>, SecureContainerFilter<F>, SecureContainerKeyFilter<F>, SecureFilter, PipeFilter<F>, ResourceFilter, ContentFilter, ContentKeyFilter, ServiceFilter<F>

public class DefaultServiceFilter<F extends Filter>
extends DefaultPipeFilter<F>
implements ServiceFilter<F>

A default implementation of ServiceFilter.

Version:
$Id: DefaultServiceFilter.java,v 1.21 2009/09/28 15:08:26 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
static String SERVICE_KEY
          The service key.
 
Fields inherited from class org.norther.tammi.spray.locale.DefaultPipeFilter
PIPE_KEY
 
Fields inherited from class org.norther.tammi.spray.filter.DefaultLinkFilter
LINK_KEY
 
Fields inherited from class org.norther.tammi.spray.filter.DefaultBranchFilter
BRANCH_KEY
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.acorn.locale.Localizer
ANY_NAME
 
Constructor Summary
DefaultServiceFilter()
          Constructs a new filter.
DefaultServiceFilter(String key)
          Constructs a new filter with a key.
 
Method Summary
 Set<String> branchContentTypes()
          Returns a set branch content types.
 void clearContentTypeBranches()
          Clears all content type specific service branches.
 String getBranch(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the name of the selected branch for the specified request.
 String getContentPath(boolean unparsed, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the optionally unparsed path info as the content path without any parsed keys and values, if any.
 String getContentTypeBranch(String type)
          Gets the service branch for specified content type.
protected  ContentKeyFilter getFilter()
          Gets the key filter adaptee.
 void removeContentTypeBranch(String type)
          Removes the service branch of the specified content type.
 void setContentTypeBranch(String type, String name)
          Sets the service branch for the specified content type.
 
Methods inherited from class org.norther.tammi.spray.locale.DefaultPipeFilter
addResourceBundleName, addResourceBundleNames, clearCached, clearResourceBundleNames, clearResourceBundleNames, expireCached, expireFraction, getCache, getDefaultBaseName, getFallbackBaseName, getFallbackBundle, getFallbackBundle, getFallbackResourcesName, getPlugInBaseName, getRefreshed, getResourceBundleNames, getResourceFinderName, getSharedCacheName, isCachingDisabled, qualifierSet, refresh, removeCache, removeResourceBundleName, resolveFallbackBundle, resolveFallbackBundle, resolveFallbackBundleName, resolveFallbackResource, resolveLocalizedObject, resolveLocalizedResource, resolveLocalizedString, resolveLocalizedStrings, resolveResourceBundle, resolveResourceBundleName, setCachingDisabled, setDefaultBaseName, setFallbackResourcesName, setResourceBundleName, setResourceBundleNames, setResourceFinderName, setSharedCacheName
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultLinkFilter
clear, clearLinkAnchors, containsLinkAnchor, getContainerKey, getLinkAnchor, getLinkAnchor, getLinkName, indexOfLinkAnchor, linkAnchorMap, linkAnchorMap, remove, removeLinkAnchor, removeLinkAnchor, setLinkAnchor, setLinkAnchor, setLinkName, setLinkName
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultBranchFilter
checkPermission, checkPermission, doFilter, getDefaultBranch, getFilter, setDefaultBranch
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultSecureContainerKeyFilter
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultSecureContainerFilter
checkPermission, destroy, getFilterConfig, getRequestMap, getSessionMap, init
 
Methods inherited from class org.norther.tammi.core.security.DefaultSecureContainer
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions
 
Methods inherited from class org.norther.tammi.core.base.DefaultContainer
containsKey, get, getContainerKey, getContainerKey, getMBean, getMBeanHandle, getMBeanHandles, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, 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.spray.filter.LinkFilter
clearLinkAnchors, containsLinkAnchor, getLinkAnchor, getLinkAnchor, getLinkName, indexOfLinkAnchor, linkAnchorMap, linkAnchorMap, removeLinkAnchor, removeLinkAnchor, setLinkAnchor, setLinkAnchor, setLinkName, setLinkName
 
Methods inherited from interface org.norther.tammi.spray.filter.BranchFilter
checkPermission, checkPermission, getDefaultBranch, getFilter, setDefaultBranch
 
Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter
checkPermission
 
Methods inherited from interface org.norther.tammi.core.security.AccessController
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, 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
 
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
 
Methods inherited from interface org.norther.tammi.core.locale.ResourceMap
addResourceBundleName, addResourceBundleNames, clearResourceBundleNames, clearResourceBundleNames, getDefaultBaseName, getFallbackResourcesName, getPlugInBaseName, getResourceBundleNames, getResourceFinderName, qualifierSet, removeResourceBundleName, resolveResourceBundle, resolveResourceBundleName, setDefaultBaseName, setFallbackResourcesName, setResourceBundleName, setResourceBundleNames, setResourceFinderName
 
Methods inherited from interface org.norther.tammi.acorn.locale.Localizer
resolveLocalizedObject, resolveLocalizedResource, resolveLocalizedString, resolveLocalizedStrings
 
Methods inherited from interface org.norther.tammi.core.cache.CacheClient
clearCached, expireCached, expireFraction, getCache, getSharedCacheName, isCachingDisabled, removeCache, setCachingDisabled, setSharedCacheName
 
Methods inherited from interface org.norther.tammi.core.base.Refreshable
getRefreshed, refresh
 
Methods inherited from interface org.norther.tammi.core.locale.FallbackResources
getFallbackBaseName, getFallbackBundle, getFallbackBundle, resolveFallbackBundle, resolveFallbackBundle, resolveFallbackBundleName, resolveFallbackResource
 

Field Detail

SERVICE_KEY

public static final String SERVICE_KEY
The service key.

See Also:
Constant Field Values
Constructor Detail

DefaultServiceFilter

public DefaultServiceFilter()
Constructs a new filter.


DefaultServiceFilter

public DefaultServiceFilter(String key)
Constructs a new filter with a key.

Parameters:
key - the filter key.
Method Detail

getContentPath

public String getContentPath(boolean unparsed,
                             ServletRequest request,
                             ServletResponse response,
                             FilterChain chain)
Description copied from interface: ContentFilter
Gets the optionally unparsed path info as the content path without any parsed keys and values, if any. Returns null, if the path is missing or unparsed is true and the path is partially parsed.

Specified by:
getContentPath in interface ContentFilter
Parameters:
unparsed - true for an unparsed path.
request - the request.
response - the response.
chain - the filter chain.
Returns:
the content path or an empty path.

getBranch

public String getBranch(ServletRequest request,
                        ServletResponse response,
                        FilterChain chain)
Description copied from interface: BranchFilter
Gets the name of the selected branch for the specified request.

Specified by:
getBranch in interface BranchFilter<F extends Filter>
Overrides:
getBranch in class DefaultBranchFilter<F extends Filter>
Parameters:
request - the request to process.
response - the response to return.
chain - the current filter chain.
Returns:
the branch name to apply or null.

getContentTypeBranch

public String getContentTypeBranch(String type)
Description copied from interface: ServiceFilter
Gets the service branch for specified content type.

Specified by:
getContentTypeBranch in interface ServiceFilter<F extends Filter>
Parameters:
type - the content type.
Returns:
the service branch or null.

setContentTypeBranch

public void setContentTypeBranch(String type,
                                 String name)
Description copied from interface: ServiceFilter
Sets the service branch for the specified content type.

Specified by:
setContentTypeBranch in interface ServiceFilter<F extends Filter>
Parameters:
type - the content type.
name - the service branch.

removeContentTypeBranch

public void removeContentTypeBranch(String type)
Description copied from interface: ServiceFilter
Removes the service branch of the specified content type.

Specified by:
removeContentTypeBranch in interface ServiceFilter<F extends Filter>
Parameters:
type - the content type.

clearContentTypeBranches

public void clearContentTypeBranches()
Description copied from interface: ServiceFilter
Clears all content type specific service branches.

Specified by:
clearContentTypeBranches in interface ServiceFilter<F extends Filter>

branchContentTypes

public Set<String> branchContentTypes()
Description copied from interface: ServiceFilter
Returns a set branch content types.

Specified by:
branchContentTypes in interface ServiceFilter<F extends Filter>
Returns:
a read-only set of content types.

getFilter

protected ContentKeyFilter getFilter()
Description copied from class: DefaultSecureContainerKeyFilter
Gets the key filter adaptee.

Overrides:
getFilter in class DefaultSecureContainerKeyFilter<F extends Filter>
Returns:
the key filter adaptee.


Copyright © 2004 The Norther Organization. All rights reserved.