C# Class ALMRestClient.ALMClient

Represents the ALM system From IP at https://MYDOMAIN.saas.hp.com/qcbin/Help/doc_library/api_refs/REST/webframe.html
ファイルを表示 Open project: webcompere/ALMRestClient Class Usage Examples

Public Methods

Method Description
ALMClient ( string url, string username, string password, string domain, string project ) : System

Construct with the url (just the https://something.saas.hp.com bit)

ALMClient ( string url, string username, string password, string domain, string project, string version ) : System

Construct with the url (just the https://something.saas.hp.com bit)

Dispose ( ) : void
GetDefects ( ) : List

Get the list of defects

IsAuthenticated ( ) : bool

Checks whether the user is currently authenticated

Login ( ) : bool

Call this before calling other methods - will throw an ALMClientException on failure

Logout ( ) : bool

Logs the user out of the session

UpdateDefect ( string id, ALMItem changes ) : bool

Update an ALM item

Private Methods

Method Description
AddAuthTokensAsNecessary ( RestSharp request ) : RestSharp.IRestRequest

Adds the authentication tokens to the request if the parameters don't include them

AddDefect ( IRestRequest req ) : void

Add the defect segment

AddDefectAndId ( string id, RestRequest req ) : void

Add the defect and defect Id

AddDomainAndProject ( RestRequest req ) : void

Add the domain and project to the request

CleanRequest ( IRestRequest &request ) : void

Cleans the request before processing in an attempt to minimize errors

ConvertToFieldXml ( string>.Dictionary dictionary ) : string

Converts the dictionary into an xml string

Execute ( IRestRequest request, string message ) : IRestResponse

Executes a query against HP ALM

The session is updated before each query and doesn't need to be managed elsewhere (except for Login/Logout)

FindCookie ( RestSharp client, string cookieName, Action foundCookie ) : bool

Enumerates the client's cookie container looking for the cookie requested and calls the action when the cookie is found

FindTotal ( System.Xml.Linq.XDocument doc ) : int

Find the total count

GetExistingSessionMethod ( ) : RestSharp.Method

Determines the current session state and returns the correct action to continue working the same session

ManageServerSessions ( Func getMethod ) : bool

Manages the session credentials

ReadDefects ( List items ) : void

Get the list of defects

SetTokenFromCookies ( IRestClient clientToRead ) : void

Sets the internal tokens for reuse

ThrowExceptionIfNecessary ( IRestResponse response, string location ) : void

Throws an exception with a standard message when HideCustomExceptions is false

ThrowExceptionIfNecessary ( IRestResponse response, string location, string customMessage ) : void

Throws an exception with a standard message when HideCustomExceptions is false

Update ( string id, ALMItem changes ) : bool

Update the item

VerifyLoggedInAuthenticatedAndExtendSession ( ) : bool

Logs in and updates the server sessions which is required before executing queries.

Method Details

ALMClient() public method

Construct with the url (just the https://something.saas.hp.com bit)
public ALMClient ( string url, string username, string password, string domain, string project ) : System
url string Base url for ALM
username string username for login
password string password
domain string The domain to log into
project string The project to log into
return System

ALMClient() public method

Construct with the url (just the https://something.saas.hp.com bit)
public ALMClient ( string url, string username, string password, string domain, string project, string version ) : System
url string Base url for ALM
username string username for login
password string password
domain string The domain to log into
project string The project to log into
version string The ALM version to use
return System

Dispose() public method

public Dispose ( ) : void
return void

GetDefects() public method

Get the list of defects
public GetDefects ( ) : List
return List

IsAuthenticated() public method

Checks whether the user is currently authenticated
public IsAuthenticated ( ) : bool
return bool

Login() public method

Call this before calling other methods - will throw an ALMClientException on failure
public Login ( ) : bool
return bool

Logout() public method

Logs the user out of the session
public Logout ( ) : bool
return bool

UpdateDefect() public method

Update an ALM item
public UpdateDefect ( string id, ALMItem changes ) : bool
id string Id of the item
changes ALMItem An item containing all the fields to change
return bool