Search in sources :

Example 1 with AttributeValueWrapperDto

use of eu.bcvsolutions.idm.acc.dto.AttributeValueWrapperDto in project CzechIdMng by bcvsolutions.

the class AbstractSynchronizationExecutor method getValueByMappedAttribute.

protected Object getValueByMappedAttribute(AttributeMapping attribute, List<IcAttribute> icAttributes, SynchronizationContext context) {
    if (attribute == null || icAttributes == null) {
        return null;
    }
    // If is attribute marked as not "cached", then none cache is using
    if (!attribute.isCached()) {
        return systemAttributeMappingService.getValueByMappedAttribute(attribute, icAttributes);
    }
    AttributeValueWrapperDto key = new AttributeValueWrapperDto(attribute, icAttributes);
    ValueWrapper value = this.getCachedValue(key);
    if (value != null) {
        return value.get();
    }
    this.setCachedValue(key, systemAttributeMappingService.getValueByMappedAttribute(attribute, icAttributes));
    return this.getCachedValue(key).get();
}
Also used : ValueWrapper(org.springframework.cache.Cache.ValueWrapper) AttributeValueWrapperDto(eu.bcvsolutions.idm.acc.dto.AttributeValueWrapperDto)

Aggregations

AttributeValueWrapperDto (eu.bcvsolutions.idm.acc.dto.AttributeValueWrapperDto)1 ValueWrapper (org.springframework.cache.Cache.ValueWrapper)1