FileTransferWs.asmx.cs 1.73 KB
Newer Older
Vaclav Svaton's avatar
Vaclav Svaton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using HaaSMiddleware.ServiceTier.FileTransfer;
using org.apache.etch.EtchServiceTier.types.EtchServiceTier;

namespace HaaSMiddleware.WebServices {
	/// <summary>
	/// Summary description for FileTransferWs
	/// </summary>
	[WebService(Namespace = "http://hpcaas.it4i.cz/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	[System.Web.Script.Services.ScriptService]
	public class FileTransferWs : System.Web.Services.WebService {
		private IFileTransferService service = new FileTransferService();

		[WebMethod]
		public FileTransferMethodExt GetFileTransferMethod(long submittedJobInfoId, string sessionCode) {
			return service.GetFileTransferMethod(submittedJobInfoId, sessionCode);
		}

		[WebMethod]
		public void EndFileTransfer(long submittedJobInfoId, FileTransferMethodExt usedTransferMethod, string sessionCode) {
			service.EndFileTransfer(submittedJobInfoId, usedTransferMethod, sessionCode);
		}

		[WebMethod]
		public JobFileContentExt[] DownloadPartsOfJobFilesFromCluster(long submittedJobInfoId, TaskFileOffsetExt[] taskFileOffsets, string sessionCode) {
			return service.DownloadPartsOfJobFilesFromCluster(submittedJobInfoId, taskFileOffsets, sessionCode);
		}

		[WebMethod]
		public string[] ListChangedFilesForJob(long submittedJobInfoId, string sessionCode) {
			return service.ListChangedFilesForJob(submittedJobInfoId, sessionCode);
		}

		[WebMethod]
		public byte[] DownloadFileFromCluster(long submittedJobInfoId, string relativeFilePath, string sessionCode) {
			return service.DownloadFileFromCluster(submittedJobInfoId, relativeFilePath, sessionCode);
		}
	}
}