public List<String> getSchemaNames(final HttpServletResponse response,
@RequestBody final ConnInstanceTO connectorTO,
@RequestParam(required = false, value = "showall", defaultValue = "false") final boolean showall)
throws NotFoundException {
final ConnInstance connInstance = connInstanceDAO.find(connectorTO.getId());
if (connInstance == null) {
throw new NotFoundException("Connector '" + connectorTO.getId() + "'");
}
// consider the possibility to receive overridden properties only
final Set<ConnConfProperty> conf = mergeConnConfProperties(connectorTO.getConfiguration(), connInstance.
getConfiguration());
// We cannot use Spring bean because this method could be used during
// resource definition or modification: bean couldn't exist or bean
// couldn't be updated.
// This is the reason why we should take a "not mature" connector
// facade proxy to ask for schema names.
final List<String> result = new ArrayList<String>(connLoader.createConnectorBean(connInstance, conf).getSchema(
showall));
Collections.sort(result);
auditManager.audit(Category.connector, ConnectorSubCategory.getSchemaNames, Result.success,
"Successfully listed all schema names (" + result.size() + ") for connector "
+ connInstance.getDisplayName());
return result;
}