Class TicketRepository

All Implemented Interfaces:
MBeanService, MonitorCallback, Closeable, AutoCloseable, Runnable

public class TicketRepository extends StorageRepository<AbstractTicket>
The Class TicketRepository.
  • Constructor Details

    • TicketRepository

      public TicketRepository(String name)
      Instantiates a new ticket repository.
      Parameters:
      name - the name
  • Method Details

    • add

      public <E extends AbstractTicket> E add(E ticket)
      Adds the new ticket.
      Type Parameters:
      E - the element type
      Parameters:
      ticket - the ticket
      Returns:
      the e
    • add

      public <E extends AbstractTicket> E add(E ticket, long id)
      Adds the new ticket.
      Type Parameters:
      E - the element type
      Parameters:
      ticket - the ticket
      id - the id
      Returns:
      the e
    • getTimeOut

      public long getTimeOut()
      Gets the time out.
      Returns:
      the time out
    • setTimeOut

      public void setTimeOut(long timeout)
      Sets the time out.
      Parameters:
      timeout - the new time out
    • getTimeOutAfterCompletion

      public long getTimeOutAfterCompletion()
      Gets the time out after completion.
      Returns:
      the time out after completion
    • setTimeOutAfterCompletion

      public void setTimeOutAfterCompletion(long timeoutAfterCompletion)
      Sets the time out after completion.
      Parameters:
      timeoutAfterCompletion - the new time out after completion
    • get

      public AbstractTicket get(long id)
      Gets the.
      Parameters:
      id - the id
      Returns:
      the abstract ticket
    • get

      public <T extends AbstractTicket> T get(long id, Class<T> clazz)
      Gets the.
      Type Parameters:
      T - the generic type
      Parameters:
      id - the id
      clazz - the clazz
      Returns:
      the abstract ticket
    • check

      public AbstractTicket check(long id, long wait) throws IOException
      Check.
      Parameters:
      id - the id
      wait - the wait
      Returns:
      the abstract ticket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • check

      public AbstractTicket check(long id, boolean wait) throws IOException
      Check.
      Parameters:
      id - the id
      wait - the wait
      Returns:
      the abstract ticket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • remove

      public AbstractTicket remove(long id)
      Removes the.
      Parameters:
      id - the id
      Returns:
      the abstract ticket
    • getKey

      public String getKey(AbstractTicket ticket)
      Gets the key. Gets the key.
      Overrides:
      getKey in class MBeanRepository<AbstractTicket>
      Parameters:
      ticket - the object
      Returns:
      the key
    • getStatus

      public String getStatus(AbstractTicket ticket)
      Gets the status. Gets the status.
      Overrides:
      getStatus in class MBeanRepository<AbstractTicket>
      Parameters:
      ticket - the object
      Returns:
      the status
    • expired

      public boolean expired(AbstractTicket ticket)
      Expired. Expired.
      Overrides:
      expired in class StorageRepository<AbstractTicket>
      Parameters:
      ticket - the object
      Returns:
      true, if successful
    • update

      public void update(AbstractTicket ticket)
      Update. Update.
      Specified by:
      update in class StorageRepository<AbstractTicket>
      Parameters:
      ticket - the object