use of org.broadleafcommerce.common.extension.ResultType in project BroadleafCommerce by BroadleafCommerce.
the class TranslationServiceImpl method removeTranslationFromCache.
@Override
public void removeTranslationFromCache(Translation translation) {
if (BroadleafRequestContext.getBroadleafRequestContext().isProductionSandBox()) {
ResultType resultType = ResultType.STANDARD;
if (extensionManager != null) {
ExtensionResultHolder<ResultType> response = new ExtensionResultHolder<ResultType>();
extensionManager.getProxy().getResultType(translation, response);
resultType = response.getResult();
if (ResultType.STANDARD == resultType) {
String key = getCacheKey(resultType, translation.getEntityType());
LOG.debug("Removing key [" + key + "] for STANDARD site");
getCache().remove(key);
} else {
List<String> cacheKeysList = getCacheKeyListForTemplateSite(translation.getEntityType().getFriendlyType());
for (String key : cacheKeysList) {
LOG.debug("Removing key [" + key + "] for TEMPLATE site");
getCache().remove(key);
}
}
}
}
}
Aggregations