for (Iterator it = mo.getModel().iterator(); it.hasNext();) {
rows.add(it.next());
}
for (Iterator it = rows.iterator(); it.hasNext();) {
boolean retry = true;
MOTableRow row = (MOTableRow) it.next();
int retries = 0;
int status;
OID newIndex;
do {
newIndex = (OID) row.getIndex().clone();
status = sharedTableSupport.allocateIndex(context, mo.getIndexDef(),
(byte) AgentXSharedMOTableSupport.INDEX_MODE_ALLOCATE,
newIndex);
}
while (retry && (registrationCallback != null) &&
registrationCallback.tableRegistrationEvent(context,
mo, row, true, status, retries++));
if (status == AgentXProtocol.AGENTX_SUCCESS) {
if ((newIndex instanceof AnyNewIndexOID) ||
(newIndex instanceof NewIndexOID)) {
if (mo instanceof AgentXSharedMutableMOTable) {
((AgentXSharedMutableMOTable)mo).
changeRowIndex(row.getIndex(), newIndex);
}
retry = false;
}
status = sharedTableSupport.registerRow(mo, row);
if (status != AgentXProtocol.AGENTX_SUCCESS) {
sharedTableSupport.deallocateIndex(context, mo.getIndexDef(),
row.getIndex());
LOGGER.warn("Failed to register row with " + status + " for " +
row);
}
if (registrationCallback != null) {
registrationCallback.tableRegistrationEvent(context,