@Override public InputStream getContent(String id, String contentType) throws SiteException { if (siteConfiguration.getEntityDereferencerType() == null) { throw new SiteException( String.format( "Unable to get Content for Entity %s because No dereferencer configured for ReferencedSite %s", id, getId())); } if (dereferencer == null) { throw new SiteException(String.format("Dereferencer %s for remote site %s is not available", siteConfiguration.getEntityDereferencerType(), siteConfiguration.getAccessUri())); } try { return dereferencer.dereference(id, contentType); } catch (IOException e) { throw new SiteException( String.format( "Unable to load content for Entity %s and mediaType %s from remote site %s by using dereferencer %s", id, contentType, siteConfiguration.getAccessUri(), siteConfiguration.getEntityDereferencerType()), e); } }
@Override public InputStream getContent(String id, String contentType) throws SiteException { if (siteConfiguration.getEntityDereferencerType() == null) { throw new SiteException( String.format( "Unable to get Content for Entity %s because No dereferencer configured for ReferencedSite %s", id, getId())); } if (dereferencer == null) { throw new SiteException(String.format("Dereferencer %s for remote site %s is not available", siteConfiguration.getEntityDereferencerType(), siteConfiguration.getAccessUri())); } try { return dereferencer.dereference(id, contentType); } catch (IOException e) { throw new SiteException( String.format( "Unable to load content for Entity %s and mediaType %s from remote site %s by using dereferencer %s", id, contentType, siteConfiguration.getAccessUri(), siteConfiguration.getEntityDereferencerType()), e); } }
log.debug(" - validate available services:"); if(config.getAccessUri() != null && config.getEntityDereferencerType() != null && dereferencerComponentInstance == null){ log.debug(" ... EntityDereference not available");
log.debug(" - validate available services:"); if(config.getAccessUri() != null && config.getEntityDereferencerType() != null && dereferencerComponentInstance == null){ log.debug(" ... EntityDereference not available");
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);
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);