org.weborganic.berlioz.content
Class MatchingService

java.lang.Object
  extended by org.weborganic.berlioz.content.MatchingService

public final class MatchingService
extends Object

Encapsulates the results of the service matching.

Implementation note: all fields are immutable.

Since:
Berlioz 0.6
Version:
Berlioz 0.6.0 - 31 May 2010
Author:
Christophe Lauret

Constructor Summary
MatchingService(Service service, URIPattern pattern, URIResolveResult result)
          Creates a new matching service.
 
Method Summary
 boolean isCacheable()
          Indicates whether this response is cacheable.
 URIPattern pattern()
          Always returns the matching URI pattern.
 URIResolveResult result()
          Always returns the resolved URI variables.
 Service service()
          Always returns the matched service (always a value).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingService

public MatchingService(Service service,
                       URIPattern pattern,
                       URIResolveResult result)
Creates a new matching service.

Parameters:
service - The matched service.
pattern - The URI pattern it matched.
result - The resolved URI variables.
Method Detail

isCacheable

public boolean isCacheable()
Indicates whether this response is cacheable.

A response is cacheable only is the service has been found and all its generators are cacheable.

Returns:
true if this response is cacheable; false otherwise.

service

public Service service()
Always returns the matched service (always a value).

Returns:
The matched service (never null).

pattern

public URIPattern pattern()
Always returns the matching URI pattern.

Returns:
The URI pattern it matched (never null).

result

public URIResolveResult result()
Always returns the resolved URI variables.

Returns:
The resolved URI variables (never null).