using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using BO.AppServer.Metadata.Dto;
using BO.AppServer.Metadata.Enums;

namespace Connector.PS
{
    public interface IConnectionPS : IDisposable
    {
        Task<IEnumerable<DocumentRDto>> GetDocumentsAsync(DocumentsScopeEnums scope);
        Task<DocumentStatusEnum> GetDocumentStateAsync(long documentId);
        Task<DocumentRDto> GetDocumentInfoAsync(long documentId);
        Task<DocumentStatusEnum> SetDocumentStateAsync(long documentId, DocumentStatusEnum status);
        Task<Stream> GetDocumentContentAsync(long documentId, long artifactId);
        Task<ArtifactRDto> SetDocumentContentAsync(long documentId, string fileName, string mimeType, bool overwriteIfExists, Stream contentStream);
        bool IsOpen { get; }
        void Open(string userName, string userPassword, string magicKey);
        void Close();
        bool Ping(out TimeSpan duration, out string status);
    }
}