コード例 #1
0
ファイル: CGUI.java プロジェクト: schdomin/zep
  // ds MySQL logger
  private final void _logMaster(final String p_strInfo) {
    // ds get username and session id
    final String strUsername = m_cLearner.getUsername();
    final int iSessionID = m_cLearner.getSessionID();

    // ds if set
    if (null != strUsername) {
      try {
        // ds log
        m_cMySQLManager.logMaster(strUsername, iSessionID, p_strInfo);
      } catch (SQLException e) {
        System.out.println(
            "["
                + CLogger.getStamp()
                + "]<CGUI>(_logMaster) SQLException: "
                + e.getMessage()
                + " could not log to MySQL master");
      }
    } else {
      System.out.println(
          "["
              + CLogger.getStamp()
              + "]<CGUI>(_logMaster) could not log to master because of empty username");
    }
  }
コード例 #2
0
ファイル: CGUI.java プロジェクト: schdomin/zep
  // ds close GUI
  public void close() {
    // ds get username
    final String strUsername = m_cLearner.getUsername();

    // ds if username is set
    if (null != strUsername) {
      // ds log
      _logMaster("<CGUI>(close) closed GUI application");

      try {
        // ds remove user from active list
        m_cMySQLManager.removeActiveUser(strUsername);

        // ds log
        System.out.println(
            "["
                + CLogger.getStamp()
                + "]<CGUI>(close) Logout of: ["
                + strUsername
                + "] successful");
      } catch (Exception e) {
        // ds could not remove
        System.out.println(
            "["
                + CLogger.getStamp()
                + "]<CGUI>(close) Could not remove user: ["
                + strUsername
                + "] from active users list - please check database");
      }
    }

    // ds only if active
    if (isActive()) {
      // ds dispose frame completely
      m_cFrame.removeAll();
      m_cFrame.dispose();
    }

    // ds info
    System.out.println("[" + CLogger.getStamp() + "]<CGUI>(close) Closing of GUI complete");
  }