C# Class Microsoft.Research.DataOnboarding.FileService.SkyDriveFileService

Inheritance: FileServiceProvider
显示文件 Open project: CDLUC3/dataup2 Class Usage Examples

Public Methods

Method Description
CheckIfFileExistsOnExternalRepository ( Microsoft.Research.DataOnboarding.Utilities.Model.VerifyFileMessage verifyFileMessage ) : OperationStatus

Verifies if the file exists in the repository

DownLoadFileFromRepository ( Microsoft.Research.DataOnboarding.DomainModel.File file, Microsoft.Research.DataOnboarding.DomainModel.Repository repository, Microsoft.Research.DataOnboarding.DomainModel.User user, RepositoryCredentials credentials ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

Downloads the File from Repository

PublishFile ( PublishMessage publishModel ) : string

Method to publish file

SkyDriveFileService ( IFileRepository fileDataRepository, IBlobDataRepository blobDataRepository, IUnitOfWork unitOfWork, IRepositoryDetails repositoryDetails, IRepositoryService repositoryService, IUserService userService, IRepositoryAdapterFactory repositoryAdapterFactory ) : Microsoft.Research.DataOnboarding.DataAccessService

Initializes a new instance of the SkyDriveFileService class.

ValidateForPublish ( PublishMessage message ) : void

Performs the necessary validations required for the file to be published in skydrive

Private Methods

Method Description
GetAuthTokens ( Microsoft.Research.DataOnboarding.DomainModel.Repository repository, int userId ) : AuthToken

Returns the AuthToken for the Repository and User

GetOrUpdateAuthTokens ( Microsoft.Research.DataOnboarding.DomainModel.Repository repository, AuthToken userAuthToken ) : AuthToken

Gets or updates the AuthTokens

RefreshAccessToken ( Microsoft.Research.DataOnboarding.DomainModel.Repository repository, AuthToken token ) : AuthToken

validates if the token is expired

SaveFile ( Microsoft.Research.DataOnboarding.Utilities.Model.PostFileModel postFileData ) : bool

Method Details

CheckIfFileExistsOnExternalRepository() public method

Verifies if the file exists in the repository
public CheckIfFileExistsOnExternalRepository ( Microsoft.Research.DataOnboarding.Utilities.Model.VerifyFileMessage verifyFileMessage ) : OperationStatus
verifyFileMessage Microsoft.Research.DataOnboarding.Utilities.Model.VerifyFileMessage Verify File Message
return Microsoft.Research.DataOnboarding.Utilities.OperationStatus

DownLoadFileFromRepository() public method

Downloads the File from Repository
public DownLoadFileFromRepository ( Microsoft.Research.DataOnboarding.DomainModel.File file, Microsoft.Research.DataOnboarding.DomainModel.Repository repository, Microsoft.Research.DataOnboarding.DomainModel.User user, RepositoryCredentials credentials ) : Microsoft.Research.DataOnboarding.Utilities.Model.DataFile
file Microsoft.Research.DataOnboarding.DomainModel.File File object.
repository Microsoft.Research.DataOnboarding.DomainModel.Repository Repository instance.
user Microsoft.Research.DataOnboarding.DomainModel.User User instance.
credentials Microsoft.Research.DataOnboarding.Utilities.Model.RepositoryCredentials credentials required by the repository.
return Microsoft.Research.DataOnboarding.Utilities.Model.DataFile

PublishFile() public method

Method to publish file
public PublishFile ( PublishMessage publishModel ) : string
publishModel Microsoft.Research.DataOnboarding.Utilities.Model.PublishMessage
return string

SkyDriveFileService() public method

Initializes a new instance of the SkyDriveFileService class.
public SkyDriveFileService ( IFileRepository fileDataRepository, IBlobDataRepository blobDataRepository, IUnitOfWork unitOfWork, IRepositoryDetails repositoryDetails, IRepositoryService repositoryService, IUserService userService, IRepositoryAdapterFactory repositoryAdapterFactory ) : Microsoft.Research.DataOnboarding.DataAccessService
fileDataRepository IFileRepository IFileRepository instance.
blobDataRepository IBlobDataRepository IBlobDataRepository instance.
unitOfWork IUnitOfWork IUnitOfWork instance.
repositoryDetails IRepositoryDetails IRepositoryDetails instance.
repositoryService IRepositoryService IRepositoryService instance.
userService IUserService IUserService instance
repositoryAdapterFactory IRepositoryAdapterFactory IRepositoryAdapterFactory instance.
return Microsoft.Research.DataOnboarding.DataAccessService

ValidateForPublish() public method

Performs the necessary validations required for the file to be published in skydrive
public ValidateForPublish ( PublishMessage message ) : void
message Microsoft.Research.DataOnboarding.Utilities.Model.PublishMessage Publish Message
return void