C# Class Microsoft.Protocols.TestSuites.MS_WOPI.WOPIResourceUrlCache

A class is used to support WOPI resource URL cache function.
Show file Open project: OfficeDev/Interop-TestSuites Class Usage Examples

Public Methods

Method Description
AddWOPIResourceUrl ( string userName, string domain, string absoluteFileUrl, string wopiResourceUrl ) : void

A method is used to add a WOPI resource URL mapping record into the cache. The record is determined by the domain\user and the file url.

TryGetWOPIResourceUrl ( string userName, string domain, string absoluteFileUrl, string &wopiResourceUrl ) : bool

A method is used to verify whether a WOPI resource URL mapping record exists in cache. The WOPI resource url record is determined by the domain\user and the file url.

Protected Methods

Method Description
GetUrlMappingCollectionByFullUserName ( string fullUserName, bool isCreateNewForNotExistUser = true ) : string>.Dictionary

A method is used to get URL mapping collection by specified full user name. If the cache dose not include the specified user, this method will append a new record to catch, and return the new mapping collection which is used to store the mapping between the file URL and WOPI URL.

Method Details

AddWOPIResourceUrl() public static method

A method is used to add a WOPI resource URL mapping record into the cache. The record is determined by the domain\user and the file url.
public static AddWOPIResourceUrl ( string userName, string domain, string absoluteFileUrl, string wopiResourceUrl ) : void
userName string A parameter represents the user name.
domain string A parameter represents the domain name.
absoluteFileUrl string A parameter represents the file URL. It must be absolute URL.
wopiResourceUrl string A parameter represents the WOPI resource URL.
return void

GetUrlMappingCollectionByFullUserName() protected static method

A method is used to get URL mapping collection by specified full user name. If the cache dose not include the specified user, this method will append a new record to catch, and return the new mapping collection which is used to store the mapping between the file URL and WOPI URL.
protected static GetUrlMappingCollectionByFullUserName ( string fullUserName, bool isCreateNewForNotExistUser = true ) : string>.Dictionary
fullUserName string A parameter represents the full user name, its format is domain\username.
isCreateNewForNotExistUser bool A parameter represents a bool value indicating whether create new mapping collection if the cache does not contain the specified user. 'true' means the method will create new mapping collection, default value is 'true'
return string>.Dictionary

TryGetWOPIResourceUrl() public static method

A method is used to verify whether a WOPI resource URL mapping record exists in cache. The WOPI resource url record is determined by the domain\user and the file url.
public static TryGetWOPIResourceUrl ( string userName, string domain, string absoluteFileUrl, string &wopiResourceUrl ) : bool
userName string A parameter represents the user name.
domain string A parameter represents the domain name.
absoluteFileUrl string A parameter represents the file URL. It must be absolute URL.
wopiResourceUrl string An out parameter represents the WOPI resource URL when this method returns. If this method could not get the WOPI resource URL, this value will be string.Empty.
return bool