Class RouteBuilderDefault<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>>

java.lang.Object
org.spincast.plugins.routing.RouteBuilderDefault<R,W>
All Implemented Interfaces:
org.spincast.core.routing.RouteBuilder<R>

public class RouteBuilderDefault<R extends org.spincast.core.exchange.RequestContext<?>,W extends org.spincast.core.websocket.WebsocketContext<?>> extends Object implements org.spincast.core.routing.RouteBuilder<R>
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
  • Constructor Details

    • RouteBuilderDefault

      public RouteBuilderDefault(RouteFactory<R> routeFactory, SpincastRouterConfig spincastRouterConfig, org.spincast.core.filters.SpincastFilters<R> spincastFilters, org.spincast.core.config.SpincastConfig spincastConfig)
    • RouteBuilderDefault

      public RouteBuilderDefault(org.spincast.core.routing.Router<R,W> router, RouteFactory<R> routeFactory, SpincastRouterConfig spincastRouterConfig, org.spincast.core.filters.SpincastFilters<R> spincastFilters, org.spincast.core.config.SpincastConfig spincastConfig)
  • Method Details

    • getRouter

      protected org.spincast.core.routing.Router<R,W> getRouter()
    • getRouteFactory

      protected RouteFactory<R> getRouteFactory()
    • getSpincastRouterConfig

      protected SpincastRouterConfig getSpincastRouterConfig()
    • getSpincastFilters

      protected org.spincast.core.filters.SpincastFilters<R> getSpincastFilters()
    • getSpincastConfig

      protected org.spincast.core.config.SpincastConfig getSpincastConfig()
    • getId

      public String getId()
    • getClasses

      public Set<String> getClasses()
    • isSpicastCoreRouteOrPluginRoute

      public boolean isSpicastCoreRouteOrPluginRoute()
    • getPath

      public String getPath()
    • getPosition

      public int getPosition()
    • isSkipResources

      public boolean isSkipResources()
    • getRoutingTypes

      public Set<org.spincast.core.routing.RoutingType> getRoutingTypes()
    • getHttpMethods

      public Set<org.spincast.core.routing.HttpMethod> getHttpMethods()
    • getBeforeFilters

      public List<org.spincast.core.routing.Handler<R>> getBeforeFilters()
    • getAfterFilters

      public List<org.spincast.core.routing.Handler<R>> getAfterFilters()
    • getMainHandler

      public org.spincast.core.routing.Handler<R> getMainHandler()
    • getAcceptedContentTypes

      public Set<String> getAcceptedContentTypes()
    • getFilterIdsToSkip

      public Set<String> getFilterIdsToSkip()
    • getSpecs

      public Object getSpecs()
      May be null.
    • isSpecsIgnore

      public boolean isSpecsIgnore()
    • getSpecsParameters

      public Object[] getSpecsParameters()
    • id

      public org.spincast.core.routing.RouteBuilder<R> id(String id)
      Specified by:
      id in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • classes

      public org.spincast.core.routing.RouteBuilder<R> classes(String... classes)
      Specified by:
      classes in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • spicastCoreRouteOrPluginRoute

      public org.spincast.core.routing.RouteBuilder<R> spicastCoreRouteOrPluginRoute()
      Specified by:
      spicastCoreRouteOrPluginRoute in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • pos

      public org.spincast.core.routing.RouteBuilder<R> pos(int position)
      Specified by:
      pos in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • allRoutingTypes

      public org.spincast.core.routing.RouteBuilder<R> allRoutingTypes()
      Specified by:
      allRoutingTypes in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • found

      public org.spincast.core.routing.RouteBuilder<R> found()
      Specified by:
      found in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • notFound

      public org.spincast.core.routing.RouteBuilder<R> notFound()
      Specified by:
      notFound in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • exception

      public org.spincast.core.routing.RouteBuilder<R> exception()
      Specified by:
      exception in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • before

      public org.spincast.core.routing.RouteBuilder<R> before(org.spincast.core.routing.Handler<R> beforeFilter)
      Specified by:
      before in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • after

      public org.spincast.core.routing.RouteBuilder<R> after(org.spincast.core.routing.Handler<R> afterFilter)
      Specified by:
      after in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • acceptAsString

      public org.spincast.core.routing.RouteBuilder<R> acceptAsString(String... acceptedContentTypes)
      Specified by:
      acceptAsString in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • acceptAsString

      public org.spincast.core.routing.RouteBuilder<R> acceptAsString(Set<String> acceptedContentTypes)
      Specified by:
      acceptAsString in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • accept

      public org.spincast.core.routing.RouteBuilder<R> accept(org.spincast.core.utils.ContentTypeDefaults... acceptedContentTypes)
      Specified by:
      accept in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • accept

      public org.spincast.core.routing.RouteBuilder<R> accept(Set<org.spincast.core.utils.ContentTypeDefaults> acceptedContentTypes)
      Specified by:
      accept in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • html

      public org.spincast.core.routing.RouteBuilder<R> html()
      Specified by:
      html in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • json

      public org.spincast.core.routing.RouteBuilder<R> json()
      Specified by:
      json in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • xml

      public org.spincast.core.routing.RouteBuilder<R> xml()
      Specified by:
      xml in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • path

      public org.spincast.core.routing.RouteBuilder<R> path(String path)
      Specified by:
      path in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • GET

      public org.spincast.core.routing.RouteBuilder<R> GET()
      Specified by:
      GET in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • POST

      public org.spincast.core.routing.RouteBuilder<R> POST()
      Specified by:
      POST in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • PUT

      public org.spincast.core.routing.RouteBuilder<R> PUT()
      Specified by:
      PUT in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • DELETE

      public org.spincast.core.routing.RouteBuilder<R> DELETE()
      Specified by:
      DELETE in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • OPTIONS

      public org.spincast.core.routing.RouteBuilder<R> OPTIONS()
      Specified by:
      OPTIONS in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • TRACE

      public org.spincast.core.routing.RouteBuilder<R> TRACE()
      Specified by:
      TRACE in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • HEAD

      public org.spincast.core.routing.RouteBuilder<R> HEAD()
      Specified by:
      HEAD in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • PATCH

      public org.spincast.core.routing.RouteBuilder<R> PATCH()
      Specified by:
      PATCH in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • ALL

      public org.spincast.core.routing.RouteBuilder<R> ALL()
      Specified by:
      ALL in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • methods

      public org.spincast.core.routing.RouteBuilder<R> methods(Set<org.spincast.core.routing.HttpMethod> httpMethods)
      Specified by:
      methods in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • methods

      public org.spincast.core.routing.RouteBuilder<R> methods(org.spincast.core.routing.HttpMethod... httpMethods)
      Specified by:
      methods in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • handle

      public void handle(org.spincast.core.routing.Handler<R> mainHandler)
      Specified by:
      handle in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • create

      public org.spincast.core.routing.Route<R> create(org.spincast.core.routing.Handler<R> mainHandler)
      Specified by:
      create in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • noCache

      public org.spincast.core.routing.RouteBuilder<R> noCache()
      Specified by:
      noCache in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • cache

      public org.spincast.core.routing.RouteBuilder<R> cache()
      Specified by:
      cache in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • cache

      public org.spincast.core.routing.RouteBuilder<R> cache(int seconds)
      Specified by:
      cache in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • cache

      public org.spincast.core.routing.RouteBuilder<R> cache(int seconds, boolean isPrivate)
      Specified by:
      cache in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • cache

      public org.spincast.core.routing.RouteBuilder<R> cache(int seconds, boolean isPrivate, Integer secondsCdn)
      Specified by:
      cache in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • getCacheSecondsByDefault

      protected int getCacheSecondsByDefault()
    • isCachePrivateByDefault

      protected boolean isCachePrivateByDefault()
    • getCacheCdnSecondsByDefault

      protected Integer getCacheCdnSecondsByDefault()
    • skip

      public org.spincast.core.routing.RouteBuilder<R> skip(String filterId)
      Specified by:
      skip in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • skipResourcesRequests

      public org.spincast.core.routing.RouteBuilder<R> skipResourcesRequests()
      Specified by:
      skipResourcesRequests in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • specs

      public org.spincast.core.routing.RouteBuilder<R> specs(Object specs, Object... parameters)
      Specified by:
      specs in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>
    • specsIgnore

      public org.spincast.core.routing.RouteBuilder<R> specsIgnore()
      Specified by:
      specsIgnore in interface org.spincast.core.routing.RouteBuilder<R extends org.spincast.core.exchange.RequestContext<?>>