public interface Router
Modifier and Type | Method and Description |
---|---|
int |
countTemplates()
Return the number of URI templates served by this Router.
|
String |
findItemURIPath(String context,
URI requestURI,
String itemPath)
Return the URI template of an endpoint in this Router
which has an ItemEndpoint matching the itemPath.
|
Match |
getMatch(String path,
MultiMap<String,String> queryParams)
Match the request path to the known endpoints and return
a Match object (giving the APIEndpoint and any template bindings)
or null if the request does not match.
|
void |
register(String context,
String URITemplate,
APIEndpoint api)
Register a new API instance.
|
List<String> |
templates()
Return a list of URI templates registered with this Router.
|
void |
unregister(String context,
String URITemplate)
Remove a registered api
|
void register(String context, String URITemplate, APIEndpoint api)
URITemplate
- the path template, relative server rootapi
- the api implementationMatch getMatch(String path, MultiMap<String,String> queryParams)
String findItemURIPath(String context, URI requestURI, String itemPath)
int countTemplates()
Copyright © 2014. All Rights Reserved.