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); log.warn(String.format( "Unable to cache Represetnation %s in Cache %s! Representation not cached!", id, siteConfiguration.getCacheId()), e);
@Override public QueryResultList<Representation> find(FieldQuery query) throws SiteException { if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) { try { return cache.find(query); } catch (YardException e) { if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e); } } } if (entitySearcher == null) { throw new SiteException(String.format("ReferencedSite %s does not support queries!", getId())); } try { return entitySearcher.find(query); } catch (IOException e) { throw new SiteException("Unable execute Query on remote site " + siteConfiguration.getQueryUri(), e); } }
@Override public QueryResultList<String> findReferences(FieldQuery query) throws SiteException { if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) { try { return cache.findReferences(query); } catch (YardException e) { if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e); } } } if (entitySearcher == null) { throw new SiteException(String.format("The referencedSite %s dose not support queries!", getId())); } try { return entitySearcher.findEntities(query); } catch (IOException e) { throw new SiteException("Unable execute Query on remote site " + siteConfiguration.getQueryUri(), e); } }
@Override public QueryResultList<String> findReferences(FieldQuery query) throws SiteException { if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) { try { return cache.findReferences(query); } catch (YardException e) { if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e); } } } if (entitySearcher == null) { throw new SiteException(String.format("The referencedSite %s dose not support queries!", getId())); } try { return entitySearcher.findEntities(query); } catch (IOException e) { throw new SiteException("Unable execute Query on remote site " + siteConfiguration.getQueryUri(), 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); log.warn(String.format( "Unable to cache Represetnation %s in Cache %s! Representation not cached!", id, siteConfiguration.getCacheId()), e);
@Override public QueryResultList<Representation> find(FieldQuery query) throws SiteException { if (siteConfiguration.getCacheStrategy() == CacheStrategy.all) { try { return cache.find(query); } catch (YardException e) { if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e); } } } if (entitySearcher == null) { throw new SiteException(String.format("ReferencedSite %s does not support queries!", getId())); } try { return entitySearcher.find(query); } catch (IOException e) { throw new SiteException("Unable execute Query on remote site " + siteConfiguration.getQueryUri(), e); } }
if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e);
if (entitySearcher == null) { throw new SiteException("Unable to execute query on Cache " + siteConfiguration.getCacheId(), e); } else { log.warn( String.format( "Error while performing query on Cache %s! Try to use remote site %s as fallback!", siteConfiguration.getCacheId(), siteConfiguration.getQueryUri()), e);