Interface AtomicResourceStore

A ResourceStore of which all operations are atomic.

interface AtomicResourceStore {
    addResource: ((container: ResourceIdentifier, representation: Representation, conditions?: Conditions) => Promise<ChangeMap>);
    deleteResource: ((identifier: ResourceIdentifier, conditions?: Conditions) => Promise<ChangeMap>);
    getRepresentation: ((identifier: ResourceIdentifier, preferences: RepresentationPreferences, conditions?: Conditions) => Promise<Representation>);
    hasResource: ((identifier: ResourceIdentifier) => Promise<boolean>);
    modifyResource: ((identifier: ResourceIdentifier, patch: Patch, conditions?: Conditions) => Promise<ChangeMap>);
    setRepresentation: ((identifier: ResourceIdentifier, representation: Representation, conditions?: Conditions) => Promise<ChangeMap>);
}

Hierarchy (view full)

Implemented by

Properties

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

Creates a new resource in the container.

Type declaration

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

Deletes a resource.

Type declaration

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

Retrieves a representation of a resource.

Type declaration

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

Checks whether a resource exists in this ResourceSet.

Type declaration

    • (identifier): Promise<boolean>
    • Parameters

      Returns Promise<boolean>

      A promise resolving if the resource already exists.

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

Sets or updates the representation of a resource, creating a new resource and intermediary containers as needed.

Type declaration

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

Sets or replaces the representation of a resource, creating a new resource and intermediary containers as needed.

Type declaration