@Nullable @Override public CategoryAttribute getAttributeForMetaClass(MetaClass metaClass, String code) { return cache().getAttributeForMetaClass(metaClass, code); }
@Override public Collection<CategoryAttribute> getAttributesForMetaClass(MetaClass metaClass) { return cache().getAttributesForMetaClass(metaClass); }
@Override public Collection<Category> getCategoriesForMetaClass(MetaClass metaClass) { return cache().getCategoriesForMetaClass(metaClass); }
@Override public DynamicAttributesCache getCacheIfNewer(Date clientCacheDate) { if (clientCacheDate == null || this.dynamicAttributesCache == null || this.dynamicAttributesCache.getCreationDate() == null || clientCacheDate.before(this.dynamicAttributesCache.getCreationDate())) { return cache(); } else { return null; } }
public Collection<Category> getCategoriesForMetaClass(MetaClass metaClass) { MetaClass targetMetaClass = resolveTargetMetaClass(metaClass); return new ArrayList<>(categoriesCache.get(targetMetaClass.getName())); }
dynamicAttributesCache = new DynamicAttributesCache(categoriesCache, attributesCache, timeSource.currentTimestamp()); if (sendClusterMessage) { clusterManager.send(new ReloadCacheMsg());
@Override public Object loadObject() { DynamicAttributesCache cacheFromServer = AppBeans.get(DynamicAttributesCacheService.NAME, DynamicAttributesCacheService.class) .getCacheIfNewer(dynamicAttributesCache != null ? dynamicAttributesCache.getCreationDate() : null); if (cacheFromServer != null) { dynamicAttributesCache = cacheFromServer; } needToValidateCache = false; return dynamicAttributesCache; }
@Nullable public CategoryAttribute getAttributeForMetaClass(MetaClass metaClass, String code) { code = DynamicAttributesUtils.decodeAttributeCode(code); MetaClass targetMetaClass = resolveTargetMetaClass(metaClass); Map<String, CategoryAttribute> attributes = attributesCache.get(targetMetaClass.getName()); if (attributes != null) { return attributes.get(code); } return null; }
@Nullable @Override public CategoryAttribute getAttributeForMetaClass(MetaClass metaClass, String code) { return cache().getAttributeForMetaClass(metaClass, code); }
@Override public Collection<CategoryAttribute> getAttributesForMetaClass(MetaClass metaClass) { return cache().getAttributesForMetaClass(metaClass); }
@Override public Collection<Category> getCategoriesForMetaClass(MetaClass metaClass) { return cache().getCategoriesForMetaClass(metaClass); }
public Collection<CategoryAttribute> getAttributesForMetaClass(MetaClass metaClass) { MetaClass targetMetaClass = resolveTargetMetaClass(metaClass); Collection<Category> categories = categoriesCache.get(targetMetaClass.getName()); return categories.stream() .flatMap(ca -> ca.getCategoryAttrs().stream()) .filter(a -> StringUtils.isNotBlank(a.getCode())) .collect(Collectors.toList()); }