Class EventregDb

java.lang.Object
org.bedework.eventreg.db.EventregDb
All Implemented Interfaces:
Serializable, org.bedework.util.logging.Logged

public class EventregDb extends Object implements org.bedework.util.logging.Logged, Serializable
This class manages the Event registration database.
Author:
Mike Douglass
See Also:
  • Field Details

    • open

      protected boolean open
    • objTimestamp

      protected Timestamp objTimestamp
      When we were created for debugging
    • sess

      protected org.bedework.util.hibernate.HibSession sess
      Current hibernate session - exists only across one user interaction
  • Constructor Details

    • EventregDb

      public EventregDb()
  • Method Details

    • getNextRegistrationId

      public Long getNextRegistrationId() throws Throwable
      Returns:
      next id
      Throws:
      Throwable
    • setSysInfo

      public void setSysInfo(EventregProperties sysInfo)
    • open

      public boolean open() throws Throwable
      Returns:
      true if we had to open it. False if already open
      Throws:
      Throwable
    • isOpen

      public boolean isOpen()
      Returns:
      true for open
    • rollback

      public boolean rollback() throws Throwable
      Returns:
      true if we had did rollback.
      Throws:
      Throwable
    • close

      public boolean close()
      Returns:
      false if error occurred
    • close

      public boolean close(boolean ignoreErrors)
      Parameters:
      ignoreErrors -
      Returns:
      false if error occurred
    • addChange

      public void addChange(Change c) throws Throwable
      Parameters:
      c -
      Throws:
      Throwable
    • getChanges

      public List<Change> getChanges(String ts) throws Throwable
      Parameters:
      ts - - timestamp value - get changes after this
      Returns:
      - list of changes since ts
      Throws:
      Throwable
    • getAllRegistrations

      public List<Registration> getAllRegistrations() throws Throwable
      Returns:
      list of registrations
      Throws:
      Throwable
    • getByid

      public Registration getByid(Long id) throws Throwable
      Registrations for a user.
      Parameters:
      id -
      Returns:
      a matching registration
      Throws:
      Throwable
    • getByUser

      public List<Registration> getByUser(String user) throws Throwable
      Registrations for a user.
      Parameters:
      user -
      Returns:
      a matching registrations
      Throws:
      Throwable
    • getUserRegistration

      public Registration getUserRegistration(String eventHref, String user) throws Throwable
      Parameters:
      eventHref -
      user -
      Returns:
      registration or null
      Throws:
      Throwable
    • getByEvent

      public List<Registration> getByEvent(String href) throws Throwable
      Registrations for an event.
      Parameters:
      href -
      Returns:
      a matching registrations
      Throws:
      Throwable
    • getRegistrantCount

      public long getRegistrantCount(String eventHref) throws Throwable
      Parameters:
      eventHref -
      Returns:
      number of registration entries for that event
      Throws:
      Throwable
    • getRegTicketCount

      public long getRegTicketCount(String eventHref) throws Throwable
      Parameters:
      eventHref -
      Returns:
      number of registrations not on the waiting list for the event
      Throws:
      Throwable
    • getWaitingTicketCount

      public long getWaitingTicketCount(String eventHref) throws Throwable
      Parameters:
      eventHref - href of event
      Returns:
      number of tickets requested on the waiting list for the event
      Throws:
      Throwable - on fatal error
    • getWaiting

      public List<Registration> getWaiting(String eventHref) throws Throwable
      Parameters:
      eventHref -
      Returns:
      registrations on the waiting list for the event
      Throws:
      Throwable
    • getTicketCount

      public long getTicketCount(String eventHref) throws Throwable
      Parameters:
      eventHref -
      Returns:
      total number of registration entries for that event, including waiting list
      Throws:
      Throwable
    • getUserTicketCount

      public long getUserTicketCount(String eventHref, String user) throws Throwable
      Parameters:
      eventHref -
      user -
      Returns:
      number of registration entries for that event and user
      Throws:
      Throwable
    • getCalSuiteForms

      public List<FormDef> getCalSuiteForms(String calsuite) throws Throwable
      Throws:
      Throwable
    • getCalSuiteForm

      public FormDef getCalSuiteForm(String formName, String calsuite) throws Throwable
      Throws:
      Throwable
    • add

      public void add(DbItem val) throws Exception
      Add the item.
      Parameters:
      val - the dbitem
      Throws:
      Exception
    • update

      public void update(DbItem val) throws Exception
      Update the persisted state of the item.
      Parameters:
      val - the dbitem
      Throws:
      Exception
    • delete

      public void delete(DbItem val) throws Throwable
      Delete the dbitem.
      Parameters:
      val - the dbitem
      Throws:
      Throwable
    • checkOpen

      protected void checkOpen() throws Throwable
      Throws:
      Throwable
    • openSession

      protected void openSession() throws Throwable
      Throws:
      Throwable
    • closeSession

      protected void closeSession() throws Exception
      Throws:
      Exception
    • beginTransaction

      protected void beginTransaction() throws Throwable
      Throws:
      Throwable
    • endTransaction

      protected void endTransaction() throws Throwable
      Throws:
      Throwable
    • rollbackTransaction

      protected void rollbackTransaction() throws Throwable
      Throws:
      Throwable
    • getIdBatch

      public static org.bedework.eventreg.db.EventregDb.IdBatch getIdBatch(EventregProperties sysInfo) throws Throwable
      Throws:
      Throwable
    • getLogger

      public org.bedework.util.logging.BwLogger getLogger()
      Specified by:
      getLogger in interface org.bedework.util.logging.Logged