|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TerminalFilter
An interface to filters determining the properties of the terminal. The main properties include the preferred MIME type for the terminal and the identification of the terminal.
Method Summary | |
---|---|
void |
addDefaultContentTypes(String[] types)
Adds more default content type for requests. |
void |
addHostPatterns(String name,
String[] patterns)
Adds more host patterns for a named profile. |
void |
addProfileContentTypes(String name,
String[] types)
Adds more profile specific content types. |
boolean |
addProfileName(String name)
Adds a named profile if absent. |
void |
addProfileNames(String[] names)
Adds named profiles if absent. |
void |
addTerminalIdCookies(String[] names)
Adds more potential terminal id cookies. |
void |
addTerminalIdHeaders(String[] names)
Adds more potential terminal id headers. |
void |
addTerminalIdParameters(String[] names)
Adds more potential terminal id parameters. |
void |
addUserAgentPatterns(String name,
String[] patterns)
Adds more user agent patterns for a named profile. |
void |
clearDefaultContentTypes()
Clears all default content types for requests. |
void |
clearHostPatterns(String name)
Clears all host patterns. |
void |
clearProfileContentTypes(String name)
Clears all profile specific content types. |
void |
clearProfiles()
Clears all profiles. |
void |
clearTerminalIdCookies()
Clears all potential terminal id cookies. |
void |
clearTerminalIdHeaders()
Clears all potential terminal id headers. |
void |
clearTerminalIdParameters()
Clears all potential terminal id parameters. |
void |
clearUserAgentPatterns(String name)
Clears all user agent patterns. |
boolean |
containsProfile(String name)
Checks the named profile. |
String[] |
getDefaultContentTypes()
Gets the default content types for requests. |
int |
getDefaultHeight()
Gets the default height in pixels. |
String |
getDefaultProfileName()
Gets the name of the default profile. |
int |
getDefaultWidth()
Gets the default width in pixels. |
String[] |
getHostPatterns(String name)
Gets host patterns for a named profile. |
Profile |
getProfile(String name)
Gets the named profile. |
String[] |
getProfileContentTypes(String name)
Gets profile specific content types. |
String |
getProfileDefaultName(String name)
Gets the default profile name of the specified skin. |
int |
getProfileHeight(String name)
Gets the height of the named profile in pixels. |
int |
getProfileWidth(String name)
Gets the width of the named profile in pixels. |
MimeType |
getTerminalContentType(MimeType favorite,
Profile profile,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the terminal specific MIME type best matching the accepted content types of the current user agent. |
String[] |
getTerminalIdCookies()
Gets potential terminal id cookies. |
String[] |
getTerminalIdHeaders()
Gets potential terminal id headers. |
String[] |
getTerminalIdParameters()
Gets potential terminal id parameters. |
String[] |
getUserAgentPatterns(String name)
Gets user agent patterns for a named profile. |
boolean |
isProfileScriptable(String name)
Checks whether the named profile is scriptable. |
boolean |
isScriptableProfiles()
Checks whether profiles are scriptable by default. |
Profile |
matchHost(String host)
Matches the given host against profiles in definition order. |
Profile |
matchUserAgent(String agent)
Matches the given user agent against profiles in definition order. |
Set<String> |
profileNameSet()
Returns a read-only set of profile names. |
void |
removeDefaultContentType(String csv)
Removes one or more default content types for requests. |
void |
removeHostPattern(String name,
String pattern)
Removes a host pattern from a named profile. |
void |
removeProfile(String name)
Removes the named profile. |
void |
removeProfileContentType(String name,
String type)
Removes a profile specific content type. |
void |
removeTerminalIdCookie(String name)
Removes a potential terminal id cookie. |
void |
removeTerminalIdHeader(String name)
Removes a potential terminal id header. |
void |
removeTerminalIdParameter(String name)
Removes a potential terminal id header. |
void |
removeUserAgentPattern(String name,
String pattern)
Removes a user agent pattern from a named profile. |
Profile |
resolveCurrentProfile(String agent,
String... host)
Resolves the current profile for the given user agent and host. |
void |
setDefaultContentTypes(String[] types)
Sets the default content types for requests. |
void |
setDefaultHeight(int h)
Sets the default height in pixels. |
void |
setDefaultProfileName(String name)
Sets the name of the default profile. |
void |
setDefaultWidth(int w)
Sets the default width.in pixels |
void |
setHostPatterns(String name,
String[] patterns)
Sets host patterns for a named profile. |
void |
setProfileContentTypes(String name,
String[] types)
Sets profile specific content types. |
void |
setProfileDefaultName(String name,
String dname)
Sets the default profile name of the specified profile. |
void |
setProfileHeight(String name,
int h)
Sets the height of the named profile in pixels. |
void |
setProfileName(String name)
Sets or replaces a named profile. |
void |
setProfileNames(String[] names)
Sets or replaces named profiles. |
void |
setProfileScriptable(String name,
boolean flag)
Sets whether the named profile is scriptable. |
void |
setProfileWidth(String name,
int w)
Sets the width of the named profile in pixels. |
void |
setScriptableProfiles(boolean flag)
Sets whether profiles are scriptable by default. |
void |
setTerminalIdCookies(String[] names)
Sets potential terminal id cookies. |
void |
setTerminalIdHeaders(String[] names)
Sets potential terminal id headers. |
void |
setTerminalIdParameters(String[] names)
Sets potential terminal id parameters. |
void |
setUserAgentPatterns(String name,
String[] patterns)
Sets user agent patterns for a named profile. |
Set<String> |
terminalIdCookieSet()
Returns a set of terminal id cookies. |
Set<String> |
terminalIdHeaderSet()
Returns a set of terminal id headers. |
Set<String> |
terminalIdParameterSet()
Returns a set of terminal id parameters. |
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 |
---|
String getDefaultProfileName()
void setDefaultProfileName(String name)
name
- the name of the profile.boolean isScriptableProfiles()
void setScriptableProfiles(boolean flag)
flag
- true if scriptable, false otherwise.int getDefaultWidth()
void setDefaultWidth(int w)
w
- the width.int getDefaultHeight()
void setDefaultHeight(int h)
h
- the height.String[] getDefaultContentTypes()
void setDefaultContentTypes(String[] types)
The format of the type is similar to that in the accept header except of an additional 'x' parameter, which specifies the content type variant corresponding to the file name extension of that content. The Q-value defines the priority between 0-1. E.g.
'MIME type'[; x='extension'][; q='value']
For more information about Internet media types, please check RFCs 2045-2049 and their updates.
types
- an array of comma separated values of content types.void addDefaultContentTypes(String[] types)
types
- an array of comma separated values of content types.void removeDefaultContentType(String csv)
csv
- comma separated values of content types or extensions.void clearDefaultContentTypes()
void setProfileName(String name)
name
- the name of the profile.boolean addProfileName(String name)
name
- the name of the profile.
void setProfileNames(String[] names)
names
- the names of the profiles.void addProfileNames(String[] names)
names
- the names of the profiles.Set<String> profileNameSet()
void removeProfile(String name)
name
- the name of the profile.void clearProfiles()
String getProfileDefaultName(String name)
name
- the name of the profile.
void setProfileDefaultName(String name, String dname)
name
- the name of the profile.dname
- the default profile name.
NullPointerException
- if the profile is not found.boolean isProfileScriptable(String name)
name
- the name of the profile.
void setProfileScriptable(String name, boolean flag)
name
- the name of the profile.flag
- true if scriptable, false otherwise.
NullPointerException
- if the profile is not found.int getProfileWidth(String name)
name
- the name of the profile.
void setProfileWidth(String name, int w)
name
- the name of the profile.w
- the width.
NullPointerException
- if the profile is not found.int getProfileHeight(String name)
name
- the name of the profile.
void setProfileHeight(String name, int h)
name
- the name of the profile.h
- the height.
NullPointerException
- if the profile is not found.String[] getProfileContentTypes(String name)
name
- the name of the profile.
void setProfileContentTypes(String name, String[] types)
An additional 'nocharset' parameter defines that charset definition is not appended to the content type if it is not accepted by the user agent. E.g.
'VARIANT' = 'MIME type'[; x='extension'][; q='value'] [; nocharset=on]
name
- the name of the profile.types
- an array of comma separated values of content types.
NullPointerException
- if the profile is not found.void addProfileContentTypes(String name, String[] types)
name
- the name of the profile.types
- an array of comma separated values of content types.
NullPointerException
- if the profile is not found.void removeProfileContentType(String name, String type)
name
- the name of the profile.type
- the content type.void clearProfileContentTypes(String name)
name
- the name of the profile.String[] getUserAgentPatterns(String name)
name
- the name of the profile.
void setUserAgentPatterns(String name, String[] patterns)
name
- the name of the profile.patterns
- an array of patterns.
NullPointerException
- if the profile is not found.void addUserAgentPatterns(String name, String[] patterns)
name
- the name of the profile.patterns
- an array of patterns.void removeUserAgentPattern(String name, String pattern)
name
- the name of the profile.pattern
- the pattern to remove.void clearUserAgentPatterns(String name)
name
- the name of the profile.Profile matchUserAgent(String agent)
agent
- the request specific user agent.
String[] getHostPatterns(String name)
name
- the name of the profile.
void setHostPatterns(String name, String[] patterns)
name
- the name of the profile.patterns
- an array of patterns.
NullPointerException
- if the profile is not found.void addHostPatterns(String name, String[] patterns)
name
- the name of the profile.patterns
- an array of patterns.
NullPointerException
- if the profile is not found.void removeHostPattern(String name, String pattern)
name
- the name of the profile.pattern
- the pattern to remove.void clearHostPatterns(String name)
name
- the name of the profile.Profile matchHost(String host)
host
- the request specific host.
Profile getProfile(String name)
name
- the name of the profile.
boolean containsProfile(String name)
name
- the name of the profile.
Profile resolveCurrentProfile(String agent, String... host)
agent
- the user agent.host
- the host name.
String[] getTerminalIdParameters()
void setTerminalIdParameters(String[] names)
names
- an array of parameter names.void addTerminalIdParameters(String[] names)
names
- an array of parameter names.void removeTerminalIdParameter(String name)
name
- a parameter name.void clearTerminalIdParameters()
Set<String> terminalIdParameterSet()
String[] getTerminalIdCookies()
void setTerminalIdCookies(String[] names)
names
- an array of cookie names.void addTerminalIdCookies(String[] names)
names
- an array of cookie names.void removeTerminalIdCookie(String name)
name
- a cookie name.void clearTerminalIdCookies()
Set<String> terminalIdCookieSet()
String[] getTerminalIdHeaders()
void setTerminalIdHeaders(String[] names)
names
- an array of header names.void addTerminalIdHeaders(String[] names)
names
- an array of header names.void removeTerminalIdHeader(String name)
name
- a header name.void clearTerminalIdHeaders()
Set<String> terminalIdHeaderSet()
MimeType getTerminalContentType(MimeType favorite, Profile profile, ServletRequest request, ServletResponse response, FilterChain chain)
favorite
- the favorite type.profile
- the profile to apply.request
- the request.response
- the response.chain
- the filter chain.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |