@Override public Entity getEntity(String entityId) { Collection<Site> sites = getSitesByEntityPrefix(entityId); if(sites.isEmpty()){ log.info("No Referenced Site registered for Entity {}",entityId); log.debug("Registered Prefixes {}",prefixList); return null; } for(Site site : sites){ Entity entity; try { entity = site.getEntity(entityId); if(entity != null){ log.debug("Return Representation of Site {} for Entity {}", site.getConfiguration().getName(),entityId); return entity; } } catch (SiteException e) { log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e); } } log.debug("Entity {} not found on any of the following Sites {}",entityId,sites); return null; }
@Override public Entity getEntity(String entityId) { Collection<Site> sites = getSitesByEntityPrefix(entityId); if(sites.isEmpty()){ log.info("No Referenced Site registered for Entity {}",entityId); log.debug("Registered Prefixes {}",prefixList); return null; } for(Site site : sites){ Entity entity; try { entity = site.getEntity(entityId); if(entity != null){ log.debug("Return Representation of Site {} for Entity {}", site.getConfiguration().getName(),entityId); return entity; } } catch (SiteException e) { log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e); } } log.debug("Entity {} not found on any of the following Sites {}",entityId,sites); return null; }
@Override public InputStream getContent(String entityId, String contentType) { Collection<Site> sites = getSitesByEntityPrefix(entityId); if(sites.isEmpty()){ log.info("No Referenced Site registered for Entity {}",entityId); log.debug("Registered Prefixes {}",prefixList); return null; } for(Site site : sites){ InputStream content; try { content = site.getContent(entityId, contentType); if(content != null){ log.debug("Return Content of type {} for Entity {} from referenced site {}", new Object[]{contentType,entityId,site.getConfiguration().getName()}); return content; } } catch (SiteException e) { log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e); } } log.debug("Entity {} not found on any of the following Sites {}",entityId,sites); return null; } @Override
@Override public InputStream getContent(String entityId, String contentType) { Collection<Site> sites = getSitesByEntityPrefix(entityId); if(sites.isEmpty()){ log.info("No Referenced Site registered for Entity {}",entityId); log.debug("Registered Prefixes {}",prefixList); return null; } for(Site site : sites){ InputStream content; try { content = site.getContent(entityId, contentType); if(content != null){ log.debug("Return Content of type {} for Entity {} from referenced site {}", new Object[]{contentType,entityId,site.getConfiguration().getName()}); return content; } } catch (SiteException e) { log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e); } } log.debug("Entity {} not found on any of the following Sites {}",entityId,sites); return null; } @Override
entity = site.getEntity(id); } catch (SiteException e) { log.error("ReferencedSiteException while accessing Site " + site.getConfiguration().getName() + " (id=" + site.getId() + ")", e); throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e);
log.warn("Unable to access Site "+site.getConfiguration().getName()+ " (id = "+site.getId()+")",e);
managedEntity.addAttributionText(site.getConfiguration().getAttribution(), null); managedEntity.addContributorName(site.getConfiguration().getName());
managedEntity.addAttributionText(site.getConfiguration().getAttribution(), null); managedEntity.addContributorName(site.getConfiguration().getName());
rep.add(namespace+"supportsSearch", site.supportsSearch()); SiteConfiguration config = site.getConfiguration(); rep.add("http://www.w3.org/2000/01/rdf-schema#label", config.getName()); rep.add("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", valueFactory.createReference(namespace+"ReferencedSite")); if(config.getDescription() != null){