aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.router
Interface Route

All Known Implementing Classes:
DefaultRoute

public interface Route

An object that contains information required to route HTTP requests to a target class's method.


Method Summary
 boolean canHandle(Throwable throwable)
          Determines if this Route can handle the throwable.
 Set<RequestMethod> getMethods()
          Gets the RequestMethods for this Route.
 String getPath()
          Gets the path for this Route.
 Set<String> getRoles()
          Gets this Routes associated roles.
 Class<?> getTargetClass()
          Gets the target class for this Route
 Method getTargetMethod()
          Gets the Method of the target class for this Route.
 boolean hasExceptionsRoutes()
          Determines if this Route contains one or more exception routes.
 boolean isParameterized()
          Determines if this Route's path is parameterized.
 boolean isSecured()
          Determines if this Route has roles configured.
 boolean matches(RequestMethod method, String path, Set<String> acceptHeaders)
          Determines if this Route can handle the RequestMethod and path combination.
 Set<String> produces()
          Returns the media types that this Route is capable of serving.
 

Method Detail

getMethods

Set<RequestMethod> getMethods()
Gets the RequestMethods for this Route.

Returns:
the RequestMethods, or an empty set.

getPath

String getPath()
Gets the path for this Route.

Returns:
the path for this route, or null if no path exists for this Route.

getTargetMethod

Method getTargetMethod()
Gets the Method of the target class for this Route.

Returns:
the target method.

getTargetClass

Class<?> getTargetClass()
Gets the target class for this Route

Returns:
the target class.

matches

boolean matches(RequestMethod method,
                String path,
                Set<String> acceptHeaders)
Determines if this Route can handle the RequestMethod and path combination.

Parameters:
method - the http request methods.
path - the request path.
acceptHeaders - the accept headers provided, or an empty set if none were provided.
Returns:
true if this Route can handle the method and path passed in, false otherwise.

isParameterized

boolean isParameterized()
Determines if this Route's path is parameterized.

Returns:
true if this Route's path parameterized, otherwise false.

isSecured

boolean isSecured()
Determines if this Route has roles configured.

Returns:
true if this Route has roles associated with its Route.

getRoles

Set<String> getRoles()
Gets this Routes associated roles.

Returns:
the roles associated with this Route, or an empty set if there are no roles associated.

hasExceptionsRoutes

boolean hasExceptionsRoutes()
Determines if this Route contains one or more exception routes.

Returns:
true if this Route has one or more exception routes.

canHandle

boolean canHandle(Throwable throwable)
Determines if this Route can handle the throwable.

Parameters:
throwable -
Returns:
true if this Route can handle the Throwable, otherwise false.

produces

Set<String> produces()
Returns the media types that this Route is capable of serving.

Returns:
the media types that this routes can produce.

aerogear-controller 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.