Package org.spincast.plugins.routing
Class RedirectRuleBuilderDefault<R extends RequestContext<?>,W extends WebsocketContext<?>>
java.lang.Object
org.spincast.plugins.routing.RedirectRuleBuilderDefault<R,W>
- All Implemented Interfaces:
RedirectRuleBuilder<R,W>
public class RedirectRuleBuilderDefault<R extends RequestContext<?>,W extends WebsocketContext<?>>
extends Object
implements RedirectRuleBuilder<R,W>
Default implementation for the RedirectRuleBuilder interface.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRedirectRuleBuilderDefault(Router<R, W> router, String oldPath, SpincastRouterConfig spincastRouterConfig, SpincastRoutingUtils spincastRoutingUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRedirectHandler(Handler<R> handler) protected Stringprotected intprotected SpincastRouterConfigprotected SpincastRoutingUtilsprotected booleanThe redirection will be permanent (301).pos(int position) The position where the filter will be run.The redirection will be temporarily (302).protected voidthrowRedirect(R context, String newPathOrFullUrl) voidThe new path or full URL to redirect to.voidto(RedirectHandler<R, W> handler) Will called the specifiedRedirectHandlerto generate the path to redirect to.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
RedirectRuleBuilderDefault
public RedirectRuleBuilderDefault(Router<R, W> router, String oldPath, SpincastRouterConfig spincastRouterConfig, SpincastRoutingUtils spincastRoutingUtils)
-
-
Method Details
-
getRouter
-
getOldPath
-
getSpincastRouterConfig
-
getSpincastRoutingUtils
-
isPermanently
protected boolean isPermanently() -
getPosition
protected int getPosition() -
permanently
Description copied from interface:RedirectRuleBuilderThe redirection will be permanent (301).This is the default.
- Specified by:
permanentlyin interfaceRedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
-
temporarily
Description copied from interface:RedirectRuleBuilderThe redirection will be temporarily (302).- Specified by:
temporarilyin interfaceRedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
-
to
Description copied from interface:RedirectRuleBuilderThe new path or full URL to redirect to.This ends the creation of the redirection rule and save it to the router.
- Specified by:
toin interfaceRedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
-
to
Description copied from interface:RedirectRuleBuilderWill called the specifiedRedirectHandlerto generate the path to redirect to.This ends the creation of the redirection rule and save it to the router.
- Specified by:
toin interfaceRedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
-
pos
Description copied from interface:RedirectRuleBuilderThe position where the filter will be run.By using a position below
0, the redirection will occures even if a main handler would be found.Defaults to -1000.
- Specified by:
posin interfaceRedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
-
addRedirectHandler
-
throwRedirect
-