use of com.icthh.xm.commons.logging.aop.IgnoreLogginAspect in project xm-ms-entity by xm-online.
the class XmEntitySpecService method getAllKeys.
/**
* Transforms all XmEntity Specification keys into the thin structure based
* in maps and sets.
*
* @return thin structure based in maps and sets
*/
@IgnoreLogginAspect
public Map<String, Map<String, Set<String>>> getAllKeys() {
Map<String, Map<String, Set<String>>> result = Maps.newHashMap();
for (TypeSpec typeSpec : findAllTypes()) {
Map<String, Set<String>> subKeys = Maps.newHashMap();
getKeys(subKeys, AttachmentSpec.class, typeSpec.getAttachments(), AttachmentSpec::getKey);
getKeys(subKeys, CalendarSpec.class, typeSpec.getCalendars(), CalendarSpec::getKey);
getKeys(subKeys, LinkSpec.class, typeSpec.getLinks(), LinkSpec::getKey);
getKeys(subKeys, LocationSpec.class, typeSpec.getLocations(), LocationSpec::getKey);
getKeys(subKeys, RatingSpec.class, typeSpec.getRatings(), RatingSpec::getKey);
getKeys(subKeys, StateSpec.class, typeSpec.getStates(), StateSpec::getKey);
getKeys(subKeys, TagSpec.class, typeSpec.getTags(), TagSpec::getKey);
result.put(typeSpec.getKey(), subKeys);
}
return result;
}
use of com.icthh.xm.commons.logging.aop.IgnoreLogginAspect in project xm-ms-entity by xm-online.
the class EntityCustomPrivilegeService method onEntitySpecUpdate.
@IgnoreLogginAspect
@Override
public void onEntitySpecUpdate(Map<String, TypeSpec> specs, String tenantKey) {
XmEntityTenantConfig xmEntityTenantConfig = tenantConfigService.getXmEntityTenantConfig(tenantKey);
Boolean disableDynamicPrivilegesGeneration = xmEntityTenantConfig.getDisableDynamicPrivilegesGeneration();
if (Boolean.TRUE.equals(disableDynamicPrivilegesGeneration)) {
log.warn("Dynamic privilege generation disabled.");
return;
}
String privilegesPath = resolvePathWithTenant(tenantKey, CUSTOMER_PRIVILEGES_PATH);
log.info("Get config from {}", privilegesPath);
List<String> paths = asList(privilegesPath);
Map<String, Configuration> configs = commonConfigRepository.getConfig(null, paths);
configs = configs == null ? new HashMap<>() : configs;
updateCustomPrivileges(specs, privilegesPath, configs.get(privilegesPath), tenantKey);
}
Aggregations