Home Reference Source Repository
public class | source

Store

The store handles changes and distributes actions to the storage drivers.

Constructor Summary

Public Constructor
public

constructor(projectStrategy: ProjectStrategy, distributor: Distributor)

Create a new store instance.

Member Summary

Protected Members
protected

A composite class that passes calls along to all storage drivers

protected

Cached version of the project collection

protected

Storage for project data

Method Summary

Public Methods
public

Apply a change to the store

public

Apply multiple changes to the store

public

delItem(projectId: String, schemaId: String, itemId: String): Promise

Remove an item

public

Retrieve all projects at all versions

public

putItem(projectId: String, schemaId: String, item: Item, projectVersion: Number): Promise

Store an item

Protected Methods
protected

Retrieve a project collection, reused once loaded (singleton)

protected

Remove a project

protected

tagProject(projectId: String): Promise

Tag a project

Public Constructors

public constructor(projectStrategy: ProjectStrategy, distributor: Distributor) source

Create a new store instance.

Params:

NameTypeAttributeDescription
projectStrategy ProjectStrategy

Storage for project data

distributor Distributor

A composite class that passes calls along to all storage drivers

Protected Members

protected distributor: Distributor source

A composite class that passes calls along to all storage drivers

protected projectCollection: ProjectCollection source

Cached version of the project collection

protected projectStrategy: ProjectStrategy source

Storage for project data

Public Methods

public applyChange(change: Change): Promise source

Apply a change to the store

Params:

NameTypeAttributeDescription
change Change

Return:

Promise

public applyChanges(changes: Changes): Promise source

Apply multiple changes to the store

Params:

NameTypeAttributeDescription
changes Changes

Array of changes

Return:

Promise

public delItem(projectId: String, schemaId: String, itemId: String): Promise source

Remove an item

Params:

NameTypeAttributeDescription
projectId String
schemaId String
itemId String

Return:

Promise

public getAllProjects(): Object source

Retrieve all projects at all versions

Return:

Object

All projects

public putItem(projectId: String, schemaId: String, item: Item, projectVersion: Number): Promise source

Store an item

Params:

NameTypeAttributeDescription
projectId String
schemaId String
item Item
projectVersion Number

Return:

Promise

Protected Methods

protected getProjectCollection(): ProjectCollection source

Retrieve a project collection, reused once loaded (singleton)

protected removeProject(projectId: String): Promise source

Remove a project

Params:

NameTypeAttributeDescription
projectId String

Return:

Promise

protected tagProject(projectId: String): Promise source

Tag a project

Params:

NameTypeAttributeDescription
projectId String

Return:

Promise