Kereta Yarsi Indonesia
|
Public Member Functions | |
void | display (JTable table) |
String | getSelectedUserRole (int userId) |
boolean | setSelectedUserRole (int userId, String role) |
boolean | invertSelectedUserRole (int userId) |
boolean | deleteUser (int userId) |
JTable | getLastTable () |
![]() | |
void | setFirstStuff (String stasiunAsal, String stasiunAkhir, Date tanggalPergi, Date tanggalPulang) |
int | countFoundTrain (String stasiunAwal, String stasiunAkhir, Date tanggal) |
ResultSet | findSpecificTrain (String stasiunAwal, String stasiunAkhir, Date tanggal) |
ResultSet | findAll (String table) |
ResultSet | findWhere (String table, String columnName, Object keyword) |
ResultSet | executeQuery (String sql) |
ResultSet | executeQuery (String sql, Object... values) |
boolean | executeUpdate (String sql, Object... values) |
boolean | insert (String table, boolean withID, Object... value) |
void | errorMessage (String title, String message) throws HeadlessException |
void | warningMessage (String message) throws HeadlessException |
void | infoMessage (String message) throws HeadlessException |
String[] | getColumnName (String table) |
int | getColumnCount (String table) |
int | getRowCount (String table) |
boolean | checkForDatabase (String database) throws SQLException |
int | getRowCountWhere (String table, String columnName, String keyword) |
boolean | hasWhitespace (String str) |
boolean | hasSpecialChar (String str) |
boolean | hasUpperCase (String str) |
byte[] | generateKey (int keyLength) |
String | hashPassword (String str) |
Static Public Member Functions | |
static synchronized AdminController | getInstance () |
![]() | |
static synchronized Controller | getInstance () |
static synchronized Session | getSession () |
static byte[] | generateSalt (int saltIteration) |
static String | encryptPBKDF2 (String password, byte[] salt) |
static boolean | verifyPassword (String inputPassword, String storedPassword, byte[] salt) |
static DefaultTableModel | buildTableModel (ResultSet rs) throws SQLException |
static Statement | getSt () |
static void | setSt (Statement aSt) |
static ResultSet | getRs () |
static void | setRs (ResultSet aRs) |
static PreparedStatement | getPs () |
static void | setPs (PreparedStatement aPs) |
Additional Inherited Members | |
![]() | |
boolean | response = false |
Session | session = Session.getInstance() |
![]() | |
static Statement | st |
static ResultSet | rs |
static PreparedStatement | ps |
![]() | |
Controller (DatabaseConnector databaseConnector) | |
![]() | |
static DatabaseConnector | databaseConnector |
static Connection | con |
static String | sql |
The AdminController class is responsible for managing admin-related operations such as displaying users, managing user roles, and deleting users. This class follows the singleton pattern to ensure only one instance is created.
|
inline |
Deletes the user with the specified user ID.
userId | The ID of the user to be deleted. |
|
inline |
Displays the user information in the given JTable.
table | The JTable to display the user information in. |
|
inlinestatic |
Returns the singleton instance of AdminController.
Reimplemented from controller.Controller.
|
inline |
Returns the last JTable used for displaying user information.
|
inline |
Retrieves the role of the user with the specified user ID.
userId | The ID of the user whose role is to be retrieved. |
|
inline |
Inverts the role of the user with the specified user ID. If the current role is "admin", it will be changed to "member" and vice versa.
userId | The ID of the user whose role is to be inverted. |
|
inline |
Sets the role of the user with the specified user ID.
userId | The ID of the user whose role is to be set. |
role | The new role to be assigned to the user. |