Class TicketService

java.lang.Object
de.bytestore.hostinger.handler.TicketService

@Service @Component public class TicketService extends Object
  • Constructor Details

    • TicketService

      public TicketService()
  • Method Details

    • onApplicationStarted

      @EventListener public void onApplicationStarted(org.springframework.boot.context.event.ApplicationStartedEvent event)
    • load

      public void load()
      This method is used to load a listener for new support tickets. It adds a listener to the systemService that listens for an event called "support.tickets.new". The listener gets the count of new tickets by invoking the private method countNewTickets().
    • getNewTickets

      public List<Ticket> getNewTickets()
      Retrieves a list of new support tickets from the database.
      Returns:
      A list of new support tickets.
    • createTicket

      public Ticket createTicket(User authorIO, String titleIO, TicketPriority priorityIO)
      Creates a new ticket.
      Parameters:
      authorIO - The author of the ticket.
      titleIO - The title of the ticket.
      priorityIO - The priority of the ticket.
      Returns:
      The created ticket object.
    • createMessage

      public TicketMessage createMessage(User user, Ticket ticketIO, String contentIO)
      Creates a new ticket message.
      Parameters:
      user - The user who created the message.
      ticketIO - The ticket object associated with the message.
      contentIO - The content of the message.
      Returns:
      The created ticket message object.
    • getTicket

      public Ticket getTicket(String idIO)
      Retrieves a ticket object from the database based on the given ID.
      Parameters:
      idIO - The ID of the ticket to be retrieved.
      Returns:
      The ticket object with the given ID, or null if no matching ticket is found.
    • renewSupportPin

      public void renewSupportPin(User userIO)
    • getMaxPinAge

      public int getMaxPinAge()
      Retrieves the maximum age for a support pin.
      Returns:
      The maximum age for a support pin in days.