use of org.orcid.persistence.jpa.entities.WorkLastModifiedEntity in project ORCID-Source by ORCID.
the class WorkEntityCacheManagerImpl method retrieveWorkLastModifiedList.
@Override
public List<WorkLastModifiedEntity> retrieveWorkLastModifiedList(String orcid, long profileLastModified) {
Object key = new ProfileCacheKey(orcid, profileLastModified, releaseName);
List<WorkLastModifiedEntity> workLastModifiedList = toWorkLastModifiedList(getFromWorkLastModifiedCache(key));
if (workLastModifiedList == null) {
try {
synchronized (lockers.obtainLock(orcid)) {
workLastModifiedList = toWorkLastModifiedList(getFromWorkLastModifiedCache(key));
if (workLastModifiedList == null) {
workLastModifiedList = workDao.getWorkLastModifiedList(orcid);
workLastModifiedCache.put(new Element(key, workLastModifiedList));
}
}
} finally {
lockers.releaseLock(orcid);
}
}
return workLastModifiedList;
}
use of org.orcid.persistence.jpa.entities.WorkLastModifiedEntity in project ORCID-Source by ORCID.
the class WorkEntityCacheManagerImpl method retrievePublicWorkLastModifiedList.
@Override
public List<WorkLastModifiedEntity> retrievePublicWorkLastModifiedList(String orcid, long profileLastModified) {
Object key = new ProfileCacheKey(orcid, profileLastModified, releaseName);
List<WorkLastModifiedEntity> workLastModifiedList = toWorkLastModifiedList(getFromPublicWorkLastModifiedCache(key));
if (workLastModifiedList == null) {
try {
synchronized (publicWorkLastModifiedListLockers.obtainLock(orcid)) {
workLastModifiedList = toWorkLastModifiedList(getFromPublicWorkLastModifiedCache(key));
if (workLastModifiedList == null) {
workLastModifiedList = workDao.getPublicWorkLastModifiedList(orcid);
publicWorkLastModifiedCache.put(new Element(key, workLastModifiedList));
}
}
} finally {
publicWorkLastModifiedListLockers.releaseLock(orcid);
}
}
return workLastModifiedList;
}
Aggregations