82 lines
2.6 KiB
C#
82 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
using System.ServiceModel;
|
|
using System.Xml;
|
|
using BeWo.Data;
|
|
using BeWo.Service.ServiceContracts;
|
|
using BeWo.Service.ServiceProxy;
|
|
using BeWo.Service.ServiceUtils.Paths;
|
|
using BeWo.Service.ServiceUtils.Update;
|
|
using BS.SharedLauncher.DataContract;
|
|
using BS.SharedLauncher.Enums;
|
|
using BS.SharedLauncher.Exceptions;
|
|
using BS.SharedLauncher.Extensions;
|
|
using BS.SharedLauncher.Information;
|
|
using BS.SharedLauncher.Logic;
|
|
using BS.SharedLauncher.Update;
|
|
|
|
namespace BeWo.Service.ServiceImplementations
|
|
{
|
|
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
|
|
public class DownloadBeWoServiceImp : IDownloadBeWoService
|
|
{
|
|
public string Tenant => MultitenancyOperationContextExt.Current.Tenant;
|
|
|
|
public UpdateFileResponse Download2(UpdatePlanRequest request)
|
|
{
|
|
return null;
|
|
}
|
|
public UpdatePlanResponse DownloadInfo(UpdatePlanRequest request)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public UpdatePlanResponse GetUpdatePlan(UpdatePlanRequest request)
|
|
{
|
|
try
|
|
{
|
|
var exception = UpdateRequestValidator.IsUpdatePlanRequestValid(request, Tenant);
|
|
if (exception is object)
|
|
throw new InvalidUpdatePlanRequestException(exception);
|
|
|
|
var response = UpdatePlanResponseHelper.GetUpdatePlanResponse(request, Tenant);
|
|
|
|
return response;
|
|
}
|
|
catch (UpdateException update)
|
|
{
|
|
throw update;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new UpdateException("Update - GetUpdatePlan - Exception", ex);
|
|
}
|
|
}
|
|
|
|
public UpdateFileResponse GetUpdateFile(UpdateFileRequest request)
|
|
{
|
|
try
|
|
{
|
|
var exception = UpdateRequestValidator.IsUpdateFileRequestValid(request, Tenant);
|
|
if (exception is object)
|
|
throw new InvalidUpdateFileRequestException(exception);
|
|
|
|
var response = UpdateFileResponseHelper.GetUpdateFileResponse(request, Tenant);
|
|
|
|
return response;
|
|
}
|
|
catch (UpdateException update)
|
|
{
|
|
throw update;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new UpdateException("Update - GetUpdateFile - Exception", ex);
|
|
}
|
|
}
|
|
}
|
|
} |