// Copyright (c) 2017 schick Informatik // Description: using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; namespace bsmd.LockingService { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] public interface IService { /// /// Request a lock for a particular core /// /// true if successful [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] Guid Lock(Guid messageCoreId, Guid userId); /// /// Relinquish lock for a particular core /// [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] void Unlock(Guid messageCoreId, Guid userId); /// /// Get all locks currently in use (for search result..) /// [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] List GetLocks(); /// /// To avoid Timeout, send keepalive message /// /// currently held locks [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] void LockRefresh(List currentLocks, Guid userId); /// /// send a log message (convenience helper) /// [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] void Log(string msg, string host, Guid userId); /// /// Get current overview of sent/corrupted/open files (His-Nord) /// /// [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] ServerStatus GetStatus(); /// /// Takes this file from the "READY" Folder and copies contents back in the database (restore from unvoluntary overwrite) /// /// /// true on success [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] bool RestoreFromFile(string filename); } }