@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); } }
if(config.getAccessUri() != null && config.getEntityDereferencerType() != null && dereferencerComponentInstance == null){
if(config.getAccessUri() != null && config.getEntityDereferencerType() != null && dereferencerComponentInstance == null){
String.format( "Unable to get Represetnation %s form Cache %s. Will dereference from remote site %s", id, siteConfiguration.getCacheId(), siteConfiguration.getAccessUri()), 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);
String.format( "Unable to get Represetnation %s form Cache %s. Will dereference from remote site %s", id, siteConfiguration.getCacheId(), siteConfiguration.getAccessUri()), 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);
if(refConfig.getAccessUri() != null){ rep.add(namespace+"accessUri", valueFactory.createReference(refConfig.getAccessUri()));