Clover coverage report - Replica - 1.0-Alpha
Coverage timestamp: Dom Fev 1 2004 17:00:58 WET
file stats: LOC: 84   Methods: 5
NCLOC: 45   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
SlotReservationUse.java 0% 0% 0% 0%
coverage
 1   
 package mobisnap.common.reservation;
 2   
 
 3   
 /**
 4   
  * Used to represent the usage of a slot reservation
 5   
  * 
 6   
  * @version
 7   
  * @author 
 8   
  */
 9   
 public class SlotReservationUse
 10   
     extends ReservationUseBase
 11   
     implements java.io.Serializable
 12   
 {
 13   
     transient boolean srvPreOK = false;
 14   
     int triggerCode;
 15   
     
 16  0
     public SlotReservationUse( SlotReservation rsrv) {
 17  0
         super( rsrv);
 18  0
         triggerCode = rsrv.getTriggerCode();
 19   
     }
 20   
     
 21   
     /**
 22   
      * The associated transaction has been committed. Updates the associated
 23   
      * reservation accordingly.
 24   
      * Returns true if the reservation has been completely used
 25   
      */
 26  0
     public boolean commitCltRsrv() throws Exception {
 27  0
         return false;
 28   
     }
 29   
 
 30   
     /**
 31   
      * The associated transaction has been rollbacked. Updates the associated
 32   
      * reservation accordingly.
 33   
      */
 34  0
     public void rollbackCltRsrv(){
 35   
         // do nothing
 36   
     }
 37   
 
 38   
 
 39   
     /**
 40   
      * Updates the reservation and database according to the current usage - processed
 41   
      * BEFORE the transaction execution.
 42   
      * Returns false if the current usage is not compatible with the associated
 43   
      * reservation.
 44   
      */
 45  0
     public boolean preSrvTrxExeUpdate( ReservationBase rsrv0, nmp.dbms.JDBC.Jdbc_Sql database) throws Exception {
 46  0
         if( ! ( rsrv0 instanceof SlotReservation)) 
 47  0
             throw new mobisnap.MobisnapException( "Slot reservation expected in preSrvTrxExeUpdate");
 48  0
         SlotReservation rsrv = (SlotReservation)rsrv0;
 49   
 
 50  0
         StringBuffer buffer = new StringBuffer();
 51  0
         buffer.append( "alter trigger mobi_sl_");
 52  0
         buffer.append( "_");
 53  0
         buffer.append( rsrv.table);
 54  0
         buffer.append( "_");
 55  0
         buffer.append( rsrv.getTriggerCode());
 56  0
         buffer.append(" disable;");
 57  0
         if( database.executeUpdate( buffer.toString()) != 1)
 58  0
             return false;
 59  0
         return true;
 60   
     }
 61   
 
 62   
     /**
 63   
      * Updates the reservation and database according to the current usage - processed
 64   
      * AFTER the transaction execution.
 65   
      * Returns true if the transaction has been completely used.
 66   
      */
 67  0
     public boolean postSrvTrxExeUpdate( ReservationBase rsrv0, nmp.dbms.JDBC.Jdbc_Sql database) throws Exception {
 68  0
         if( ! ( rsrv0 instanceof SlotReservation)) 
 69  0
             throw new mobisnap.MobisnapException( "Slot reservation expected in postSrvTrxExeUpdate");
 70  0
         SlotReservation rsrv = (SlotReservation)rsrv0;
 71   
         
 72  0
         StringBuffer buffer = new StringBuffer();
 73  0
         buffer.append( "alter trigger mobi_sl_");
 74  0
         buffer.append( "_");
 75  0
         buffer.append( rsrv.getTriggerCode());
 76  0
         buffer.append( "_");
 77  0
         buffer.append( rsrv.table);
 78  0
         buffer.append(" enable;");
 79  0
         database.executeUpdate( buffer.toString());
 80  0
         return true;
 81   
     }
 82   
 
 83   
     
 84   
 }