aerogear-controller 1.0.1

org.jboss.aerogear.controller.router
Class RouteDescriptor

java.lang.Object
  extended by org.jboss.aerogear.controller.router.RouteDescriptor
All Implemented Interfaces:
RouteBuilder.OnMethods, RouteBuilder.TargetEndpoint

public class RouteDescriptor
extends Object
implements RouteBuilder.OnMethods, RouteBuilder.TargetEndpoint

Describes/configures a single route in AeroGear controller.


Nested Class Summary
private static class RouteDescriptor.FinalizeFilter
           
private static class RouteDescriptor.MyMethodInterceptor
           
 
Field Summary
private  Object[] args
           
private  List<String> consumes
           
private static RouteDescriptor.FinalizeFilter FINALIZE_FILTER
           
private  RequestMethod[] methods
           
private  List<Parameter<?>> parameters
           
private  String path
           
private  MediaType[] produces
           
private  String[] roles
           
private  Class<?> targetClass
           
private  Method targetMethod
           
private  Set<Class<? extends Throwable>> throwables
           
 
Constructor Summary
RouteDescriptor()
           
 
Method Summary
 void addParameter(Parameter<?> parameter)
           
 RouteBuilder.TargetEndpoint consumes(MediaType... consumes)
          Specifies the media types that this endpoint can consumes.
 RouteBuilder.TargetEndpoint consumes(String... consumes)
          Specifies the media types that this endpoint can consumes.
 List<String> getConsumes()
           
 RequestMethod[] getMethods()
           
 List<Parameter<?>> getParameters()
           
 String getPath()
           
 MediaType[] getProduces()
           
 String[] getRoles()
           
 Class<?> getTargetClass()
           
 Method getTargetMethod()
           
 Set<Class<? extends Throwable>> getThrowables()
           
 RouteBuilder.TargetEndpoint on(RequestMethod... methods)
          Specifies which RequestMethods should be supported by the Route.
 RouteBuilder.TargetEndpoint produces(MediaType... produces)
          Specifies the MediaType's that this endpoint produces.
 RouteBuilder.OnMethods roles(String... roles)
          Specifies the roles that are allowed to invoke the target endpoint
 RouteDescriptor setPath(String path)
          Set the path for this instance.
 RouteDescriptor setThrowables(Set<Class<? extends Throwable>> throwables)
           
<T> T
to(Class<T> clazz)
          Specifies the target Class for the Route.
 String toString()
           
private  List<String> toStrings(MediaType... mediaTypes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

path

private String path

targetMethod

private Method targetMethod

args

private Object[] args

methods

private RequestMethod[] methods

targetClass

private Class<?> targetClass

roles

private String[] roles

consumes

private final List<String> consumes

parameters

private final List<Parameter<?>> parameters

produces

private MediaType[] produces

throwables

private Set<Class<? extends Throwable>> throwables

FINALIZE_FILTER

private static final RouteDescriptor.FinalizeFilter FINALIZE_FILTER
Constructor Detail

RouteDescriptor

public RouteDescriptor()
Method Detail

setPath

public RouteDescriptor setPath(String path)
Set the path for this instance.

A RouteDescriptor may have an empty path if it is an error route.

Parameters:
path - the from path for this route.

on

public RouteBuilder.TargetEndpoint on(RequestMethod... methods)
Description copied from interface: RouteBuilder.OnMethods
Specifies which RequestMethods should be supported by the Route.

Specified by:
on in interface RouteBuilder.OnMethods
Parameters:
methods - the RequestMethods that should be supported.
Returns:
RouteBuilder.TargetEndpoint which is a builder for the destination for this Route.

roles

public RouteBuilder.OnMethods roles(String... roles)
Description copied from interface: RouteBuilder.OnMethods
Specifies the roles that are allowed to invoke the target endpoint

Specified by:
roles in interface RouteBuilder.OnMethods
Parameters:
roles - the roles.
Returns:
RouteBuilder.OnMethods to support method chaining.

to

public <T> T to(Class<T> clazz)
Description copied from interface: RouteBuilder.TargetEndpoint
Specifies the target Class for the Route.

Specified by:
to in interface RouteBuilder.TargetEndpoint
Parameters:
clazz - The class that will be the used as the target endpoint by the Route.
Returns:
T the type of the class.

getPath

public String getPath()

getMethods

public RequestMethod[] getMethods()

getTargetMethod

public Method getTargetMethod()

getTargetClass

public Class<?> getTargetClass()

getRoles

public String[] getRoles()

toString

public String toString()
Overrides:
toString in class Object

setThrowables

public RouteDescriptor setThrowables(Set<Class<? extends Throwable>> throwables)

getThrowables

public Set<Class<? extends Throwable>> getThrowables()

getParameters

public List<Parameter<?>> getParameters()

produces

public RouteBuilder.TargetEndpoint produces(MediaType... produces)
Description copied from interface: RouteBuilder.TargetEndpoint
Specifies the MediaType's that this endpoint produces.

Specified by:
produces in interface RouteBuilder.TargetEndpoint
Parameters:
produces - the MediaTypes that this endpoint method can produce.
Returns:
RouteBuilder.TargetEndpoint to support method chaining.

getProduces

public MediaType[] getProduces()

consumes

public RouteBuilder.TargetEndpoint consumes(String... consumes)
Description copied from interface: RouteBuilder.TargetEndpoint
Specifies the media types that this endpoint can consumes.

Specified by:
consumes in interface RouteBuilder.TargetEndpoint
Parameters:
consumes - the media types that this endpoint method can consume.
Returns:
RouteBuilder.TargetEndpoint to support method chaining.

consumes

public RouteBuilder.TargetEndpoint consumes(MediaType... consumes)
Description copied from interface: RouteBuilder.TargetEndpoint
Specifies the media types that this endpoint can consumes.

Specified by:
consumes in interface RouteBuilder.TargetEndpoint
Parameters:
consumes - the media types that this endpoint method can consume.
Returns:
RouteBuilder.TargetEndpoint to support method chaining.

toStrings

private List<String> toStrings(MediaType... mediaTypes)

getConsumes

public List<String> getConsumes()

addParameter

public void addParameter(Parameter<?> parameter)

aerogear-controller 1.0.1

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