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());
}
}
}