vb.getVariable().toSubIndex(true);
}
catch (UnsupportedOperationException ex) {
return AgentXProtocol.AGENTX_INDEX_WRONG_TYPE;
}
IndexRegistryEntry newEntry = new IndexRegistryEntry(context, vb);
IndexRegistryEntry oldEntry = (IndexRegistryEntry) indexes.get(newEntry);
if (oldEntry == null) {
if (!testOnly) {
int status = newEntry.allocate(sessionID, vb.getVariable(), testOnly);
if (status == AgentXProtocol.AGENTX_SUCCESS) {
indexes.put(newEntry, newEntry);
}
return status;
}
return AgentXProtocol.AGENTX_SUCCESS;
}
else {
return oldEntry.allocate(sessionID, vb.getVariable(), testOnly);
}
}