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, IEnumerable<RtEntityId>, RtAssociationExtendedQueryOptions)
Gets associations for multiple runtime entities.
Task<IMultipleOriginResultSet<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<RtEntityId> rtEntityIds, RtAssociationExtendedQueryOptions associationExtendedQueryOptions)
Parameters
session IOctoSession
The session object
rtEntityIds IEnumerable<RtEntityId>
Runtime entity identifiers to get associations for
associationExtendedQueryOptions RtAssociationExtendedQueryOptions
Options of the association query
Returns
Task<IMultipleOriginResultSet<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, RtCkId<CkAssociationRoleId>)
Gets an association by its origin, target and role id.
Task<RtAssociation> GetRtAssociationOrDefaultAsync(IOctoSession session, RtEntityId originRtEntityId, RtEntityId targetRtEntityId, RtCkId<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 RtCkId<CkAssociationRoleId>
Construction kit role id of the association
Returns
Task<RtAssociation>
An association object or null if not found
GetRtAssociationsAsync(IOctoSession, IEnumerable<RtOriginTargetPair>, RtAssociationBaseQueryOptions)
Gets associations by origin, target and role id for multiple pairs.
Task<IReadOnlyList<RtAssociation>> GetRtAssociationsAsync(IOctoSession session, IEnumerable<RtOriginTargetPair> rtOriginTargetPair, RtAssociationBaseQueryOptions associationQueryOptions)
Parameters
session IOctoSession
The session object
rtOriginTargetPair IEnumerable<RtOriginTargetPair>
Pairs of origin and target runtime entity identifiers
associationQueryOptions RtAssociationBaseQueryOptions
Options of the association query
Returns
Task<IReadOnlyList<RtAssociation>>
The list of associations
CreateTransientRtAssociation(RtEntityId, RtCkId<CkAssociationRoleId>, RtEntityId)
Creates an instance of a runtime association
RtAssociation CreateTransientRtAssociation(RtEntityId originRtEntityId, RtCkId<CkAssociationRoleId> ckRoleId, RtEntityId targetRtEntityId)
Parameters
originRtEntityId RtEntityId
Runtime id of the origin entity
ckRoleId RtCkId<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.
DeleteExpiredTemporaryLargeBinariesAsync(IOctoSession, DateTime, CancellationToken)
Deletes all expired temporary large binaries from the repository. This method is typically called by a background job to clean up expired files.
Task DeleteExpiredTemporaryLargeBinariesAsync(IOctoSession session, DateTime expiryDateTime, CancellationToken cancellationToken)
Parameters
session IOctoSession
Session object for transaction handling
expiryDateTime DateTime
Expiry date time to filter expired binaries
cancellationToken CancellationToken
Optional cancellation token
Returns
DeleteAllTemporaryLargeBinariesAsync(IOctoSession, CancellationToken)
Deletes all temporary large binaries from the repository. This method is typically called by a background job to clean up all temporary files.
Task DeleteAllTemporaryLargeBinariesAsync(IOctoSession session, CancellationToken cancellationToken)
Parameters
session IOctoSession
Session object for transaction handling
cancellationToken CancellationToken
Optional cancellation token