Search in sources :

Example 11 with CachePut

use of org.springframework.cache.annotation.CachePut in project entando-core by entando.

the class ContentAuthorizationHelper method getAuthorizationInfo.

@Override
@CachePut(value = ICacheInfoManager.DEFAULT_CACHE_NAME, condition = "#cacheable", key = "T(com.agiletec.plugins.jacms.aps.system.JacmsSystemConstants).CONTENT_AUTH_INFO_CACHE_PREFIX.concat(#contentId)")
@CacheableInfo(groups = "T(com.agiletec.plugins.jacms.aps.system.services.cache.CmsCacheWrapperManager).getContentCacheGroupsCsv(#contentId)")
public PublicContentAuthorizationInfo getAuthorizationInfo(String contentId, boolean cacheable) {
    PublicContentAuthorizationInfo authInfo = null;
    try {
        Content content = this.getContentManager().loadContent(contentId, true, cacheable);
        if (null == content) {
            _logger.debug("public content {} doesn't exist", contentId);
            return null;
        }
        authInfo = new PublicContentAuthorizationInfo(content, this.getLangManager().getLangs());
    } catch (Throwable t) {
        _logger.error("error in getAuthorizationInfo for content {}", contentId, t);
    }
    return authInfo;
}
Also used : Content(com.agiletec.plugins.jacms.aps.system.services.content.model.Content) CacheableInfo(org.entando.entando.aps.system.services.cache.CacheableInfo) CachePut(org.springframework.cache.annotation.CachePut)

Example 12 with CachePut

use of org.springframework.cache.annotation.CachePut in project selenium_java by sergueik.

the class DefaultPropertyService method set.

@CachePut(key = "#properties.class")
@Override
public <T extends Properties> T set(T properties) {
    Property entity = new Property(properties.getClass().getSimpleName(), JsonUtils.toString(properties));
    propertyRepository.save(entity);
    return properties;
}
Also used : Property(me.ruslanys.vkmusic.entity.Property) CachePut(org.springframework.cache.annotation.CachePut)

Aggregations

CachePut (org.springframework.cache.annotation.CachePut)12 CacheableInfo (org.entando.entando.aps.system.services.cache.CacheableInfo)8 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)7 IUserProfile (org.entando.entando.aps.system.services.userprofile.model.IUserProfile)3 Content (com.agiletec.plugins.jacms.aps.system.services.content.model.Content)2 FieldSearchFilter (com.agiletec.aps.system.common.FieldSearchFilter)1 ResourceRecordVO (com.agiletec.plugins.jacms.aps.system.services.resource.model.ResourceRecordVO)1 PasscodeRequest (io.picos.sailfish.mfa.passcode.model.PasscodeRequest)1 Method (java.lang.reflect.Method)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 LocalDate (java.time.LocalDate)1 Date (java.util.Date)1 Property (me.ruslanys.vkmusic.entity.Property)1 Around (org.aspectj.lang.annotation.Around)1 MethodSignature (org.aspectj.lang.reflect.MethodSignature)1 UserProfileRecord (org.entando.entando.aps.system.services.userprofile.model.UserProfileRecord)1 ActivityStreamComment (org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamComment)1 ActivityStreamLikeInfo (org.entando.entando.apsadmin.system.services.activitystream.model.ActivityStreamLikeInfo)1