The AtomicDataAccessor interface has identical function signatures as the DataAccessor, with the additional constraint that every function call must be atomic in its effect: either the call fully succeeds, reaching the desired new state; or it fails, upon which the resulting state remains identical to the one before the call.

Hierarchy

Implemented by

Properties

canHandle: ((representation: Representation) => Promise<void>)

Type declaration

    • (representation: Representation): Promise<void>
    • Should throw a NotImplementedHttpError if the DataAccessor does not support storing the given Representation.

      Throws

      BadRequestHttpError If it does not support the incoming data.

      Parameters

      Returns Promise<void>

deleteResource: ((identifier: ResourceIdentifier) => Promise<void>)

Type declaration

getChildren: ((identifier: ResourceIdentifier) => AsyncIterableIterator<RepresentationMetadata>)

Type declaration

    • (identifier: ResourceIdentifier): AsyncIterableIterator<RepresentationMetadata>
    • Returns metadata for all resources in the requested container. This should not be all metadata of those resources (but it can be), but instead the main metadata you want to show in situations where all these resources are presented simultaneously. Generally this would be metadata that is present for all of these resources, such as resource type or last modified date.

      It can be safely assumed that the incoming identifier will always correspond to a container.

      Parameters

      Returns AsyncIterableIterator<RepresentationMetadata>

getData: ((identifier: ResourceIdentifier) => Promise<Guarded<Readable>>)

Type declaration

    • (identifier: ResourceIdentifier): Promise<Guarded<Readable>>
    • Returns a data stream stored for the given identifier. It can be assumed that the incoming identifier will always correspond to a document.

      Parameters

      Returns Promise<Guarded<Readable>>

getMetadata: ((identifier: ResourceIdentifier) => Promise<RepresentationMetadata>)

Type declaration

writeContainer: ((identifier: ResourceIdentifier, metadata: RepresentationMetadata) => Promise<void>)

Type declaration

    • (identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void>
    • Writes metadata for a container. If the container does not exist yet it should be created, if it does its metadata should be overwritten, except for the containment triples.

      Parameters

      Returns Promise<void>

writeDocument: ((identifier: ResourceIdentifier, data: Guarded<Readable>, metadata: RepresentationMetadata) => Promise<void>)

Type declaration

writeMetadata: ((identifier: ResourceIdentifier, metadata: RepresentationMetadata) => Promise<void>)

Type declaration