Imports System.IO
Imports System.ServiceModel
Imports DigitalData.Modules.Filesystem
Imports DigitalData.Services.EDMIService.Exceptions
Imports DigitalData.Services.EDMIService.Messages

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

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

#Region "Database"
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    <FaultContract(GetType(DataTableDoesNotExistFault))>
    Function ReturnDatatableFromCache(Name As String, FilterExpression As String, SortByColumn As String) As TableResult
#End Region

#Region "Database (Firebird)"
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnDatatable_Firebird(SQL As String) As TableResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnScalar_Firebird(SQL As String) As ScalarResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ExecuteNonQuery_Firebird(SQL As String) As NonQueryResult
#End Region

#Region "Database (MSSQL IDB)"
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnDatatable_MSSQL_IDB(SQL As String) As TableResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnScalar_MSSQL_IDB(SQL As String) As ScalarResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ExecuteNonQuery_MSSQL_IDB(SQL As String) As NonQueryResult
#End Region

#Region "Database (MSSQL ECM)"
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnDatatable_MSSQL_ECM(SQL As String) As TableResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ReturnScalar_MSSQL_ECM(SQL As String) As ScalarResult

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ExecuteNonQuery_MSSQL_ECM(SQL As String) As NonQueryResult
#End Region

#Region "Document (New)"
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ImportFile(Data As DocumentImportRequest) As DocumentImportResponse

    <OperationContract>
    <FaultContract(GetType(ObjectDoesNotExistFault))>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function GetFileByObjectId(Data As DocumentStreamRequest) As DocumentStreamResponse

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function GetFileInfoByObjectId(Data As DocumentInfoRequest) As DocumentInfoResponse

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ListFilesForUser() As DocumentListResponse

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function New_FileStore_Object(IDB_OBJ_ID As Long, pStoreType As String, pDate As String, pExtension As String, pKeepExtension As Boolean) As String
    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function New_IDB_OBJECT(KindType As String, pWho As String, pBusinessEntity As String) As String

    <OperationContract>
    <FaultContract(GetType(UnexpectedErrorFault))>
    Function ImportNewIDBFO(Data As DocumentImportIDBFORequest) As DocumentImportIDBFOResponse
#End Region

End Interface