当前位置: 首页>>代码示例>>Java>>正文


Java Cookie.getValue方法代码示例

本文整理汇总了Java中io.undertow.server.handlers.Cookie.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Cookie.getValue方法的具体用法?Java Cookie.getValue怎么用?Java Cookie.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.undertow.server.handlers.Cookie的用法示例。


在下文中一共展示了Cookie.getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readAttribute

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
@Override
public String readAttribute(final HttpServerExchange exchange) {
    Cookie cookie = exchange.getRequestCookies().get(cookieName);
    if (cookie == null) {
        return null;
    }
    return cookie.getValue();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:CookieAttribute.java

示例2: findSessionId

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
@Override
public String findSessionId(final HttpServerExchange exchange) {
    Map<String, Cookie> cookies = exchange.getRequestCookies();
    if (cookies != null) {
        Cookie sessionId = cookies.get(cookieName);
        if (sessionId != null) {
            return sessionId.getValue();
        }
    }
    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SessionCookieConfig.java

示例3: wrap

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
@Override
public StreamSinkConduit wrap(ConduitFactory<StreamSinkConduit> factory, HttpServerExchange exchange) {

    Cookie sessionId = exchange.getResponseCookies().get(sessionCookieName);
    if (sessionId != null) {
        StringBuilder sb = new StringBuilder(sessionId.getValue());
        sb.append('.');
        sb.append(jvmRoute);
        sessionId.setValue(sb.toString());
    }
    return factory.create();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:JvmRouteHandler.java

示例4: getCurrentSessionId

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
private String getCurrentSessionId(HttpServerExchange exchange) {
	if (exchange == null && ServletRequestContext.current() != null) {
		exchange = ServletRequestContext.current().getExchange();
	}
	if (exchange == null) return null;
	Cookie sessionCookie = exchange.getRequestCookies().get("JSESSIONID");
	if (sessionCookie == null) return null;
	return sessionCookie.getValue();
}
 
开发者ID:openanalytics,项目名称:shinyproxy,代码行数:10,代码来源:DockerService.java

示例5: getCookieValue

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
/**
 * Retrieves the value of a cookie with a given name from a HttpServerExchange
 * 
 * @param exchange The exchange containing the cookie
 * @param cookieName The name of the cookie
 * 
 * @return The value of the cookie or null if none found
 */
private String getCookieValue(HttpServerExchange exchange, String cookieName) {
    String value = null;
    final Cookie cookie = exchange.getRequestCookies().get(cookieName);
    if (cookie != null) {
        value = cookie.getValue();
    }

    return value;
}
 
开发者ID:svenkubiak,项目名称:mangooio,代码行数:18,代码来源:InboundCookiesHandler.java

示例6: authenticate

import io.undertow.server.handlers.Cookie; //导入方法依赖的package包/类
@Override
public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext securityContext) {
    Cookie cookie = exchange.getRequestCookies().get(cookieName);
    if (cookie != null) {
        final String ssoId = cookie.getValue();
        try (SingleSignOn sso = this.manager.findSingleSignOn(ssoId)) {
            if (sso != null) {
                Account verified = securityContext.getIdentityManager().verify(sso.getAccount());
                if (verified == null) {
                    //we return not attempted here to allow other mechanisms to proceed as normal
                    return AuthenticationMechanismOutcome.NOT_ATTEMPTED;
                }
                final Session session = getSession(exchange);
                registerSessionIfRequired(sso, session);
                securityContext.authenticationComplete(verified, sso.getMechanismName(), false);
                securityContext.registerNotificationReceiver(new NotificationReceiver() {
                    @Override
                    public void handleNotification(SecurityNotification notification) {
                        if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) {
                            manager.removeSingleSignOn(ssoId);
                        }
                    }
                });
                return AuthenticationMechanismOutcome.AUTHENTICATED;
            }
        }
        clearSsoCookie(exchange);
    }
    exchange.addResponseWrapper(responseListener);
    return AuthenticationMechanismOutcome.NOT_ATTEMPTED;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:SingleSignOnAuthenticationMechanism.java


注:本文中的io.undertow.server.handlers.Cookie.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。