Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.CookieConfigMetaData


                for (SessionTrackingModeType stmt : scmd.getSessionTrackingModes()) {
                    context.addSessionTrackingMode(stmt.toString());
                }
            }
            if (scmd.getCookieConfig() != null) {
                CookieConfigMetaData value = scmd.getCookieConfig();
                org.apache.catalina.deploy.SessionCookie cookieConfig = new org.apache.catalina.deploy.SessionCookie();
                cookieConfig.setName(value.getName());
                cookieConfig.setDomain(value.getDomain());
                cookieConfig.setPath(value.getPath());
                cookieConfig.setComment(value.getComment());
                cookieConfig.setHttpOnly(value.getHttpOnly());
                cookieConfig.setSecure(value.getSecure());
                cookieConfig.setMaxAge(value.getMaxAge());
                context.setSessionCookie(cookieConfig);
            }
        }
    }
View Full Code Here


                for (SessionTrackingModeType stmt : scmd.getSessionTrackingModes()) {
                    context.addSessionTrackingMode(stmt.toString());
                }
            }
            if (scmd.getCookieConfig() != null) {
                CookieConfigMetaData value = scmd.getCookieConfig();
                org.apache.catalina.deploy.SessionCookie cookieConfig = new org.apache.catalina.deploy.SessionCookie();
                cookieConfig.setName(value.getName());
                cookieConfig.setDomain(value.getDomain());
                cookieConfig.setPath(value.getPath());
                cookieConfig.setComment(value.getComment());
                cookieConfig.setHttpOnly(value.getHttpOnly());
                cookieConfig.setSecure(value.getSecure());
                cookieConfig.setMaxAge(value.getMaxAge());
                context.setSessionCookie(cookieConfig);
            }
        }
    }
View Full Code Here

        SessionConfigMetaData sessionConfig = sharedWebMetaData.getSessionConfig();
        if (sessionConfig == null) {
            sessionConfig = new SessionConfigMetaData();
            warMetaData.getWebMetaData().setSessionConfig(sessionConfig);
        }
        CookieConfigMetaData cookieConfig = sessionConfig.getCookieConfig();
        if (cookieConfig == null) {
            cookieConfig = new CookieConfigMetaData();
            sessionConfig.setCookieConfig(cookieConfig);
        }
        cookieConfig.setPath("/");
    }
View Full Code Here

                for (SessionTrackingModeType stmt : scmd.getSessionTrackingModes()) {
                    context.addSessionTrackingMode(stmt.toString());
                }
            }
            if (scmd.getCookieConfig() != null) {
                CookieConfigMetaData value = scmd.getCookieConfig();
                org.apache.catalina.deploy.SessionCookie cookieConfig = new org.apache.catalina.deploy.SessionCookie();
                cookieConfig.setName(value.getName());
                cookieConfig.setDomain(value.getDomain());
                cookieConfig.setPath(value.getPath());
                cookieConfig.setComment(value.getComment());
                cookieConfig.setHttpOnly(value.getHttpOnly());
                cookieConfig.setSecure(value.getSecure());
                cookieConfig.setMaxAge(value.getMaxAge());
                context.setSessionCookie(cookieConfig);
            }
        }
    }
View Full Code Here

                for (SessionTrackingModeType stmt : scmd.getSessionTrackingModes()) {
                    context.addSessionTrackingMode(stmt.toString());
                }
            }
            if (scmd.getCookieConfig() != null) {
                CookieConfigMetaData value = scmd.getCookieConfig();
                org.apache.catalina.deploy.SessionCookie cookieConfig = new org.apache.catalina.deploy.SessionCookie();
                cookieConfig.setName(value.getName());
                cookieConfig.setDomain(value.getDomain());
                cookieConfig.setPath(value.getPath());
                cookieConfig.setComment(value.getComment());
                cookieConfig.setHttpOnly(value.getHttpOnly());
                cookieConfig.setSecure(value.getSecure());
                cookieConfig.setMaxAge(value.getMaxAge());
                context.setSessionCookie(cookieConfig);
            }
        }
    }
View Full Code Here

* @author Remy Maucherat
*/
public class CookieConfigMetaDataParser extends MetaDataElementParser {

    public static CookieConfigMetaData parse(XMLStreamReader reader) throws XMLStreamException {
        CookieConfigMetaData cookieConfig = new CookieConfigMetaData();

        // Handle attributes
        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i ++) {
            final String value = reader.getAttributeValue(i);
            if (reader.getAttributeNamespace(i) != null) {
                continue;
            }
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case ID: {
                    cookieConfig.setId(value);
                    break;
                }
                default: throw unexpectedAttribute(reader, i);
            }
        }

        // Handle elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case NAME:
                    cookieConfig.setName(reader.getElementText());
                    break;
                case DOMAIN:
                    cookieConfig.setDomain(reader.getElementText());
                    break;
                case PATH:
                    cookieConfig.setPath(reader.getElementText());
                    break;
                case COMMENT:
                    cookieConfig.setComment(reader.getElementText());
                    break;
                case HTTP_ONLY:
                    if (Boolean.TRUE.equals(Boolean.valueOf(reader.getElementText()))) {
                        cookieConfig.setHttpOnly(true);
                    } else {
                        cookieConfig.setHttpOnly(false);
                    }
                    break;
                case SECURE:
                    if (Boolean.TRUE.equals(Boolean.valueOf(reader.getElementText()))) {
                        cookieConfig.setSecure(true);
                    } else {
                        cookieConfig.setSecure(false);
                    }
                    break;
                case MAX_AGE:
                    try {
                        cookieConfig.setMaxAge(Integer.valueOf(reader.getElementText()));
                    } catch (NumberFormatException e) {
                        throw unexpectedValue(reader, e);
                    }
                    break;
                 default: throw unexpectedElement(reader);
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.CookieConfigMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.