IRepositoryDataSource
Namespace: Meshmakers.Octo.Runtime.Contracts.Repositories
Interface for the data source of a runtime repository
public interface IRepositoryDataSource
Properties
TenantId
Returns the corresponding tenant id
public abstract string TenantId { get; }
Property Value
BinaryDataSource
Returns the binary data source for the repository
public abstract ILinkedBinaryDataSource BinaryDataSource { get; }
Property Value
RtAssociations
Returns the associations collection
public abstract IDataSourceCollection<OctoObjectId, RtAssociation> RtAssociations { get; }
Property Value
IDataSourceCollection<OctoObjectId, RtAssociation>
Methods
GetRtCollection<TEntity>(CkTypeGraph)
Returns the data source access object for the given entity type
IDataSourceCollection<OctoObjectId, TEntity> GetRtCollection<TEntity>(CkTypeGraph ckTypeGraph)
Type Parameters
TEntity
The type of entity derived from <see cref="RtEntity"/>
Parameters
ckTypeGraph
CkTypeGraph
Construction kit type graph object
Returns
IDataSourceCollection<OctoObjectId, TEntity>
GetRtAssociationsAsync(IOctoSession, OctoObjectId, GraphDirections)
Gets associations for a runtime entity.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, OctoObjectId rtId, GraphDirections direction)
Parameters
session
IOctoSession
The session object
rtId
OctoObjectId
Object id of the runtime entity
direction
GraphDirections
Direction of associations to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, IEnumerable<OctoObjectId>, GraphDirections)
Gets associations for multiple runtime entities.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<OctoObjectId> rtIds, GraphDirections direction)
Parameters
session
IOctoSession
The session object
rtIds
IEnumerable<OctoObjectId>
Object id of runtime entities
direction
GraphDirections
Direction of associations to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, OctoObjectId, GraphDirections, CkId<CkAssociationRoleId>)
Gets associations for a runtime entity of a specific role
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, OctoObjectId rtId, GraphDirections direction, CkId<CkAssociationRoleId> roleId)
Parameters
session
IOctoSession
The session object
rtId
OctoObjectId
Object id of the runtime entity
direction
GraphDirections
Direction of associations to get
roleId
CkId<CkAssociationRoleId>
The construction kit role to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsAsync(IOctoSession, IEnumerable<OctoObjectId>, GraphDirections, CkId<CkAssociationRoleId>)
Gets associations for a runtime entity of a specific role
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<OctoObjectId> rtIds, GraphDirections direction, CkId<CkAssociationRoleId> roleId)
Parameters
session
IOctoSession
The session object
rtIds
IEnumerable<OctoObjectId>
Object id of runtime entities
direction
GraphDirections
Direction of associations to get
roleId
CkId<CkAssociationRoleId>
The construction kit role to get
Returns
Task<IReadOnlyList<RtAssociation>>
GetRtAssociationsMultiplicityAsync(IOctoSession, IEnumerable<RtEntityRoleIdDirectionPair>)
Returns the current multiplicity of a runtime association, that means the number of associations that exist for a give runtime entity and role
Task<IReadOnlyList<RtAssociationsMultiplicityResult>> GetRtAssociationsMultiplicityAsync(IOctoSession session, IEnumerable<RtEntityRoleIdDirectionPair> entityRoleIdDirectionPairs)
Parameters
session
IOctoSession
The session object
entityRoleIdDirectionPairs
IEnumerable<RtEntityRoleIdDirectionPair>
Direction pairs of runtime entity and role id
Returns
Task<IReadOnlyList<RtAssociationsMultiplicityResult>>
GetRtAssociationOrDefaultAsync(IOctoSession, RtEntityId, RtEntityId, CkId<CkAssociationRoleId>)
Gets an association by its origin, target and role id.
Task<RtAssociation> GetRtAssociationOrDefaultAsync(IOctoSession session, RtEntityId originRtEntityId, RtEntityId targetRtEntityId, CkId<CkAssociationRoleId> ckRoleId)
Parameters
session
IOctoSession
The session object
originRtEntityId
RtEntityId
Runtime id of the origin entity
targetRtEntityId
RtEntityId
Runtime id of the target entity
ckRoleId
CkId<CkAssociationRoleId>
Construction kit role id of the association
Returns
Task<RtAssociation>
An association object or null if not found
GetRtAssociationsAsync(IOctoSession, IEnumerable<RtOriginTargetPair>)
Gets associations by origin, target and role id for multiple pairs.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<RtOriginTargetPair> rtOriginTargetPair)
Parameters
session
IOctoSession
The session object
rtOriginTargetPair
IEnumerable<RtOriginTargetPair>
Pairs of origin and target runtime entity identifiers
Returns
Task<IReadOnlyList<RtAssociation>>
The list of associations
CreateTransientRtAssociation(RtEntityId, CkId<CkAssociationRoleId>, RtEntityId)
Creates an instance of a runtime association
RtAssociation CreateTransientRtAssociation(RtEntityId originRtEntityId, CkId<CkAssociationRoleId> ckRoleId, RtEntityId targetRtEntityId)
Parameters
originRtEntityId
RtEntityId
Runtime id of the origin entity
ckRoleId
CkId<CkAssociationRoleId>
Construction kit role id of the association
targetRtEntityId
RtEntityId
Runtime id of the target entity
Returns
RtAssociation
A transient version of a role, need to be stored.
UploadTemporaryBinaryAsync(IOctoSession, String, String, DateTime, Stream, CancellationToken)
Uploads a large binary file to the repository
Task<OctoObjectId> UploadTemporaryBinaryAsync(IOctoSession session, string filename, string contentType, DateTime expiryDateTime, Stream stream, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
filename
String
Filename of the file
contentType
String
Content type of the file
expiryDateTime
DateTime
Expiry date time of the file
stream
Stream
Binary stream of the file
cancellationToken
CancellationToken
An optional cancellation token
Returns
ReplaceTemporaryLargeBinaryAsync(IOctoSession, String, String, Stream, CancellationToken)
Replaces a large binary file in the repository based on the filename and binary type
Task<OctoObjectId> ReplaceTemporaryLargeBinaryAsync(IOctoSession session, string filename, string contentType, Stream stream, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
filename
String
Filename of the file
contentType
String
Content type of the file
stream
Stream
Stream of the file
cancellationToken
CancellationToken
An optional cancellation token
Returns
Task<OctoObjectId>
Object id of the large binary
DeleteTemporaryLargeBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)
Deletes a large binary file from the repository
Task DeleteTemporaryLargeBinaryAsync(IOctoSession session, OctoObjectId largeBinaryId, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
largeBinaryId
OctoObjectId
Object id of the large binary
cancellationToken
CancellationToken
An optional cancellation token
Returns
DownloadBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)
Downloads a large binary file from the repository based on the large binary id
Task<IDownloadStreamHandler> DownloadBinaryAsync(IOctoSession session, OctoObjectId largeBinaryId, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
largeBinaryId
OctoObjectId
Object id of the large binary
cancellationToken
CancellationToken
An optional cancellation token
Returns
Task<IDownloadStreamHandler>
Handler for the download stream
GetTemporaryBinaryAsync(IOctoSession, OctoObjectId, CancellationToken)
Gets a large binary file from the repository based on the object id
Task<IBinaryInfo> GetTemporaryBinaryAsync(IOctoSession session, OctoObjectId binaryId, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
binaryId
OctoObjectId
Binary id of the file
cancellationToken
CancellationToken
Optional cancellation token
Returns
Task<IBinaryInfo>
Binary info of the file including size, content type, etc.
GetTemporaryBinaryAsync(IOctoSession, String, CancellationToken)
Gets a large binary file from the repository based on the filename and binary type
Task<IBinaryInfo> GetTemporaryBinaryAsync(IOctoSession session, string fileName, CancellationToken cancellationToken)
Parameters
session
IOctoSession
Session object for transaction handling
fileName
String
Filename of the file
cancellationToken
CancellationToken
Optional cancellation token
Returns
Task<IBinaryInfo>
Binary info of the file including size, content type, etc.