use of org.springframework.cache.annotation.Cacheable in project ORCID-Source by ORCID.
the class ActivityCacheManagerImpl method pubPeerReviewsMap.
@Cacheable(value = "pub-peer-reviews-maps", key = "#orcid.concat('-').concat(#lastModified)")
public LinkedHashMap<Long, PeerReview> pubPeerReviewsMap(String orcid, long lastModified) {
List<PeerReview> peerReviews = peerReviewManager.findPeerReviews(orcid, lastModified);
LinkedHashMap<Long, PeerReview> peerReviewMap = new LinkedHashMap<>();
if (peerReviews != null) {
if (!peerReviews.isEmpty()) {
for (PeerReview peerReview : peerReviews) {
if (peerReview.getVisibility().equals(Visibility.PUBLIC)) {
peerReviewMap.put(peerReview.getPutCode(), peerReview);
}
}
}
}
return peerReviewMap;
}
use of org.springframework.cache.annotation.Cacheable in project ORCID-Source by ORCID.
the class AddressDaoImpl method getAddresses.
@SuppressWarnings("unchecked")
@Override
@Cacheable(value = "dao-address", key = "#orcid.concat('-').concat(#lastModified)")
public List<AddressEntity> getAddresses(String orcid, long lastModified) {
Query query = entityManager.createQuery("FROM AddressEntity WHERE user.id = :orcid order by displayIndex desc, dateCreated asc");
query.setParameter("orcid", orcid);
return query.getResultList();
}
use of org.springframework.cache.annotation.Cacheable in project ORCID-Source by ORCID.
the class WorkDaoImpl method findPublicWorks.
/**
* @deprepcated Use {@link org.orcid.core.manager.WorkEntityCacheManager#retrievePublicMinimizedWorks(String, long)} instead
*
* Find the public works for a specific user
*
* @param orcid
* the Id of the user
* @return the list of works associated to the specific user
* */
@SuppressWarnings("unchecked")
@Cacheable(value = "dao-public-works", key = "#orcid.concat('-').concat(#lastModified)")
@Deprecated
public List<MinimizedWorkEntity> findPublicWorks(String orcid, long lastModified) {
Query query = entityManager.createQuery("from MinimizedWorkEntity w " + "where w.visibility='PUBLIC' and w.orcid=:orcid " + "order by w.displayIndex desc, w.dateCreated asc");
query.setParameter("orcid", orcid);
return query.getResultList();
}
use of org.springframework.cache.annotation.Cacheable in project ORCID-Source by ORCID.
the class WorkDaoImpl method findWorks.
/**
* @deprecated Use {@link org.orcid.core.manager.WorkEntityCacheManager#retrieveMinimizedWorks(String, long) } instead
*
* Find works for a specific user
*
* @param orcid
* the Id of the user
* @return the list of works associated to the specific user
* */
@SuppressWarnings("unchecked")
@Cacheable(value = "dao-works", key = "#orcid.concat('-').concat(#lastModified)")
@Deprecated
public List<MinimizedWorkEntity> findWorks(String orcid, long lastModified) {
Query query = entityManager.createQuery("from MinimizedWorkEntity w " + "where w.orcid=:orcid " + "order by w.displayIndex desc, w.dateCreated asc");
query.setParameter("orcid", orcid);
return query.getResultList();
}
use of org.springframework.cache.annotation.Cacheable in project pinpoint by naver.
the class HbaseApiMetaDataDao method getApiMetaData.
@Override
@Cacheable(value = "apiMetaData", key = SPEL_KEY)
public List<ApiMetaDataBo> getApiMetaData(String agentId, long time, int apiId) {
if (agentId == null) {
throw new NullPointerException("agentId must not be null");
}
ApiMetaDataBo apiMetaDataBo = new ApiMetaDataBo(agentId, time, apiId);
byte[] sqlId = getDistributedKey(apiMetaDataBo.toRowKey());
Get get = new Get(sqlId);
get.addFamily(HBaseTables.API_METADATA_CF_API);
return hbaseOperations2.get(HBaseTables.API_METADATA, get, apiMetaDataMapper);
}
Aggregations