Package org.jboss.metadata.web.spec

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


         for (String value : welcomeFiles.getWelcomeFiles())
            context.addWelcomeFile(value);
      }

      // Session timeout
      SessionConfigMetaData scmd = metaData.getSessionConfig();
      if (scmd != null)
      {
         context.setSessionTimeout(scmd.getSessionTimeout());
         if (scmd.getSessionTrackingModes() != null)
         {
            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());
View Full Code Here


        enableStaticResouces(metadata);
        // Add JSPServlet
        enableJsp(metadata);

        // Session config
        final SessionConfigMetaData sessionConfig = new SessionConfigMetaData();
        sessionConfig.setSessionTimeout(30);
        metadata.setSessionConfig(sessionConfig);

        // Mime mappings
        metadata.setMimeMappings(Collections.unmodifiableList(mimeMappings));
View Full Code Here

        Integer maxActiveSessions = metaData.getMaxActiveSessions();
        if (maxActiveSessions != null) {
            this.setMaxActiveAllowed(maxActiveSessions.intValue());
        }
        SessionConfigMetaData config = metaData.getSessionConfig();
        if (config != null) {
            // Convert session timeout (minutes) to max inactive interval (seconds)
            this.setMaxInactiveInterval(config.getSessionTimeout() * 60);
        }
    }
View Full Code Here

            for (String value : welcomeFiles.getWelcomeFiles())
                context.addWelcomeFile(value);
        }

        // Session timeout
        SessionConfigMetaData scmd = metaData.getSessionConfig();
        if (scmd != null) {
            context.setSessionTimeout(scmd.getSessionTimeout());
            if (scmd.getSessionTrackingModes() != null) {
                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());
View Full Code Here

         for (String value : welcomeFiles.getWelcomeFiles())
            context.addWelcomeFile(value);
      }

      // Session timeout
      SessionConfigMetaData scmd = metaData.getSessionConfig();
      if (scmd != null)
      {
         context.setSessionTimeout(scmd.getSessionTimeout());
      }
   }
View Full Code Here

            for (String value : welcomeFiles.getWelcomeFiles())
                context.addWelcomeFile(value);
        }

        // Session timeout
        SessionConfigMetaData scmd = metaData.getSessionConfig();
        if (scmd != null) {
            context.setSessionTimeout(scmd.getSessionTimeout());
            if (scmd.getSessionTrackingModes() != null) {
                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());
View Full Code Here

            for (String value : welcomeFiles.getWelcomeFiles())
                context.addWelcomeFile(value);
        }

        // Session timeout
        SessionConfigMetaData scmd = metaData.getSessionConfig();
        if (scmd != null) {
            context.setSessionTimeout(scmd.getSessionTimeout());
            if (scmd.getSessionTrackingModes() != null) {
                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());
View Full Code Here

        enableStaticResouces(metadata);
        // Add JSPServlet
        enableJsp(metadata);

        // Session config
        final SessionConfigMetaData sessionConfig = new SessionConfigMetaData();
        sessionConfig.setSessionTimeout(30);
        metadata.setSessionConfig(sessionConfig);

        // Mime mappings
        metadata.setMimeMappings(Collections.unmodifiableList(mimeMappings));
View Full Code Here

        final WebMetaData metadata = new WebMetaData();

        metadata.setServlets(new ServletsMetaData());

        // Session config
        final SessionConfigMetaData sessionConfig = new SessionConfigMetaData();
        sessionConfig.setSessionTimeout(30);
        metadata.setSessionConfig(sessionConfig);

        // Mime mappings
        metadata.setMimeMappings(Collections.unmodifiableList(mimeMappings));
View Full Code Here

            if(mergedMetaData.isUseJBossAuthorization()) {
                deploymentInfo.setAuthorizationManager(new JbossAuthorizationManager(deploymentInfo.getAuthorizationManager()));
            }

            SessionConfigMetaData sessionConfig = mergedMetaData.getSessionConfig();
            if(sharedSessionManagerConfig != null && sharedSessionManagerConfig.getSessionConfig() != null) {
                sessionConfig = sharedSessionManagerConfig.getSessionConfig();
            }
            ServletSessionConfig config = null;
            //default session config
            SessionCookieConfig defaultSessionConfig = container.getValue().getSessionCookieConfig();
            if (defaultSessionConfig != null) {
                config = new ServletSessionConfig();
                if (defaultSessionConfig.getName() != null) {
                    config.setName(defaultSessionConfig.getName());
                }
                if (defaultSessionConfig.getDomain() != null) {
                    config.setDomain(defaultSessionConfig.getDomain());
                }
                if (defaultSessionConfig.getHttpOnly() != null) {
                    config.setHttpOnly(defaultSessionConfig.getHttpOnly());
                }
                if (defaultSessionConfig.getSecure() != null) {
                    config.setSecure(defaultSessionConfig.getSecure());
                }
                if (defaultSessionConfig.getMaxAge() != null) {
                    config.setMaxAge(defaultSessionConfig.getMaxAge());
                }
                if (defaultSessionConfig.getComment() != null) {
                    config.setComment(defaultSessionConfig.getComment());
                }
            }

            boolean sessionTimeoutSet = false;
            if (sessionConfig != null) {
                if (sessionConfig.getSessionTimeoutSet()) {
                    deploymentInfo.setDefaultSessionTimeout(sessionConfig.getSessionTimeout() * 60);
                    sessionTimeoutSet = true;
                }
                CookieConfigMetaData cookieConfig = sessionConfig.getCookieConfig();
                if (config == null) {
                    config = new ServletSessionConfig();
                }
                if (cookieConfig != null) {
                    if (cookieConfig.getName() != null) {
                        config.setName(cookieConfig.getName());
                    }
                    if (cookieConfig.getDomain() != null) {
                        config.setDomain(cookieConfig.getDomain());
                    }
                    if (cookieConfig.getComment() != null) {
                        config.setComment(cookieConfig.getComment());
                    }
                    config.setSecure(cookieConfig.getSecure());
                    config.setPath(cookieConfig.getPath());
                    config.setMaxAge(cookieConfig.getMaxAge());
                    config.setHttpOnly(cookieConfig.getHttpOnly());
                }
                List<SessionTrackingModeType> modes = sessionConfig.getSessionTrackingModes();
                if (modes != null && !modes.isEmpty()) {
                    final Set<SessionTrackingMode> trackingModes = new HashSet<>();
                    for (SessionTrackingModeType mode : modes) {
                        switch (mode) {
                            case COOKIE:
View Full Code Here

TOP

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

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.