use of org.killbill.billing.catalog.plugin.api.VersionedPluginCatalog in project killbill by killbill.
the class EhCacheCatalogCache method getCatalogFromPlugins.
private VersionedCatalog getCatalogFromPlugins(final InternalTenantContext internalTenantContext) throws CatalogApiException {
final TenantContext tenantContext = internalCallContextFactory.createTenantContext(internalTenantContext);
for (final String service : pluginRegistry.getAllServices()) {
final CatalogPluginApi plugin = pluginRegistry.getServiceForName(service);
final VersionedPluginCatalog pluginCatalog = plugin.getVersionedPluginCatalog(ImmutableList.<PluginProperty>of(), tenantContext);
// First plugin that gets something (for that tenant) returns it
if (pluginCatalog != null) {
logger.info("Returning catalog from plugin {} on tenant {} ", service, internalTenantContext.getTenantRecordId());
return versionedCatalogMapper.toVersionedCatalog(pluginCatalog, internalTenantContext);
}
}
return null;
}
Aggregations