Table of Contents

Class StoreApi

Namespace
PrivMX.Endpoint.Store
Assembly
PrivMX.Endpoint.dll
public class StoreApi : IStoreApi
Inheritance
StoreApi
Implements
Inherited Members

Fields

ptr

public readonly IntPtr ptr

Field Value

IntPtr

Methods

CloseFile(long)

Closes the file handle.

public string CloseFile(long fileHandle)

Parameters

fileHandle long

Handle to read/write file data.

Returns

string

ID of closed file.

Create(Connection)

Creates an instance of the StoreApi.

public static StoreApi Create(Connection connection)

Parameters

connection Connection

Instance of Connection

Returns

StoreApi

Created instance of the StoreApi.

CreateFile(string, byte[], byte[], long)

Creates a new file in a Store.

public long CreateFile(string storeId, byte[] publicMeta, byte[] privateMeta, long size)

Parameters

storeId string

ID of the Store to create the file in.

publicMeta byte[]

Public file meta_data.

privateMeta byte[]

Private file meta_data.

size long

Size of the file.

Returns

long

Handle to write data.

CreateStore(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], ContainerPolicy?)

Creates a new Store in given Context.

public string CreateStore(string contextId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, ContainerPolicy? policies = null)

Parameters

contextId string

ID of the Context to create the Store in.

users List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Store.

managers List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.

publicMeta byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta byte[]

Private metadata that will be encrypted before being sent to the Bridge.

policies ContainerPolicy

(optional) Store policy.

Returns

string

Created Store ID.

DeleteFile(string)

Deletes a file by given ID.

public void DeleteFile(string storeId)

Parameters

storeId string

ID of the file to delete.

DeleteStore(string)

Deletes a Store by given Store ID.

public void DeleteStore(string storeId)

Parameters

storeId string

ID of the Store to delete.

~StoreApi()

protected ~StoreApi()

GetFile(string)

Gets a single file by the given file ID.

public File GetFile(string fileId)

Parameters

fileId string

ID of the file to get.

Returns

File

Information about the file.

GetStore(string)

Gets a single Store by given Store ID.

public Store GetStore(string storeId)

Parameters

storeId string

ID of the Store to get.

Returns

Store

Information about about the Store.

ListFiles(string, PagingQuery)

Gets a list of files in given Store.

public PagingList<File> ListFiles(string storeId, PagingQuery pagingQuery)

Parameters

storeId string

ID of the Store to get files from.

pagingQuery PagingQuery

List query parameters.

Returns

PagingList<File>

List of files.

ListStores(string, PagingQuery)

Gets a list of Stores in given Context.

public PagingList<Store> ListStores(string contextId, PagingQuery pagingQuery)

Parameters

contextId string

ID of the Context to get the Stores from.

pagingQuery PagingQuery

List query parameters.

Returns

PagingList<Store>

List of Stores.

OpenFile(string)

Opens a file to read.

public long OpenFile(string fileId)

Parameters

fileId string

ID of the file to read.

Returns

long

Handle to read file data.

ReadFromFile(long, long)

Reads file data.

public byte[] ReadFromFile(long fileHandle, long length)

Parameters

fileHandle long

Handle to write file data.

length long

Size of data to read.

Returns

byte[]

File data chunk.

SeekInFile(long, long)

Moves read cursor.

public void SeekInFile(long fileHandle, long position)

Parameters

fileHandle long

Handle to write file data.

position long

New cursor position.

SubscribeForFileEvents(string)

Subscribes for the events in given Store.

public void SubscribeForFileEvents(string storeId)

Parameters

storeId string

ID of the Store to subscribe for.

SubscribeForStoreEvents()

Subscribes for the Store module main events.

public void SubscribeForStoreEvents()

UnsubscribeFromFileEvents(string)

Unsubscribes from the events in given Store.

public void UnsubscribeFromFileEvents(string storeId)

Parameters

storeId string

ID of the Store to unsubscribe from.

UnsubscribeFromStoreEvents()

Unsubscribes from the Store module main events.

public void UnsubscribeFromStoreEvents()

UpdateFile(string, byte[], byte[], long)

Updates an existing file in a Store.

public long UpdateFile(string fileId, byte[] publicMeta, byte[] privateMeta, long size)

Parameters

fileId string

ID of the file to update.

publicMeta byte[]

Public file meta_data.

privateMeta byte[]

Private file meta_data.

size long

Size of the file.

Returns

long

Handle to write file data.

UpdateFileMeta(string, byte[], byte[])

Updates meta data of an existing file in a Store.

public void UpdateFileMeta(string fileId, byte[] publicMeta, byte[] privateMeta)

Parameters

fileId string

ID of the file to update.

publicMeta byte[]

Public file meta_data.

privateMeta byte[]

Private file meta_data.

UpdateStore(string, List<UserWithPubKey>, List<UserWithPubKey>, byte[], byte[], long, bool, bool, ContainerPolicy?)

Updates an existing Store.

public void UpdateStore(string storeId, List<UserWithPubKey> users, List<UserWithPubKey> managers, byte[] publicMeta, byte[] privateMeta, long version, bool force, bool forceGenerateNewKey, ContainerPolicy? policies = null)

Parameters

storeId string

ID of the Store to update.

users List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Store.

managers List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.

publicMeta byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta byte[]

Private metadata that will be encrypted before being sent to the Bridge.

version long

Current version of the updated Store.

force bool

Force update (without checking version).

forceGenerateNewKey bool

Force to renenerate a key for the Store.

policies ContainerPolicy

(optional) Store policy.

WriteToFile(long, byte[])

Writes a file data.

public void WriteToFile(long fileHandle, byte[] dataChunk)

Parameters

fileHandle long

Handle to write file data.

dataChunk byte[]

File data chunk.