1 package mobisnap.common.reservation; 2 3 import java.io.*; 4 import mobisnap.mobile_trx.*; 5 6 /*** 7 * Represents a slot reservation 8 * 9 * @version 6-Mar-2001 10 * @author 11 */ 12 public class SlotReservation 13 extends ReservationBase 14 implements Serializable 15 { 16 ColumnCondition lowerBound; 17 ColumnCondition upperBound; 18 int triggerCode; 19 20 public SlotReservation( String table, ColumnCondition lowerBound, ColumnCondition upperBound, int triggerCode) { 21 super( table, "none"); 22 this.lowerBound = lowerBound; 23 this.upperBound = upperBound; 24 this.triggerCode = triggerCode; 25 } 26 27 public Object getLowerBound(){ 28 return lowerBound; 29 } 30 31 public Object getUpperBound(){ 32 return upperBound; 33 } 34 35 public int getTriggerCode(){ 36 return triggerCode; 37 } 38 39 /*** 40 * Checks the given parameters are backed up by this reservation. 41 * If so, sets the reserved value to the variable and 42 * associate the reservation with the given variable - through a ReservationUseBase 43 * class which is returned 44 * NOTE: Currently only select in the form of 45 * "select col(,col)* into var(,var)* from table where cond1 (AND cond2)*" 46 * can be checked 47 * 48 * @param var Variable involved 49 * @param table Table name of possible reservation 50 * @param column Column name of possible reservation ( it is ignored ) 51 * @param where Table row specification 52 * @return Return null if there is no associateion between the given parameters 53 * ans this reservation. Otherwise returns a class to represent the reservation use 54 */ 55 public ReservationUseBase checkReservation( MSQLTVariable var, String table, String column, SimpleNode where) { 56 if( checkReservation( table, "*", where)) { 57 // verify slot conditions 58 ReservationUseBase rub = new SlotReservationUse( this); 59 var.associateRsrv( rub); 60 } 61 return null; 62 63 } 64 65 /*** 66 * Returns a readable representation of this reservation - format:<BR> 67 * slot rsrv_id reservation column from table where row specification lowerbound number upperbound number 68 */ 69 public String toString() { 70 return "SLOT " + super.toString() + " LOWERBOUND " + lowerBound +" UPPERBOUND "+upperBound; 71 } 72 }

This page was automatically generated by Maven