• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EventFactorySupport类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.webflow.action.EventFactorySupport的典型用法代码示例。如果您正苦于以下问题:Java EventFactorySupport类的具体用法?Java EventFactorySupport怎么用?Java EventFactorySupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventFactorySupport类属于org.springframework.webflow.action包,在下文中一共展示了EventFactorySupport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ensureRemoteIpShouldBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("192.158.5.781");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例2: ensureRemoteIpShouldNotBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldNotBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("193.158.5.781");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertNotEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例3: ensureAltRemoteIpHeaderShouldBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureAltRemoteIpHeaderShouldBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^74\\.125\\..+", "alternateRemoteIp");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("555.555.555.555");
    req.addHeader("alternateRemoteIp", "74.125.136.102");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例4: ensureHostnameShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameShouldDoSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("74.125.136.102");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());

}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例5: ensureHostnameAndIpShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameAndIpShouldDoSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");
    action.setIpsToCheckPattern("74\\..+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("74.125.136.102");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());

}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例6: verifyIpMismatchWhenCheckingHostnameForSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void verifyIpMismatchWhenCheckingHostnameForSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");
    action.setIpsToCheckPattern("14\\..+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("74.125.136.102");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().no(this).getId());

}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java


示例7: ensureLdapAttributeShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureLdapAttributeShouldDoSpnego() {
    final LdapSpnegoKnownClientSystemsFilterAction action =
            new LdapSpnegoKnownClientSystemsFilterAction(this.connectionFactory, this.searchRequest, "mail") {
                @Override
                protected String getRemoteHostName(final String remoteIp) {
                    if ("localhost".equalsIgnoreCase(remoteIp) || remoteIp.startsWith("127")) {
                        return remoteIp;
                    }
                    return super.getRemoteHostName(remoteIp);
                }
            };
    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("localhost");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:24,代码来源:LdapSpnegoKnownClientSystemsFilterActionTests.java


示例8: ensureLdapAttributeShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureLdapAttributeShouldDoSpnego() {
    final LdapSpnegoKnownClientSystemsFilterAction action =
            new LdapSpnegoKnownClientSystemsFilterAction(this.connectionFactory,
            this.searchRequest, "mail");
    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("localhost");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:LdapSpnegoKnownClientSystemsFilterActionTests.java


示例9: doExecute

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
    final RequestContext context = RequestContextHolder.getRequestContext();
    final String uid = WebUtils.getAuthentication(context).getPrincipal().getId();

    final String secretKey = repository.getSecret(uid);
    if (StringUtils.isBlank(secretKey)) {
        final OneTimeTokenAccount keyAccount = this.repository.create(uid);
        final String keyUri = "otpauth://totp/" + this.label + ':' + uid + "?secret=" + keyAccount.getSecretKey() + "&issuer=" + this.issuer;
        requestContext.getFlowScope().put("key", keyAccount);
        requestContext.getFlowScope().put("keyUri", keyUri);
        LOGGER.debug("Registration key URI is [{}]", keyUri);
        return new EventFactorySupport().event(this, "register");
    }
    return success();
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:17,代码来源:OneTimeTokenAccountCheckRegistrationAction.java


示例10: doExecute

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
    try {
        final UsernamePasswordCredential c = (UsernamePasswordCredential) WebUtils.getCredential(requestContext);
        final PasswordChangeBean bean = requestContext.getFlowScope()
                .get(PasswordManagementWebflowConfigurer.FLOW_VAR_ID_PASSWORD, PasswordChangeBean.class);
        if (passwordManagementService.change(c, bean)) {
            return new EventFactorySupport().event(this, PASSWORD_UPDATE_SUCCESS);
        }
    } catch (final Exception e) {
        LOGGER.error(e.getMessage(), e);
    }
    requestContext.getMessageContext().addMessage(new MessageBuilder().error().code("pm.updateFailure").
            defaultText("Could not update the account password").build());
    return error();
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:17,代码来源:PasswordChangeAction.java


示例11: ensureRemoteIpShouldBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+", "", 0);

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("192.158.5.781");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例12: ensureRemoteIpShouldNotBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldNotBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+", "", 0);

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("193.158.5.781");
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertNotEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例13: ensureAltRemoteIpHeaderShouldBeChecked

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureAltRemoteIpHeaderShouldBeChecked() {
    final BaseSpnegoKnownClientSystemsFilterAction action =
            new BaseSpnegoKnownClientSystemsFilterAction("^74\\.125\\..+", "alternateRemoteIp", 120);

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr("555.555.555.555");
    req.addHeader("alternateRemoteIp", ALTERNATE_REMOTE_IP);
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例14: ensureHostnameShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameShouldDoSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("", "", 0, "\\w+\\.\\w+\\.\\w+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr(ALTERNATE_REMOTE_IP);
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());

}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例15: ensureHostnameAndIpShouldDoSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameAndIpShouldDoSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("74\\..+", "", 0, "\\w+\\.\\w+\\.\\w+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr(ALTERNATE_REMOTE_IP);
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());

}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例16: verifyIpMismatchWhenCheckingHostnameForSpnego

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void verifyIpMismatchWhenCheckingHostnameForSpnego() {
    final HostNameSpnegoKnownClientSystemsFilterAction action =
            new HostNameSpnegoKnownClientSystemsFilterAction("14\\..+", "", 0, "\\w+\\.\\w+\\.\\w+");

    final MockRequestContext ctx = new MockRequestContext();
    final MockHttpServletRequest req = new MockHttpServletRequest();
    req.setRemoteAddr(ALTERNATE_REMOTE_IP);
    final ServletExternalContext extCtx = new ServletExternalContext(
            new MockServletContext(), req,
            new MockHttpServletResponse());
    ctx.setExternalContext(extCtx);

    final Event ev = action.doExecute(ctx);
    assertEquals(ev.getId(), new EventFactorySupport().no(this).getId());

}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTests.java


示例17: handleAuthenticationTransactionAndGrantTicketGrantingTicket

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
/**
 * Handle authentication transaction and grant ticket granting ticket.
 *
 * @param context the context
 * @return the set
 */
protected Set<Event> handleAuthenticationTransactionAndGrantTicketGrantingTicket(final RequestContext context) {
    try {
        final Credential credential = getCredentialFromContext(context);
        AuthenticationResultBuilder builder = WebUtils.getAuthenticationResultBuilder(context);

        LOGGER.debug("Handling authentication transaction for credential [{}]", credential);
        final Service service = WebUtils.getService(context);
        builder = this.authenticationSystemSupport.handleAuthenticationTransaction(service, builder, credential);

        LOGGER.debug("Issuing ticket-granting tickets for service [{}]", service);
        return Collections.singleton(grantTicketGrantingTicketToAuthenticationResult(context, builder, service));
    } catch (final Exception e) {
        LOGGER.error(e.getMessage(), e);
        final MessageContext messageContext = context.getMessageContext();
        messageContext.addMessage(new MessageBuilder().error()
                .code(DEFAULT_MESSAGE_BUNDLE_PREFIX.concat(e.getClass().getSimpleName())).build());
        return Collections.singleton(new EventFactorySupport().error(this));
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:26,代码来源:AbstractCasWebflowEventResolver.java


示例18: doExecute

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
public Event doExecute(final RequestContext requestContext) throws Exception {
    final Integer code = Integer.valueOf(RandomStringUtils.randomNumeric(8));
    final AzureAuthenticatorTokenCredential c = new AzureAuthenticatorTokenCredential();
    c.setToken(code.toString());
    WebUtils.putCredential(requestContext, c);
    requestContext.getFlowScope().put("azureToken", code);

    if (mode == MultifactorAuthenticationProperties.Azure.AuthenticationModes.POUND) {
        return new EventFactorySupport().event(this, "authenticate");
    }
    return success();
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:14,代码来源:AzureAuthenticatorGenerateTokenAction.java


示例19: doExecute

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
    final String consentEvent = determineConsentEvent(requestContext);
    if (StringUtils.isBlank(consentEvent)) {
        return null;
    }
    prepareConsentForRequestContext(requestContext);
    return new EventFactorySupport().event(this, consentEvent);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:10,代码来源:CheckConsentRequiredAction.java


示例20: doInternalExecute

import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doInternalExecute(final HttpServletRequest request, final HttpServletResponse response,
                                  final RequestContext context) throws Exception {

    final List<LogoutRequest> logoutRequests = WebUtils.getLogoutRequests(context);
    final Map<LogoutRequest, LogoutHttpMessage> logoutUrls = new HashMap<>();

    if (logoutRequests != null) {
        logoutRequests.stream()
                .filter(r -> r.getStatus() == LogoutRequestStatus.NOT_ATTEMPTED)
                .forEach(r -> {
                    LOGGER.debug("Using logout url [{}] for front-channel logout requests", r.getLogoutUrl().toExternalForm());
                    final String logoutMessage = this.logoutManager.createFrontChannelLogoutMessage(r);
                    LOGGER.debug("Front-channel logout message to send is [{}]", logoutMessage);
                    final LogoutHttpMessage msg = new LogoutHttpMessage(r.getLogoutUrl(), logoutMessage, true);
                    logoutUrls.put(r, msg);
                    r.setStatus(LogoutRequestStatus.SUCCESS);
                    r.getService().setLoggedOutAlready(true);
                });
        
        if (!logoutUrls.isEmpty()) {
            context.getFlowScope().put("logoutUrls", logoutUrls);
            return new EventFactorySupport().event(this, "propagate");
        }
    }
    return new EventFactorySupport().event(this, FINISH_EVENT);
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:28,代码来源:FrontChannelLogoutAction.java



注:本文中的org.springframework.webflow.action.EventFactorySupport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RoboDialogFragment类代码示例发布时间:2022-05-22
下一篇:
Java StorageErrorReporter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap