int srcId;
String trimmedSourceId = sourceId.trim();
try
{
srcId = Integer.valueOf(trimmedSourceId);
LogicalSource lsource = _relay.getSourcesIdNameRegistry().getSource(srcId);
if (null != lsource) logicalSources.add(lsource);
else
{
LOG.error("No source name for source id: " + srcId);
throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_PARAM, sourceId);
}
}
catch (NumberFormatException nfe)
{
if (relayStatsCollector != null)
{
relayStatsCollector.registerInvalidRegisterCall();
}
throw new InvalidRequestParamValueException(COMMAND_NAME, SOURCES_PARAM, sourceId);
}
}
}
SchemaRegistryService schemaRegistry = _relay.getSchemaRegistryService();
ArrayList<RegisterResponseEntry> registeredSources = new ArrayList<RegisterResponseEntry>(20);
for (LogicalSource lsource: logicalSources)
{
getSchemas(schemaRegistry, lsource.getName(), lsource.getId(), sources, registeredSources);
}
// Note that, as of April 2013, the Espresso sandbox's schema registry
// (in JSON format) is 4.5 MB and growing. But 100 KB is probably OK
// for regular production cases.