Changeset 1045 for raptor-client


Ignore:
Timestamp:
07/18/11 16:54:15 (9 years ago)
Author:
philsmart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • raptor-client/trunk/src/main/java/uk/ac/cardiff/raptor/store/StorageEngine.java

    r1043 r1045  
    2222import java.util.List; 
    2323 
    24 import org.hibernate.HibernateException; 
    25 import org.hibernate.QueryException; 
    2624import org.joda.time.DateTime; 
    2725import org.slf4j.Logger; 
    2826import org.slf4j.LoggerFactory; 
    29 import org.springframework.dao.DataAccessException; 
    30 import org.springframework.orm.hibernate3.HibernateQueryException; 
     27 
    3128 
    3229import uk.ac.cardiff.model.event.Event; 
     
    4744 
    4845        /** Responsible for storing all entries (e.g. events) */ 
    49         private EventHandler entryHandler; 
     46        private EventHandler eventHandler; 
    5047 
    5148        /** Engine used to associate attributes to existing events in the MUA */ 
     
    7067 
    7168        /** 
    72          * @param events 
     69         * Stores the <code>events</code> asynchronously through the {@link uk.ac.cardiff.raptor.store.EventHandler} 
     70         *  
     71         * @param transactionId the numerical Id of this transaction 
     72         * @param events the events to store 
    7373         */ 
    7474        public void performAsynchronousEntryStoragePipeline(int transactionId, List<Event> events) throws TransactionInProgressException { 
     
    7979                this.currentTransactionId = transactionId; 
    8080                transactionInProgress = true; 
    81                 AsynchronousEntryStoragePipeline asyncEntryStorage = new AsynchronousEntryStoragePipeline(transactionId, entryHandler, attributeAssociationEngine); 
     81                AsynchronousEntryStoragePipeline asyncEntryStorage = new AsynchronousEntryStoragePipeline(transactionId, eventHandler, attributeAssociationEngine); 
    8282                asyncEntryStorage.execute(events, this); 
    8383 
     
    9393                try { 
    9494                        attributeAssociationEngine.associateAttributes(events); 
    95                         entryHandler.addEvents(events); 
     95                        eventHandler.addEvents(events); 
    9696                        log.debug("Storage task completed true, for transaction id [{}]", currentTransactionId); 
    9797                } catch (StorageException e) { 
     
    111111         */ 
    112112        public List<Event> getEventsOnOrAfter(DateTime earliestReleaseTime) { 
    113                 List<Event> query = (List<Event>) entryHandler.query("from Event where eventTime >= ?", new Object[] { earliestReleaseTime }); 
     113                List<Event> query = (List<Event>) eventHandler.query("from Event where eventTime >= ?", new Object[] { earliestReleaseTime }); 
    114114                return query; 
    115115        } 
     
    125125         */ 
    126126        public List<Event> getEventsOnOrAfter(DateTime earliestReleaseTime, int maxNoResults) { 
    127                 List<Event> query = (List<Event>) entryHandler.query("from Event where eventTime >= ? order by eventTime asc", new Object[] { earliestReleaseTime }, 
     127                List<Event> query = (List<Event>) eventHandler.query("from Event where eventTime >= ? order by eventTime asc", new Object[] { earliestReleaseTime }, 
    128128                                maxNoResults); 
    129129                return query; 
     
    134134     */ 
    135135        public void removeAllEntries() { 
    136                 entryHandler.removeAllEvents(); 
     136                eventHandler.removeAllEvents(); 
    137137        } 
    138138 
     
    145145         */ 
    146146        public void setEntryHandler(EventHandler entryHandler) { 
    147                 this.entryHandler = entryHandler; 
     147                this.eventHandler = entryHandler; 
    148148                entryHandler.initialise(); 
    149149        } 
     
    153153         */ 
    154154        public EventHandler getEntryHandler() { 
    155                 return entryHandler; 
     155                return eventHandler; 
    156156        } 
    157157 
     
    183183                        try { 
    184184                                String query = "select " + fieldName + " from Event group by (" + fieldName + ")"; 
    185                                 List results = entryHandler.query(query); 
     185                                List results = eventHandler.query(query); 
    186186                                log.trace("Looking for possible values for field {} using query [{}]",fieldName, query); 
    187187                                int noResults=0; 
Note: See TracChangeset for help on using the changeset viewer.