|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weborganic.berlioz.content.ServiceRegistry
public final class ServiceRegistry
A registry for services.
Note: this class is not synchronized and must be synchronized externally.
Constructor Summary | |
---|---|
ServiceRegistry()
Creates a new registry. |
Method Summary | |
---|---|
List<String> |
allows(String url)
Returns the list of HTTP methods allowed for this URL. |
void |
clear()
Clears each generator mapping. |
MatchingService |
get(String url)
Returns the list of content generators for this URL. |
MatchingService |
get(String url,
HttpMethod method)
Returns the content generator for this URL and HTTP method. |
MatchingService |
get(String url,
String method)
Returns the content generator for this URL and HTTP method. |
HttpMethod |
getMethod(Service service)
Returns the HTTP method this service is mapped to. |
Map<String,Service> |
getServiceMap(HttpMethod method)
Returns an unmodifiable map of services by URI Pattern for the specified HTTP method. |
List<Service> |
getServices()
Returns the set of registered services. |
List<Service> |
getServices(HttpMethod method)
Returns the list of services for the specified HTTP method. |
List<String> |
matches(Service service)
Returns the list of URI Patterns that this service matches. |
void |
register(Service service,
URIPattern pattern,
HttpMethod method)
Register the content generator. |
long |
version()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceRegistry()
Method Detail |
---|
public void register(Service service, URIPattern pattern, HttpMethod method)
service
- the service to register.pattern
- the URL pattern to associate to this content generator.method
- the method for this URL pattern.
NullPointerException
- If any argument is null
public MatchingService get(String url)
This method iterates over each HTTP method in the following order: GET, POST, PUT, DELETE.
url
- The URL.
null
.public List<String> allows(String url)
If the GET method is supported, then the HEAD method is also supported and added to this list.
url
- The URL.
public HttpMethod getMethod(Service service)
service
- The Berlioz service.
null
.public List<String> matches(Service service)
service
- The Berlioz service.
public MatchingService get(String url, String method)
If the HTTP method specified is HEAD, this method will return the service for a GET request.
url
- The URL.method
- The HTTP method.
null
.public MatchingService get(String url, HttpMethod method)
If the HTTP method specified is HEAD, this method will return the service for a GET request.
url
- The URL.method
- The HTTP method.
null
.public Map<String,Service> getServiceMap(HttpMethod method)
method
- the HTTP method.
public List<Service> getServices()
public List<Service> getServices(HttpMethod method)
method
- the HTTP method.
public void clear()
public long version()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |