Package com.janeirodigital.sai.core.data
Class DataRegistry
java.lang.Object
com.janeirodigital.sai.core.resources.ReadableResource
com.janeirodigital.sai.core.resources.CRUDResource
com.janeirodigital.sai.core.data.DataRegistry
Modifiable instantiation of an
Data Registry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forDataRegistryinstances.static classClass for access and iteration ofDataRegistrations. -
Field Summary
Fields inherited from class com.janeirodigital.sai.core.resources.ReadableResource
contentType, dataset, exists, httpClient, jsonLdContext, resource, saiSession, unprotected, uri -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DataRegistration registration) Add aDataRegistrationto theDataRegistrystatic DataRegistryget(URI uri, SaiSession saiSession) Callget(URI, SaiSession, ContentType)without specifying a desired content type for retrievalstatic DataRegistryget(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType) Get aDataRegistryat the provideduribooleanisEmpty()Indicate whether theDataRegistryhas anyDataRegistrationsreload()Reload a new instance ofDataRegistryusing the attributes of the current instancevoidremove(DataRegistration registration) Remove aDataRegistrationfrom theDataRegistryMethods inherited from class com.janeirodigital.sai.core.resources.CRUDResource
delete, updateMethods inherited from class com.janeirodigital.sai.core.resources.ReadableResource
checkReadableResponse, read
-
Method Details
-
get
public static DataRegistry get(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType) throws SaiException, com.janeirodigital.sai.httputils.SaiHttpNotFoundException Get aDataRegistryat the provideduri- Parameters:
uri- URI of theDataRegistryto getsaiSession-SaiSessionto assigncontentType-ContentTypeto use- Returns:
- Retrieved
DataRegistry - Throws:
SaiExceptioncom.janeirodigital.sai.httputils.SaiHttpNotFoundException
-
get
public static DataRegistry get(URI uri, SaiSession saiSession) throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiException Callget(URI, SaiSession, ContentType)without specifying a desired content type for retrieval- Parameters:
uri- URI of theDataRegistrysaiSession-SaiSessionto assign- Returns:
- Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundExceptionSaiException
-
reload
public DataRegistry reload() throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiExceptionReload a new instance ofDataRegistryusing the attributes of the current instance- Returns:
- Reloaded
DataRegistry - Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundExceptionSaiException
-
isEmpty
public boolean isEmpty()Indicate whether theDataRegistryhas anyDataRegistrations- Returns:
- true if there are no registrations
-
add
Add aDataRegistrationto theDataRegistry- Parameters:
registration-DataRegistrationto add- Throws:
SaiExceptionSaiAlreadyExistsException
-
remove
Remove aDataRegistrationfrom theDataRegistry- Parameters:
registration-DataRegistrationto remove
-