Imports System.IO
Imports System.ServiceModel
Imports DigitalData.Modules.Filesystem

<ServiceContract(Name:="IEDMIService", [Namespace]:="http://DigitalData.Services.EDMIService")>
Interface IEDMIService

#Region "Heartbeat"
    <OperationContract>
    Function Heartbeat() As Boolean
#End Region

#Region "Database"
    <OperationContract>
    Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String

    <OperationContract>
    Sub CloseDatabaseRequest()

    <OperationContract>
    Function ReturnDatatable(SQL As String) As TableResult

    <OperationContract>
    Function ReturnScalar(SQL As String) As ScalarResult

    <OperationContract>
    Function ExecuteNonQuery(SQL As String) As NonQueryResult
#End Region

#Region "Document (with FileContainer)"
    <OperationContract>
    Function NewFile(FileName As String, Contents As Byte()) As DocumentResultOld

    <OperationContract>
    Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResultOld

    <OperationContract>
    Function GetFile(DocObject As DocumentObject) As DocumentResultOld

    <OperationContract>
    Function DeleteFile(DocObject As DocumentObject) As Boolean

    <OperationContract>
    Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResultOld

    <OperationContract>
    Function GetDocumentByContainerId(ContainerId As String) As DocumentResultOld
#End Region

#Region "Document (New)"
    <OperationContract>
    Function ImportFile(FileName As String, Contents As Byte(), ObjectStoreId As Int64, DocumentType As String, Optional RetentionDays As Int64 = Nothing) As DocumentResult

    <OperationContract>
    Function GetFileByObjectId(Data As Messages.DocumentStreamRequest) As Messages.DocumentStreamResponse

    <OperationContract>
    Function ListFilesForUser() As Messages.DocumentListResponse
#End Region

#Region "Index"
    <OperationContract>
    Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult
#End Region

End Interface