|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResponseFactoryConfig
An interface for thread-safe, ResponseFactory configuration. Allows HTTP URIs to be mapped to different response factories. Updates are atomic.
ResponseFactory instances are mapped to a given URI by finding the longest registered URI that is a prefix to the given URI. If found, then the response is delegated to the factory mapped from that prefix URI; otherwise, the response is NOT FOUND (404).
Method Summary | |
---|---|
ResponseFactory |
addMapping(String path,
ResponseFactory factory)
Adds the given URI path-to-factory mapping to the current mappings and returns the previous mapped factory, if any. |
void |
addMappings(Map<String,ResponseFactory> mappings)
Adds the given URI path-to-factory mappings to the current mappings. |
ResponseFactory |
getMapping(String path)
Returns the ResponseFactory mapped to the specified path, or null, if nothing is mapped to that path. |
SortedMap<String,ResponseFactory> |
getMappings()
Returns a read-only snapshot of the current path-to-factory mappings. |
ResponseFactory |
removeMapping(String path)
Removes the mapping for specified path and returns the old mapped ResponseFactory, if any; null otherwise. |
void |
setMappings(Map<String,ResponseFactory> mappings)
Sets the URI path-to-factory mappings. |
Method Detail |
---|
void setMappings(Map<String,ResponseFactory> mappings)
void addMappings(Map<String,ResponseFactory> mappings)
ResponseFactory addMapping(String path, ResponseFactory factory)
ResponseFactory removeMapping(String path)
ResponseFactory getMapping(String path)
SortedMap<String,ResponseFactory> getMappings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |