public class RedirectRuleBuilderDefault<R extends RequestContext<?>,W extends WebsocketContext<?>> extends Object implements RedirectRuleBuilder<R,W>
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
RedirectRuleBuilderDefault(Router<R,W> router,
String oldPath,
SpincastRouterConfig spincastRouterConfig,
SpincastRoutingUtils spincastRoutingUtils) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRedirectHandler(Handler<R> handler) |
protected String |
getOldPath() |
protected Router<R,W> |
getRouter() |
protected SpincastRouterConfig |
getSpincastRouterConfig() |
protected SpincastRoutingUtils |
getSpincastRoutingUtils() |
protected boolean |
isPermanently() |
RedirectRuleBuilder<R,W> |
permanently()
The redirection will be permanent (301).
|
RedirectRuleBuilder<R,W> |
temporarily()
The redirection will be temporarily (302).
|
protected void |
throwRedirect(R context,
String newPathOrFullUrl) |
void |
to(RedirectHandler<R,W> handler)
Will called the specified
RedirectHandler
to generate the path to redirect to. |
void |
to(String newPathOrFullUrl)
The new path or full URL to redirect to.
|
public RedirectRuleBuilderDefault(Router<R,W> router, String oldPath, SpincastRouterConfig spincastRouterConfig, SpincastRoutingUtils spincastRoutingUtils)
protected String getOldPath()
protected SpincastRouterConfig getSpincastRouterConfig()
protected SpincastRoutingUtils getSpincastRoutingUtils()
protected boolean isPermanently()
public RedirectRuleBuilder<R,W> permanently()
RedirectRuleBuilderThis is the default.
permanently in interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>public RedirectRuleBuilder<R,W> temporarily()
RedirectRuleBuildertemporarily in interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>public void to(String newPathOrFullUrl)
RedirectRuleBuilderThis ends the creation of the redirection rule and save it to the router.
to in interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>public void to(RedirectHandler<R,W> handler)
RedirectRuleBuilderRedirectHandler
to generate the path to redirect to.
This ends the creation of the redirection rule and save it to the router.
to in interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>Copyright © 2019. All rights reserved.