ServerAuthSession Implementation methods ---------------------------------
188593
@Override
  public void sendAuthAnswer(AppAnswerEvent appAnswerEvent) throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
    send(null, appAnswerEvent);
  }
1040355
@Override
  public IRxSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientRxSession.class)) {
      ClientRxSessionDataLocalImpl data = new ClientRxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerRxSession.class)) {
      ServerRxSessionDataLocalImpl data = new ServerRxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
993914
function(serverName, config, options) {
    this.methods[serverName] = {};
    this.config.servers[serverName] = config;
    var self = this;
    ['valid_grant', 'treat_access_token', 'transform_token_response'].forEach(function(fctName) {
      self.methods[serverName][fctName] = options[fctName] || self[fctName].bind(self);
    });
  }
1186632
JmsSessionImpl instantiateSession(boolean transacted, int acknowledgeMode, SICoreConnection coreConnection, JmsJcaSession jcaSession) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateSession", new Object[]{transacted, acknowledgeMode, coreConnection, jcaSession});
    JmsQueueSessionImpl jmsQueueSession = new JmsQueueSessionImpl(transacted, acknowledgeMode, coreConnection, this, jcaSession);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "instantiateSession",  jmsQueueSession);
    return jmsQueueSession;
  }
699877
@Override
    public void sessionCreated(HttpSessionEvent event) {

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "HttpSession created: HttpSession ID: " + event.getSession().getId());
        }
        // nothing to do here, since later the code will add the session id to a map 

    }
1296800
void injectSession(Class<?>[] parameterTypes, List<Object> arguments, T session) {
		if (parameterTypes != null) {
			int i = 0;
			for (Class<?> parameterType : parameterTypes) {
				if (parameterType.isInstance(session)) {
					arguments.set(i, session);
					break;
				}
				i++;
			}
		}
	}
1088586
private function initSessionConfig():void
    {
        if (!defined("IUMIO_ENV")) {
            throw new Server500(new \ArrayObject(array("explain" => "Framework Environment is not defined",
                "solution" => "Please initialize the framework environment")));
        }
        if (false === Server::exist(IUMIO_ROOT."/elements/cache/".strtolower(IUMIO_ENV)."/sessions")) {
            Server::create(IUMIO_ROOT."/elements/cache/".
                strtolower(IUMIO_ENV)."/sessions", "directory");
        }

        $this->id = session_id();
        $this->name = session_name();
        if (!$this->isStarted()) {
            session_save_path(IUMIO_ROOT . '/elements/cache/' . strtolower(IUMIO_ENV) . '/sessions');
            ini_set('session.gc_probability', 1);
        }
    }
201615
@Override
    public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
        connectionLock.readLock().lock();
        try {
            ManagedSession managedSession = new ManagedSession(
                    getConnection().createSession(transacted, acknowledgeMode),
                    transacted,
                    acknowledgeMode,
                    connectionDefinition.isJeeMode(),
                    this);
            sessions.add(managedSession);
            return managedSession;
        } finally {
            connectionLock.readLock().unlock();
        }
    }
518657
@Override
  public IAccSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientAccSession.class)) {
      ClientAccSessionDataLocalImpl data = new ClientAccSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerAccSession.class)) {
      ServerAccSessionDataLocalImpl data = new ServerAccSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
334267
@Override
  @SuppressWarnings("unchecked")
  public void sessionTimerCanceled(ServerRfSession appSession, ScheduledFuture timer) throws InternalException {
    logger.info("sessionTimerCanceled :: appSession[" + appSession + "]");
  }
778607
@Override
    public Session connectToServer(Endpoint endpoint, ClientEndpointConfig endpointConfig, URI path) throws DeploymentException, IOException {

        if (endpoint == null || path == null) {
            throw new IllegalArgumentException();
        }
        ClientConnector x = new ClientConnector();
        return x.connectClass(endpoint, path, endpointConfig, this);
    }
472770
void registerSessionIfNeeded(HttpSession session) {
		if (session != null) {
			synchronized (session) {
				if (!SESSION_MAP_BY_ID.containsKey(session.getId())) {
					sessionCreated(new HttpSessionEvent(session));
				}
			}
		}
	}
572911
@Override
  public IS6aSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientS6aSession.class)) {
      ClientS6aSessionDataLocalImpl data = new ClientS6aSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerS6aSession.class)) {
      ServerS6aSessionDataLocalImpl data = new ServerS6aSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else {
      throw new IllegalArgumentException("Invalid Session Class: " + clazz.toString());
    }
  }
1085534
public function initOauth2Server()
    {
        if ($this->serverInitialized) {
            return;
        }

        $this->serverInitialized = true;
        $this->modelMap = array_merge($this->defaultModelMap, $this->modelMap);
        $this->storageMap = array_merge($this->defaultStorageMap, $this->storageMap);
        foreach ($this->modelMap as $name => $definition) {
            Yii::$container->set(models::class . '\\' . $name, $definition);
        }

        foreach ($this->storageMap as $name => $definition) {
            Yii::$container->set($name, $definition);
        }

        $storages = [];
        foreach(array_keys($this->storageMap) as $name) {
            $storages[$name] = Yii::$container->get($name);
        }

        $grantTypes = [];
        foreach($this->grantTypes as $name => $options) {
            if(!isset($storages[$name]) || empty($options['class'])) {
                throw new InvalidConfigException(
                    'Invalid grant types configuration.'
                );
            }

            $class = $options['class'];
            unset($options['class']);

            $reflection = new ReflectionClass($class);
            $config = array_merge([0 => $storages[$name]], [$options]);

            $instance = $reflection->newInstanceArgs($config);
            $grantTypes[$name] = $instance;
        }

        $this->set('server', Yii::$container->get(Server::class, [
            $this,
            $storages,
            [
                'token_param_name' => $this->tokenParamName,
                'access_lifetime' => $this->tokenAccessLifetime,
            ],
            $grantTypes
        ]));
        $this->set('request', Request::createFromGlobals());
        $this->set('response', new Response());
    }
361853
public void sessionCheck(HttpServletRequest req) {
        String authHeader = req.getHeader("Authorization");
        if (authHeader != null && this.validationSessionCheck(authHeader)) {
            return;
        }

        if (req.getCookies() != null) {
            Cookie cookie = Arrays.stream(req.getCookies()).filter(ck -> ck.getName().equals("AuthToken")).findFirst().orElse(null);
            if (cookie != null && this.validationSessionCheck(cookie.getValue())) {
                return;
            }
        }

        if ( req.getParameter("token") != null){
            String token = req.getParameter("token");
            if(this.validationSessionCheck(token)){
                return;
            }
        }

        throw new ValidationLibException("UnAuthorization", HttpStatus.UNAUTHORIZED);
    }
774933
@Override
  public void doAbortSessionAnswerEvent(ServerAuthSession appSession, AbortSessionAnswer asa)
      throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
    logger.info("Diameter Gq AuthorizationSessionFactory :: doAbortSessionAnswerEvent :: appSession[{}], ASA[{}]", appSession, asa);
  }
977986
@Override
  public ICCASessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientCCASession.class)) {
      ClientCCASessionDataLocalImpl data = new ClientCCASessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerCCASession.class)) {
      ServerCCASessionDataLocalImpl data = new ServerCCASessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }