⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 motablerowevent.java

📁 你个snmp的源码
💻 JAVA
字号:
/*_############################################################################
  _##
  _##  SNMP4J-Agent - MOTableRowEvent.java
  _##
  _##  Copyright 2005-2006  Frank Fock (SNMP4J.org)
  _##
  _##  Licensed under the Apache License, Version 2.0 (the "License");
  _##  you may not use this file except in compliance with the License.
  _##  You may obtain a copy of the License at
  _##
  _##      http://www.apache.org/licenses/LICENSE-2.0
  _##
  _##  Unless required by applicable law or agreed to in writing, software
  _##  distributed under the License is distributed on an "AS IS" BASIS,
  _##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  _##  See the License for the specific language governing permissions and
  _##  limitations under the License.
  _##
  _##########################################################################*/


package org.snmp4j.agent.mo;

import java.util.*;

import org.snmp4j.mp.*;

/**
 * The <code>MOTableRowEvent</code> class describes the changes
 * @author Frank Fock
 * @version 1.0
 */
public class MOTableRowEvent extends EventObject {

  /**
   * A single column of a row is changed.
   */
  public static final int CHANGE = 0;
  /**
   * A row is created.
   */
  public static final int CREATE = 1;
  /**
   * A row is added.
   */
  public static final int ADD    = 2;
  /**
   * A row is deleted.
   */
  public static final int DELETE = 3;

  /**
   * This event type indicates that a complete row has been updated.
   */
  public static final int UPDATED = 4;


  private MOTable table;
  private MOTableRow row;
  private MOTableRow preparedChanges;
  private int type;
  private int vetoStatus = SnmpConstants.SNMP_ERROR_SUCCESS;
  private int vetoColumn = -1;

  /**
   * Creates a table row event based on table, row and type.
   * @param source
   *    the event source.
   * @param table
   *    the table.
   * @param row
   *    the row associated with this event.
   * @param type
   *    the event type.
   */
  public MOTableRowEvent(Object source,
                         MOTable table, MOTableRow row,
                         int type) {
    super(source);
    this.table = table;
    this.row = row;
    this.type = type;
  }

  /**
   * Creates a table row event based on table, row, prepared changes, and type.
   * @param source
   *    the event source.
   * @param table
   *    the table.
   * @param row
   *    the row associated with this event.
   * @param preparedChanges
   *    a row instance containing the prepared changes for <code>row</code>.
   * @param type
   *    the event type.
   */
  public MOTableRowEvent(Object source,
                         MOTable table,
                         MOTableRow row,
                         MOTableRow preparedChanges,
                         int type) {
    super(source);
    this.table = table;
    this.row = row;
    this.preparedChanges = preparedChanges;
    this.type = type;
  }

  public MOTableRow getRow() {
    return row;
  }

  public MOTable getTable() {
    return table;
  }

  public int getType() {
    return type;
  }

  /**
   * Returns the veto status that revokes the row operation or zero if the
   * row operation is accepted by all listeners.
   * @return
   *    a SNMP or sub-agent protocol error status or zero if the row operation
   *    is accepted.
   */
  public int getVetoStatus() {
    return vetoStatus;
  }

  public MOTableRow getPreparedChanges() {
    return preparedChanges;
  }

  public int getVetoColumn() {
    return vetoColumn;
  }

  /**
   * Sets the veto status that revokes the row operation.
   * @param denyReason
   *    a SNMP error status or a sub-agent protocol specific error status.
   *    In any case zero represents no error.
   */
  public void setVetoStatus(int denyReason) {
    this.vetoStatus = denyReason;
  }

  /**
   * Sets the column index on whose behalf the veto is issued.
   * @param vetoColumn
   *    a column index.
   */
  public void setVetoColumn(int vetoColumn) {
    this.vetoColumn = vetoColumn;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -