Kereta Yarsi Indonesia
Loading...
Searching...
No Matches
controller.TicketController Class Reference
Inheritance diagram for controller.TicketController:
controller.Controller model.TicketDAO

Public Member Functions

boolean createTicket (Ticket ticket)
 
ResultSet getTicket (String ticketId)
 
ResultSet getAllJoin (String ticketId)
 
- Public Member Functions inherited from controller.Controller
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)
 
boolean createTicket (Ticket ticket)
 
ResultSet getTicket (String ticketId)
 
ResultSet getAllJoin (String ticketId)
 

Static Public Member Functions

static synchronized TicketController getInstance ()
 
- Static Public Member Functions inherited from controller.Controller
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

- Public Attributes inherited from controller.Controller
boolean response = false
 
Session session = Session.getInstance()
 
- Static Public Attributes inherited from controller.Controller
static Statement st
 
static ResultSet rs
 
static PreparedStatement ps
 
- Protected Member Functions inherited from controller.Controller
 Controller (DatabaseConnector databaseConnector)
 
- Static Protected Attributes inherited from controller.Controller
static DatabaseConnector databaseConnector
 
static Connection con
 
static String sql
 

Detailed Description

Controller class for handling operations related to tickets. Implements the TicketDAO interface to provide data access methods for tickets.

This class uses the singleton pattern to ensure that only one instance of the controller exists.

Example usage:

TicketController controller = TicketController.getInstance();
boolean isCreateTicketSuccessful = controller.createTicket(ticket);
See also
model.TicketDAO
model.Ticket
model.DatabaseConnector
Version
1.0
Author
Muhammad Rizal Anditama Nugraha

Member Function Documentation

◆ createTicket()

boolean controller.TicketController.createTicket ( Ticket  ticket)
inline

Creates a new ticket in the database.

Parameters
ticketthe ticket to create
Returns
true if the ticket was created successfully, false otherwise

Implements model.TicketDAO.

◆ getAllJoin()

ResultSet controller.TicketController.getAllJoin ( String  ticketId)
inline

Retrieves detailed information about a ticket and its related entities by the ticket ID. Joins multiple tables to get comprehensive ticket details.

Parameters
ticketIdthe ID of the ticket to retrieve
Returns
a ResultSet containing the joined ticket data

Implements model.TicketDAO.

◆ getInstance()

static synchronized TicketController controller.TicketController.getInstance ( )
inlinestatic

Returns the single instance of TicketController. If no instance exists, it creates one using the provided DatabaseConnector.

Returns
the singleton instance of TicketController

Reimplemented from controller.Controller.

◆ getTicket()

ResultSet controller.TicketController.getTicket ( String  ticketId)
inline

Retrieves a ticket from the database by its ID.

Parameters
ticketIdthe ID of the ticket to retrieve
Returns
a ResultSet containing the ticket data

Implements model.TicketDAO.


The documentation for this class was generated from the following file: