| 1 20 21 22 package org.snmp4j.agent.mo.snmp; 23 24 import java.util.*; 25 26 import org.snmp4j.agent.mo.*; 27 import org.snmp4j.PDU; 28 29 public class RowStatusEvent extends DeniableEventObject { 30 31 33 private MOTable table; 34 private MOTableRow row; 35 private MOTableRow changeSet; 36 private int oldStatus; 37 private int newStatus; 38 39 public RowStatusEvent(Object source, 40 MOTable table, MOTableRow row, MOTableRow changeSet, 41 int oldStatus, int newStatus) { 42 this(source, table, row, changeSet, oldStatus, newStatus, false); 43 } 44 45 public RowStatusEvent(Object source, 46 MOTable table, MOTableRow row, MOTableRow changeSet, 47 int oldStatus, int newStatus, boolean deniable) { 48 super(source, deniable); 49 this.table = table; 50 this.row = row; 51 this.changeSet = changeSet; 52 this.oldStatus = oldStatus; 53 this.newStatus = newStatus; 54 } 55 56 public int getNewStatus() { 57 return newStatus; 58 } 59 60 public int getOldStatus() { 61 return oldStatus; 62 } 63 64 public MOTableRow getRow() { 65 return row; 66 } 67 68 public MOTable getTable() { 69 return table; 70 } 71 72 public MOTableRow getChangeSet() { 73 return changeSet; 74 } 75 76 85 public boolean isRowActivated() { 86 return (((getNewStatus() == RowStatus.createAndGo) || 87 (getNewStatus() == RowStatus.active)) && 88 (getOldStatus() != RowStatus.active)); 89 } 90 91 100 public boolean isRowDeactivated() { 101 return (((getNewStatus() == RowStatus.destroy) || 102 (getNewStatus() == RowStatus.notInService)) && 103 (getOldStatus() == RowStatus.active)); 104 } 105 106 } 107 | Popular Tags |