|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.core.base.DefaultContainer<V> org.norther.tammi.spray.filter.DefaultContainerFilter<M> org.norther.tammi.spray.media.DefaultMediaContentFilter<M>
M
- the registered provider type.public class DefaultMediaContentFilter<M extends MediaProvider>
A default implementation of MediaContentFilter.
Field Summary |
---|
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
|
DefaultMediaContentFilter()
Contructs a new filter. |
protected |
DefaultMediaContentFilter(ContentFilter filter)
Contructs a new filter. |
Method Summary | |
---|---|
void |
clearFixedPaths()
Clears all fixed content paths. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
Set<String> |
fixedKeySet()
Returns a read-only set of fixed path keys. |
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. |
protected ContentFilter |
getFilter()
Gets the content filter adaptee. |
String |
getFixedPath(String key)
Gets a fixed content path. |
int |
getMaxAge()
Gets the max caching age of content i clients. |
protected MediaProvider |
getMediaProvider(MimeType mime)
Gets the type specific provider. |
protected Resource<?> |
getResource(MimeType mime,
String path,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the resource. |
boolean |
isLocalizedContent()
Gets the localized content flag. |
void |
removeFixedPath(String key)
Removes a fixed content path. |
void |
setFixedPath(String key,
String path)
Sets a fixed content path. |
void |
setLocalizedContent(boolean flag)
Sets the localized content flag. |
void |
setMaxAge(int secs)
Sets the max caching age of content in clients. |
Methods inherited from class org.norther.tammi.spray.filter.DefaultContainerFilter |
---|
destroy, getFilterConfig, getRequestMap, getSessionMap, init |
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 javax.servlet.Filter |
---|
destroy, init |
Constructor Detail |
---|
public DefaultMediaContentFilter()
protected DefaultMediaContentFilter(ContentFilter filter)
filter
- the filter adaptee.Method Detail |
---|
public String getContentPath(boolean unparsed, ServletRequest request, ServletResponse response, FilterChain chain)
ContentFilter
getContentPath
in interface ContentFilter
unparsed
- true for an unparsed path.request
- the request.response
- the response.chain
- the filter chain.
public boolean isLocalizedContent()
MediaContentFilter
isLocalizedContent
in interface MediaContentFilter<M extends MediaProvider>
public void setLocalizedContent(boolean flag)
MediaContentFilter
setLocalizedContent
in interface MediaContentFilter<M extends MediaProvider>
flag
- the localized content flag.public int getMaxAge()
MediaContentFilter
getMaxAge
in interface MediaContentFilter<M extends MediaProvider>
public void setMaxAge(int secs)
MediaContentFilter
setMaxAge
in interface MediaContentFilter<M extends MediaProvider>
secs
- the max age in seconds (-1 = forever).public String getFixedPath(String key)
MediaContentFilter
getFixedPath
in interface MediaContentFilter<M extends MediaProvider>
key
- the path key.
public void setFixedPath(String key, String path)
MediaContentFilter
setFixedPath
in interface MediaContentFilter<M extends MediaProvider>
key
- the path key.path
- a fixed content path.public void removeFixedPath(String key)
MediaContentFilter
removeFixedPath
in interface MediaContentFilter<M extends MediaProvider>
key
- the path key.public void clearFixedPaths()
MediaContentFilter
clearFixedPaths
in interface MediaContentFilter<M extends MediaProvider>
public Set<String> fixedKeySet()
MediaContentFilter
fixedKeySet
in interface MediaContentFilter<M extends MediaProvider>
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException
doFilter
in interface Filter
doFilter
in class DefaultContainerFilter<M extends MediaProvider>
ServletException
IOException
protected MediaProvider getMediaProvider(MimeType mime)
mime
- the MIME type.
NullPointerException
- if type is null.protected Resource<?> getResource(MimeType mime, String path, ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ConstructionException, AccessDeniedException
mime
- the MIME type.path
- the resource path.request
- the request.response
- the response.chain
- the filter chain.
IOException
- on I/O errors.
ConstructionException
- on resource errors.
AccessDeniedException
- for access restrictions.protected ContentFilter getFilter()
getFilter
in class DefaultContainerFilter<M extends MediaProvider>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |