Class ReadableResource

java.lang.Object
com.janeirodigital.sai.core.resources.ReadableResource
Direct Known Subclasses:
CRUDResource, ImmutableResource, ReadableAccessGrant, ReadableAgentRegistration, ReadableApplicationProfile, ReadableDataGrant, ReadableDataRegistration, ReadableSocialAgentProfile

public class ReadableResource extends Object
Represents a corresponding RDF Resource and provides read-only capabilities.
  • Field Details

    • uri

      protected final URI uri
    • saiSession

      protected final SaiSession saiSession
    • httpClient

      protected final okhttp3.OkHttpClient httpClient
    • dataset

      protected org.apache.jena.rdf.model.Model dataset
    • resource

      protected org.apache.jena.rdf.model.Resource resource
    • contentType

      protected com.janeirodigital.sai.httputils.ContentType contentType
    • jsonLdContext

      protected String jsonLdContext
    • unprotected

      protected boolean unprotected
    • exists

      protected boolean exists
  • Constructor Details

  • Method Details

    • read

      protected static okhttp3.Response read(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType, boolean unprotected) throws SaiException, com.janeirodigital.sai.httputils.SaiHttpNotFoundException
      Reads the remote RDF resource at uri, providing credentials from the SaiSession when unprotected is not true.
      Parameters:
      uri - URI to GET
      saiSession - SaiSession to use
      contentType - ContentType to accept
      unprotected - When true, does not send authorization headers
      Returns:
      OkHttp Response
      Throws:
      SaiException
      com.janeirodigital.sai.httputils.SaiHttpNotFoundException
    • checkReadableResponse

      public static okhttp3.Response checkReadableResponse(okhttp3.Response response) throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiException
      Checks the response when fetching data for a readable resource
      Parameters:
      response - Response to check
      Returns:
      Checked Response
      Throws:
      com.janeirodigital.sai.httputils.SaiHttpNotFoundException - when the resource cannot be found (HTTP 404)
      SaiException - when the response code is unsuccessful for any other reason