Exemplo n.º 1
0
        private CommandResponse GetDocumentServiceLicense()
        {
            if (!CoreBaseSettings.Standalone)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(FilesLinkUtility.DocServiceCommandUrl))
            {
                return(null);
            }

            var cacheKey        = "DocumentServiceLicense";
            var commandResponse = Cache.Get <CommandResponse>(cacheKey);

            if (commandResponse == null)
            {
                commandResponse = DocumentService.CommandRequest(
                    FileUtility,
                    FilesLinkUtility.DocServiceCommandUrl,
                    DocumentService.CommandMethod.License,
                    null,
                    null,
                    null,
                    null,
                    FileUtility.SignatureSecret);
                Cache.Insert(cacheKey, commandResponse, DateTime.UtcNow.Add(CACHE_EXPIRATION));
            }

            return(commandResponse);
        }