Interface AtomicResourceStore

A ResourceStore of which all operations are atomic.

Hierarchy

Implemented by

Properties

addResource: ((container, representation, conditions?) => Promise<ChangeMap>)

Type declaration

    • (container, representation, conditions?): Promise<ChangeMap>
    • Creates a new resource in the container.

      Parameters

      • container: ResourceIdentifier

        Container in which to create a resource.

      • representation: Representation

        Representation of the new resource

      • Optional conditions: Conditions

        Optional conditions under which to proceed.

      Returns Promise<ChangeMap>

      A ChangeMap.

deleteResource: ((identifier, conditions?) => Promise<ChangeMap>)

Type declaration

getRepresentation: ((identifier, preferences, conditions?) => Promise<Representation>)

Type declaration

    • (identifier, preferences, conditions?): Promise<Representation>
    • Retrieves a representation of a resource.

      Parameters

      Returns Promise<Representation>

      A representation corresponding to the identifier.

hasResource: ((identifier) => Promise<boolean>)

Type declaration

    • (identifier): Promise<boolean>
    • Check if a resource exists in this ResourceSet.

      Parameters

      Returns Promise<boolean>

      A promise resolving if the resource already exists.

modifyResource: ((identifier, patch, conditions?) => Promise<ChangeMap>)

Type declaration

    • (identifier, patch, conditions?): Promise<ChangeMap>
    • Sets or updates the representation of a resource, creating a new resource and intermediary containers as needed.

      Parameters

      • identifier: ResourceIdentifier

        Identifier of resource to update.

      • patch: Patch

        Description of which parts to update.

      • Optional conditions: Conditions

        Optional conditions under which to proceed.

      Returns Promise<ChangeMap>

      A ChangeMap.

setRepresentation: ((identifier, representation, conditions?) => Promise<ChangeMap>)

Type declaration

    • (identifier, representation, conditions?): Promise<ChangeMap>
    • Sets or replaces the representation of a resource, creating a new resource and intermediary containers as needed.

      Parameters

      Returns Promise<ChangeMap>

      A ChangeMap.