} else {
cachedVersion = Boolean.TRUE;
}
} catch (YardException e) {
if (dereferencer == null) {
throw new SiteException(String.format("Unable to get Represetnation %s form Cache %s",
id, siteConfiguration.getCacheId()), e);
} else {
log.warn(
String.format(
"Unable to get Represetnation %s form Cache %s. Will dereference from remote site %s",
id, siteConfiguration.getCacheId(), siteConfiguration.getAccessUri()), e);
}
}
}
if (rep == null && dereferencer != null) {
try {
rep = dereferencer.dereference(id);
} catch (IOException e) {
throw new SiteException(String.format(
"Unable to load Representation for entity %s form remote site %s with dereferencer %s",
id, siteConfiguration.getAccessUri(), siteConfiguration.getEntityDereferencerType()), e);
}
// representation loaded from remote site and cache is available
if (rep != null && cache != null) {// -> cache the representation