Examples of UsmTableRow


Examples of org.snmp4j.agent.mo.snmp.UsmMIB.UsmTableRow

  public void rowStatusChanged(RowStatusEvent event) {
  }

  public synchronized void rowChanged(MOTableRowEvent event) {
    UsmTableRow row = (UsmTableRow) event.getRow();
    if (event.getType() == MOTableRowEvent.CREATE) {
      // check if event needs to be processed
      if (!row.containsHiddenValues() &&
          ((row.getAuthProtocolOID(row) != null) ||
           (row.getPrivProtocolOID(row) != null))) {
        return;
      }
      // loaded row
      UsmUserEntry entry = row.getUserEntry();
      if (entry != null) {
        usm.removeUser(entry.getEngineID(), entry.getUserName());
      }
      else {
        OctetString[] idxValues = row.getIndexValues();
        if ((row.size() > colUsmUserLocalizationEngineID) &&
            (row.getValue(colUsmUserAuthPassword) != null)) {
          UsmUser user = new UsmUser(idxValues[1],
                                     row.getAuthProtocolOID(row),
                                     (OctetString)row.getValue(colUsmUserAuthPassword),
                                     row.getPrivProtocolOID(row),
                                     (OctetString)row.getValue(colUsmUserPrivPassword),
                                     (OctetString)row.getValue(colUsmUserLocalizationEngineID));
          usm.addUser(idxValues[1], idxValues[0], user);
        }
        else if (row.size() > colUsmUserPrivKey) {
          OctetString authKey =
              (OctetString)row.getValue(colUsmUserAuthKey);
          OctetString privKey =
              (OctetString)row.getValue(colUsmUserPrivKey);
          usm.addLocalizedUser(idxValues[0].getValue(),
                               idxValues[1],
                               row.getAuthProtocolOID(row),
                               (authKey == null) ? null : authKey.getValue(),
                               row.getPrivProtocolOID(row),
                               (privKey == null) ? null : privKey.getValue());
        }
        else {
          logger.warn("Cannot add user '"+idxValues[1]+
                      "' to the USM from USM-MIB because key "+
                      "information is missing");
        }
      }
    }
    else if (event.getType() == MOTableRowEvent.DELETE) {
      UsmUserEntry entry = row.getUserEntry();
      if (entry != null) {
        usm.removeUser(entry.getEngineID(), entry.getUserName());
      }
    }
  }
View Full Code Here

Examples of org.snmp4j.agent.mo.snmp.UsmMIB.UsmTableRow

      if (values.length < colUsmUserPrivKey + 1) {
        Variable[] h = new Variable[colUsmUserPrivKey + 1];
        System.arraycopy(values, 0, h, 0, values.length);
        values = h;
      }
      return new UsmTableRow(this, index, values);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.