Examples of SessionManager


Examples of io.undertow.server.session.SessionManager

     * Gets the active session, returning null if one is not present.
     * @param exchange The exchange
     * @return The session
     */
    public static Session getSession(final HttpServerExchange exchange) {
        SessionManager sessionManager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
        SessionConfig sessionConfig = exchange.getAttachment(SessionConfig.ATTACHMENT_KEY);
        if(sessionManager == null) {
            throw UndertowMessages.MESSAGES.sessionManagerNotFound();
        }
        return sessionManager.getSession(exchange, sessionConfig);
    }
View Full Code Here

Examples of io.undertow.server.session.SessionManager

     * Gets the active session, creating a new one if one does not exist
     * @param exchange The exchange
     * @return The session
     */
    public static Session getOrCreateSession(final HttpServerExchange exchange) {
        SessionManager sessionManager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
        SessionConfig sessionConfig = exchange.getAttachment(SessionConfig.ATTACHMENT_KEY);
        if(sessionManager == null) {
            throw UndertowMessages.MESSAGES.sessionManagerNotFound();
        }
        Session session = sessionManager.getSession(exchange, sessionConfig);
        if(session == null) {
            session = sessionManager.createSession(exchange, sessionConfig);
        }
        return session;
    }
View Full Code Here

Examples of io.undertow.server.session.SessionManager

     *
     * @param sessionId The session ID
     * @return The session
     */
    public HttpSessionImpl getSession(final String sessionId) {
        final SessionManager sessionManager = deployment.getSessionManager();
        Session session = sessionManager.getSession(sessionId);
        if (session != null) {
            return HttpSessionImpl.forSession(session, this, false);
        }
        return null;
    }
View Full Code Here

Examples of io.undertow.server.session.SessionManager

        if (httpSession != null && httpSession.isInvalid()) {
            exchange.removeAttachment(sessionAttachmentKey);
            httpSession = null;
        }
        if (httpSession == null) {
            final SessionManager sessionManager = deployment.getSessionManager();
            Session session = sessionManager.getSession(exchange, c);
            if (session != null) {
                httpSession = HttpSessionImpl.forSession(session, this, false);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            } else if (create) {
                final Session newSession = sessionManager.createSession(exchange, c);
                httpSession = HttpSessionImpl.forSession(newSession, this, true);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            }
        }
        return httpSession;
View Full Code Here

Examples of io.undertow.server.session.SessionManager

    private void registerSessionIfRequired(SingleSignOn sso, Session session) {
        if (!sso.contains(session)) {
            sso.add(session);
            session.setAttribute(SSO_SESSION_ATTRIBUTE, sso.getId());
            SessionManager manager = session.getSessionManager();
            if (seenSessionManagers.add(manager)) {
                manager.registerSessionListener(listener);
            }
        }
    }
View Full Code Here

Examples of io.undertow.server.session.SessionManager

     *
     * @param sessionId The session ID
     * @return The session
     */
    public HttpSessionImpl getSession(final String sessionId) {
        final SessionManager sessionManager = deployment.getSessionManager();
        Session session = sessionManager.getSession(sessionId);
        if (session != null) {
            return HttpSessionImpl.forSession(session, this, false);
        }
        return null;
    }
View Full Code Here

Examples of io.undertow.server.session.SessionManager

        if (httpSession != null && httpSession.isInvalid()) {
            exchange.removeAttachment(sessionAttachmentKey);
            httpSession = null;
        }
        if (httpSession == null) {
            final SessionManager sessionManager = deployment.getSessionManager();
            Session session = sessionManager.getSession(exchange, c);
            if (session != null) {
                httpSession = HttpSessionImpl.forSession(session, this, false);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            } else if (create) {
                final Session newSession = sessionManager.createSession(exchange, c);
                httpSession = HttpSessionImpl.forSession(newSession, this, true);
                exchange.putAttachment(sessionAttachmentKey, httpSession);
            }
        }
        return httpSession;
View Full Code Here

Examples of mage.server.SessionManager

        table.initGame(game);
      } catch (GameException ex) {
        logger.log(Level.SEVERE, null, ex);
      }
      GameManager.getInstance().createGameSession(game, sessionPlayerMap, table.getId());
      SessionManager sessionManager = SessionManager.getInstance();
      for (Entry<UUID, UUID> entry: sessionPlayerMap.entrySet()) {
        sessionManager.getSession(entry.getKey()).gameStarted(game.getId(), entry.getValue());
      }
    }
  }
View Full Code Here

Examples of net.rim.tumbler.session.SessionManager

                // nothing to package
                return NO_ERROR_RETURN_CODE;
            }

            // create SessionManager
            SessionManager sessionManager = cmd.createSession();

            // create bbwp.properties
            Logger.logMessage( LogType.INFO, "PROGRESS_SESSION_BBWP_PROPERTIES" );
            String propertiesFile = sessionManager.getBBWPJarFolder() + WidgetPackager.PROPERTIES_FILE;
            BBWPProperties bbwpProperties = new BBWPProperties( propertiesFile, sessionManager.getSessionHome() );

            // validate BlackBerry WebWorks application archive
            Logger.logMessage( LogType.INFO, "PROGRESS_VALIDATING_WIDGET_ARCHIVE" );
            WidgetArchive wa = new WidgetArchive( sessionManager.getWidgetArchive() );
            wa.validate();

            // parse/validate config.xml
            Logger.logMessage( LogType.INFO, "PROGRESS_SESSION_CONFIGXML" );
            XMLParser xmlparser = new ConfigXMLParser();
            WidgetConfig config = xmlparser.parseXML( wa ); // raw data, without \

            // create/clean outputs/source
            // Logger.printInfoMessage("BlackBerry WebWorks application packaging starts...");
            FileManager fileManager = new FileManager( bbwpProperties, config.getAccessTable() );
            Logger.logMessage( LogType.INFO, "PROGRESS_FILE_POPULATING_SOURCE" );
            fileManager.prepare();

            // Set 3rd party extension classes
            config.setExtensionClasses( fileManager.getExtensionClasses() );
            config.setExtensionJSFiles( fileManager.getExtensionJSFiles() );
            config.setSharedGlobalJSFiles( fileManager.getSharedGlobalJSFiles() );

            // create autogen file
            WidgetConfigSerializer wcs = new WidgetConfig_v1Serializer( config );
            byte[] autogenFile = wcs.serialize();
            fileManager.writeToSource( autogenFile, AUTOGEN_FILE );

            // create jdw/jdp files
            fileManager.generateProjectFiles( sessionManager.getSourceFolder(), sessionManager.getArchiveName(),
                    config.getName(), config.getVersion(), config.getAuthor(), config.getContent(), config.getBackgroundSource(),
                    config.isStartupEnabled(), config.getIconSrc(), config.getHoverIconSrc(), fileManager.getFiles(),
                    bbwpProperties.getImports() );

            // run rapc
            Logger.logMessage( LogType.INFO, "PROGRESS_COMPILING" );
            Rapc rapc = new Rapc( bbwpProperties, config, fileManager.getCompiledJARDependencies() );
            if( !rapc.run( fileManager.getFiles() ) ) {
                throw new PackageException( "EXCEPTION_RAPC" );
            }

            // generate ALX
            generateAlxFile( config );

            // Sign the cod if required
            if( sessionManager.requireSigning() ) {
                Logger.logMessage( LogType.INFO, "PROGRESS_SIGNING" );
                signCod( sessionManager );
                Logger.logMessage( LogType.INFO, "PROGRESS_SIGNING_COMPLETE" );
            }

            // If requires source and a safe source folder is used, copy source to where the user expects it to be
            if( sessionManager.requireSource()
                    && !sessionManager.getOriginalSourceFolder().equals( sessionManager.getSourceFolder() ) ) {
                File f = new File( SessionManager.getInstance().getOriginalSourceFolder() );
                if( !f.exists() ) {
                    if( f.mkdirs() == false ) {
                        Logger.logMessage( LogType.WARNING, "EXCEPTION_MAKING_DIRECTORY" );
                    }
                }

                ExecUtil.exec(
                        null,
                        new String[] { "cp", "-R", sessionManager.getSourceFolder() + "/",
                                sessionManager.getOriginalSourceFolder() }, null );
            }

            // clean/prep output folders
            fileManager.cleanOutput();

            // copy output files
            Logger.logMessage( LogType.INFO, "PROGRESS_GEN_OUTPUT" );
            fileManager.copyOutputsFromSource();

            // clean source (if necessary)
            if( !sessionManager.requireSource() ) {
                fileManager.cleanSource();
            }

            Logger.logMessage( LogType.INFO, "PROGRESS_COMPLETE" );
        } catch( CommandLineException cle ) {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.SessionManager

          _session.getAlias().getSchemaProperties();
      SchemaLoadInfo[] schemaLoadInfos =
          schemaProps.getSchemaLoadInfos(_schemaPropsCacheIsBasedOn,
                                         _tabelTableTypesCacheable,
                                         _viewTableTypesCacheable);
      SessionManager sessionMgr = _session.getApplication().getSessionManager();
      boolean allSchemasAllowed = sessionMgr.areAllSchemasAllowed(_session);
     
      if(   1 == schemaLoadInfos.length
         && null == schemaLoadInfos[0].schemaName
         && false == allSchemasAllowed)
      {
         if(false == allSchemasAllowed)
         {
            String[] allowedSchemas = sessionMgr.getAllowedSchemas(_session);

            ArrayList<SchemaLoadInfo> ret = new ArrayList<SchemaLoadInfo>();

            for (int i = 0; i < allowedSchemas.length; i++)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.