1 20 21 22 package org.snmp4j.agent.mo; 23 24 import java.util.*; 25 26 import org.snmp4j.mp.*; 27 28 33 public class MOTableRowEvent extends DeniableEventObject { 34 35 private static final long serialVersionUID = 5846054060591503486L; 36 37 40 public static final int CHANGE = 0; 41 44 public static final int CREATE = 1; 45 48 public static final int ADD = 2; 49 52 public static final int DELETE = 3; 53 54 57 public static final int UPDATED = 4; 58 59 60 private MOTable table; 61 private MOTableRow row; 62 private MOTableRow preparedChanges; 63 private int type; 64 private int vetoColumn = -1; 65 66 78 public MOTableRowEvent(Object source, 79 MOTable table, MOTableRow row, 80 int type) { 81 super(source, false); 82 this.table = table; 83 this.row = row; 84 this.type = type; 85 } 86 87 103 public MOTableRowEvent(Object source, 104 MOTable table, MOTableRow row, 105 int type, boolean deniable) { 106 super(source, deniable); 107 this.table = table; 108 this.row = row; 109 this.type = type; 110 } 111 112 127 public MOTableRowEvent(Object source, 128 MOTable table, 129 MOTableRow row, 130 MOTableRow preparedChanges, 131 int type) { 132 super(source, false); 133 this.table = table; 134 this.row = row; 135 this.preparedChanges = preparedChanges; 136 this.type = type; 137 } 138 139 156 public MOTableRowEvent(Object source, 157 MOTable table, 158 MOTableRow row, 159 MOTableRow preparedChanges, 160 int type, 161 boolean deniable) { 162 super(source, deniable); 163 this.table = table; 164 this.row = row; 165 this.preparedChanges = preparedChanges; 166 this.type = type; 167 } 168 169 public MOTableRow getRow() { 170 return row; 171 } 172 173 public MOTable getTable() { 174 return table; 175 } 176 177 public int getType() { 178 return type; 179 } 180 181 188 public int getVetoStatus() { 189 return getDenyReason(); 190 } 191 192 public MOTableRow getPreparedChanges() { 193 return preparedChanges; 194 } 195 196 public int getVetoColumn() { 197 return vetoColumn; 198 } 199 200 206 public void setVetoStatus(int denyReason) { 207 setDenyReason(denyReason); 208 } 209 210 215 public void setVetoColumn(int vetoColumn) { 216 this.vetoColumn = vetoColumn; 217 } 218 219 public String toString() { 220 return getClass().getName()+"[source="+source+",table="+table+",row="+row+ 221 ",type="+type+",deniable="+isDeniable()+"]"; 222 } 223 } 224 | Popular Tags |