Tabnine Logo
GlobalConfig.getUserSessionLogEnabled
Code IndexAdd Tabnine to your IDE (free)

How to use
getUserSessionLogEnabled
method
in
com.haulmont.cuba.core.global.GlobalConfig

Best Java code snippets using com.haulmont.cuba.core.global.GlobalConfig.getUserSessionLogEnabled (Showing top 4 results out of 315)

origin: com.haulmont.cuba/cuba-core

  protected boolean shouldLogSession(UserSession userSession) {
    return globalConfig.getUserSessionLogEnabled() && !userSession.isSystem();
  }
}
origin: com.haulmont.cuba/cuba-gui

@Override
public void init(Map<String, Object> params) {
  enableBtn.setCaption(globalConfig.getUserSessionLogEnabled() ?
      getMessage("disableLogging") : getMessage("enableLogging"));
}
origin: com.haulmont.cuba/cuba-core

/**
 * Set <code>finishedTs</code> to all sessions that were interrupted by server reboot
 */
protected void closeDeadSessionsOnStartup() {
  if (!globalConfig.getUserSessionLogEnabled()) {
    return;
  }
  if (clusterManager.isMaster()) {
    authentication.withSystemUser(() -> {
      LoadContext<SessionLogEntry> lc = LoadContext.create(SessionLogEntry.class).setView(SessionLogEntry.DEFAULT_VIEW)
          .setQuery(createQuery("select e from sec$SessionLogEntry e where e.finishedTs is null"));
      List<SessionLogEntry> sessionLogEntries = dataManager.loadList(lc);
      CommitContext cc = new CommitContext();
      Set<UUID> activeSessionsIds = userSessionsAPI.getUserSessionsStream()
          .map(UserSession::getId)
          .collect(Collectors.toSet());
      for (SessionLogEntry entry : sessionLogEntries) {
        if (activeSessionsIds.contains(entry.getSessionId())) {
          continue;   // do not touch active session records
        }
        entry.setFinishedTs(timeSource.currentTimestamp());
        entry.setLastAction(SessionAction.EXPIRATION);
        cc.addInstanceToCommit(entry);
      }
      dataManager.commit(cc);
      log.info("Dead session records have been closed");
      return null;
    });
  }
}
origin: com.haulmont.cuba/cuba-gui

  public void enableLogging() {
    if (globalConfig.getUserSessionLogEnabled()) {
      showOptionDialog(getMessage("dialogs.Confirmation"), getMessage("confirmDisable"), MessageType.CONFIRMATION,
          new Action[] {
              new DialogAction(DialogAction.Type.YES, true).withHandler(actionPerformedEvent -> {
                globalConfig.setUserSessionLogEnabled(false);
                enableBtn.setCaption(getMessage("enableLogging"));
              }),
              new DialogAction(DialogAction.Type.NO)
          });
    } else {
      globalConfig.setUserSessionLogEnabled(true);
      enableBtn.setCaption(getMessage("disableLogging"));
    }
  }
}
com.haulmont.cuba.core.globalGlobalConfiggetUserSessionLogEnabled

Popular methods of GlobalConfig

  • getAvailableLocales
    Supported locales. List of locales is shown on user login.
  • getConfDir
  • getWebHostName
  • getWebPort
  • getWebAppUrl
  • getWebContextName
  • getLocaleSelectVisible
    Show locale select in LoginWindow.
  • getTempDir
  • getAllowQueryFromSelected
  • getDataDir
  • getHealthCheckResponse
  • getNumberIdCacheSize
  • getHealthCheckResponse,
  • getNumberIdCacheSize,
  • getRestRequiresSecurityToken,
  • getTestMode,
  • getAnonymousSessionId,
  • getAppFolderEditWindowClassName,
  • getCubaClasspathDirectories,
  • getDeepCopyNonPersistentReferences,
  • getDisableEscapingLikeForDataStores

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Runner (org.openjdk.jmh.runner)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now