Class StoreApi
public class StoreApi : IStoreApi
- Inheritance
-
StoreApi
- Implements
- Inherited Members
Fields
ptr
public readonly IntPtr ptr
Field Value
Methods
CloseFile(long)
Closes the file handle.
public string CloseFile(long fileHandle)
Parameters
fileHandlelongHandle 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
connectionConnectionInstance of Connection
Returns
CreateFile(string, byte[], byte[], long)
Creates a new file in a Store.
public long CreateFile(string storeId, byte[] publicMeta, byte[] privateMeta, long size)
Parameters
storeIdstringID of the Store to create the file in.
publicMetabyte[]Public file meta_data.
privateMetabyte[]Private file meta_data.
sizelongSize 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
contextIdstringID of the Context to create the Store in.
usersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access to the created Store.
managersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
policiesContainerPolicy(optional) Store policy.
Returns
- string
Created Store ID.
DeleteFile(string)
Deletes a file by given ID.
public void DeleteFile(string storeId)
Parameters
storeIdstringID of the file to delete.
DeleteStore(string)
Deletes a Store by given Store ID.
public void DeleteStore(string storeId)
Parameters
storeIdstringID 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
fileIdstringID 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
storeIdstringID 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
storeIdstringID of the Store to get files from.
pagingQueryPagingQueryList 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
contextIdstringID of the Context to get the Stores from.
pagingQueryPagingQueryList query parameters.
Returns
- PagingList<Store>
List of Stores.
OpenFile(string)
Opens a file to read.
public long OpenFile(string fileId)
Parameters
fileIdstringID 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
Returns
- byte[]
File data chunk.
SeekInFile(long, long)
Moves read cursor.
public void SeekInFile(long fileHandle, long position)
Parameters
SubscribeForFileEvents(string)
Subscribes for the events in given Store.
public void SubscribeForFileEvents(string storeId)
Parameters
storeIdstringID 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
storeIdstringID 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
fileIdstringID of the file to update.
publicMetabyte[]Public file meta_data.
privateMetabyte[]Private file meta_data.
sizelongSize 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
fileIdstringID of the file to update.
publicMetabyte[]Public file meta_data.
privateMetabyte[]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
storeIdstringID of the Store to update.
usersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access to the created Store.
managersList<UserWithPubKey>Array of UserWithPubKey structs which indicates who will have access (and management rights) to the created Store.
publicMetabyte[]Public metadata that will remain unencrypted on the Bridge.
privateMetabyte[]Private metadata that will be encrypted before being sent to the Bridge.
versionlongCurrent version of the updated Store.
forceboolForce update (without checking version).
forceGenerateNewKeyboolForce to renenerate a key for the Store.
policiesContainerPolicy(optional) Store policy.
WriteToFile(long, byte[])
Writes a file data.
public void WriteToFile(long fileHandle, byte[] dataChunk)