Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
SRMClientRequest Class Reference

Class to represent a request which may be used for multiple operations, for example calling getTURLs() sets the request token in the request object (for a v2.2 client) and then same object is passed to releaseGet(). More...

#include <SRMClient.h>

Collaboration diagram for SRMClientRequest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SRMClientRequest (std::list< std::string > urls) throw (SRMInvalidRequestException)
 Creates a request object with multiple SURLs.
 SRMClientRequest (std::string url="", std::string id="") throw (SRMInvalidRequestException)
 Creates a request object with a single SURL.
void request_id (int id)
 set and get request id
int request_id ()
void request_token (char *token)
 set and get request token
std::string request_token ()
void file_ids (std::list< int > ids)
 set and get file id list
std::list< int > file_ids ()
void space_token (std::string token)
 set and get space token
std::string space_token ()
std::list< std::string > surls ()
 get SURLs
void surl_statuses (std::string surl, SRMFileLocality locality)
 set and get surl statuses
std::map< std::string,
SRMFileLocality
surl_statuses ()
void surl_failures (std::string surl, std::string reason)
 set and get surl failures
std::map< std::string,
std::string > 
surl_failures ()
void waiting_time (int wait_time)
 set and get waiting time
int waiting_time ()
void finished_success ()
 set and get status of request
void finished_partial_success ()
void finished_error ()
void finished_abort ()
void cancelled ()
SRMRequestStatus status ()
void long_list (bool list)
 set and get long list flag
bool long_list ()

Private Attributes

std::map< std::string,
SRMFileLocality
_surls
 The SURLs of the files involved in the request, mapped to their locality.
int _request_id
 int ids are used in SRM1
std::string _request_token
 string request tokens (eg "-21249586") are used in SRM2.2
std::list< int > _file_ids
 A list of file ids is kept in SRM1.
std::string _space_token
 The space token associated with a request.
std::map< std::string,
std::string > 
_surl_failures
 A map of SURLs for which requests failed to failure reason.
int _waiting_time
 Estimated waiting time as returned by the server to wait until the next poll of an asychronous request.
SRMRequestStatus _status
 status of request.
bool _long_list
 Whether a detailed listing is requested.

Detailed Description

Class to represent a request which may be used for multiple operations, for example calling getTURLs() sets the request token in the request object (for a v2.2 client) and then same object is passed to releaseGet().

Definition at line 132 of file SRMClient.h.


Constructor & Destructor Documentation

SRMClientRequest::SRMClientRequest ( std::list< std::string >  urls) throw (SRMInvalidRequestException) [inline]

Creates a request object with multiple SURLs.

The URLs here are in the form srm://srm.ndgf.org/pnfs/ndgf.org/data/atlas/disk/user/user.mlassnig.dataset.1/dummyfile3

Definition at line 189 of file SRMClient.h.

                                        :
      _space_token(""), 
      _waiting_time(1), 
      _status(SRM_REQUEST_ONGOING),
      _long_list(false) {
  
      if(urls.empty()) throw SRMInvalidRequestException();
      for (std::list<std::string>::iterator i = urls.begin();
         i != urls.end();
         ++i) _surls[*i] = SRM_UNKNOWN;
    };
SRMClientRequest::SRMClientRequest ( std::string  url = "",
std::string  id = "" 
) throw (SRMInvalidRequestException) [inline]

Creates a request object with a single SURL.

The URL here are in the form srm://srm.ndgf.org/pnfs/ndgf.org/data/atlas/disk/user/user.mlassnig.dataset.1/dummyfile3

Definition at line 206 of file SRMClient.h.

                                        :
      _space_token(""),
      _waiting_time(1),
      _status(SRM_REQUEST_ONGOING),
      _long_list(false) {
        
      if(url.compare("") == 0 && id.compare("") == 0) throw SRMInvalidRequestException();
      if(url.compare("") != 0) _surls[url] = SRM_UNKNOWN;
      else _request_token = (char*)id.c_str();
    };

Member Function Documentation

void SRMClientRequest::cancelled ( ) [inline]

Definition at line 278 of file SRMClient.h.

Here is the caller graph for this function:

void SRMClientRequest::file_ids ( std::list< int >  ids) [inline]

set and get file id list

Definition at line 233 of file SRMClient.h.

{_file_ids = ids;};

Here is the caller graph for this function:

std::list<int> SRMClientRequest::file_ids ( ) [inline]

Definition at line 234 of file SRMClient.h.

{return _file_ids;};

Definition at line 277 of file SRMClient.h.

Here is the caller graph for this function:

Definition at line 276 of file SRMClient.h.

Here is the caller graph for this function:

Definition at line 275 of file SRMClient.h.

Here is the caller graph for this function:

set and get status of request

Definition at line 274 of file SRMClient.h.

Here is the caller graph for this function:

void SRMClientRequest::long_list ( bool  list) [inline]

set and get long list flag

Definition at line 284 of file SRMClient.h.

{ _long_list = list; };

Here is the caller graph for this function:

bool SRMClientRequest::long_list ( ) [inline]

Definition at line 285 of file SRMClient.h.

{ return _long_list; };
void SRMClientRequest::request_id ( int  id) [inline]

set and get request id

Definition at line 221 of file SRMClient.h.

{_request_id = id;};

Here is the caller graph for this function:

int SRMClientRequest::request_id ( ) [inline]

Definition at line 222 of file SRMClient.h.

{return _request_id;};
void SRMClientRequest::request_token ( char *  token) [inline]

set and get request token

Definition at line 227 of file SRMClient.h.

{_request_token = token;};

Here is the caller graph for this function:

std::string SRMClientRequest::request_token ( ) [inline]

Definition at line 228 of file SRMClient.h.

{return _request_token;};
void SRMClientRequest::space_token ( std::string  token) [inline]

set and get space token

Definition at line 239 of file SRMClient.h.

{_space_token = token;};

Here is the caller graph for this function:

std::string SRMClientRequest::space_token ( ) [inline]

Definition at line 240 of file SRMClient.h.

{return _space_token;};

Definition at line 279 of file SRMClient.h.

{return _status;};

Here is the caller graph for this function:

void SRMClientRequest::surl_failures ( std::string  surl,
std::string  reason 
) [inline]

set and get surl failures

Definition at line 262 of file SRMClient.h.

{_surl_failures[surl] = reason;};

Here is the caller graph for this function:

std::map<std::string, std::string> SRMClientRequest::surl_failures ( ) [inline]

Definition at line 263 of file SRMClient.h.

{return _surl_failures;};
void SRMClientRequest::surl_statuses ( std::string  surl,
SRMFileLocality  locality 
) [inline]

set and get surl statuses

Definition at line 256 of file SRMClient.h.

{_surls[surl] = locality;};

Here is the caller graph for this function:

std::map<std::string, SRMFileLocality> SRMClientRequest::surl_statuses ( ) [inline]

Definition at line 257 of file SRMClient.h.

{return _surls;};
std::list<std::string> SRMClientRequest::surls ( ) [inline]

get SURLs

Definition at line 245 of file SRMClient.h.

                               {
      std::list<std::string> surl_list;
      for (std::map<std::string,SRMFileLocality>::iterator it=_surls.begin() ; it != _surls.end(); it++ ) {
        surl_list.push_back((*it).first);
      };
      return surl_list;
    };

Here is the caller graph for this function:

void SRMClientRequest::waiting_time ( int  wait_time) [inline]

set and get waiting time

Definition at line 268 of file SRMClient.h.

{_waiting_time = wait_time;};

Here is the caller graph for this function:

Definition at line 269 of file SRMClient.h.

{return _waiting_time;};

Member Data Documentation

std::list<int> SRMClientRequest::_file_ids [private]

A list of file ids is kept in SRM1.

Definition at line 154 of file SRMClient.h.

Whether a detailed listing is requested.

Definition at line 181 of file SRMClient.h.

int ids are used in SRM1

Definition at line 144 of file SRMClient.h.

std::string SRMClientRequest::_request_token [private]

string request tokens (eg "-21249586") are used in SRM2.2

Definition at line 149 of file SRMClient.h.

std::string SRMClientRequest::_space_token [private]

The space token associated with a request.

Definition at line 159 of file SRMClient.h.

status of request.

Only useful for asynchronous requests.

Definition at line 176 of file SRMClient.h.

std::map<std::string, std::string> SRMClientRequest::_surl_failures [private]

A map of SURLs for which requests failed to failure reason.

Used for bring online requests.

Definition at line 165 of file SRMClient.h.

std::map<std::string, SRMFileLocality> SRMClientRequest::_surls [private]

The SURLs of the files involved in the request, mapped to their locality.

Definition at line 139 of file SRMClient.h.

Estimated waiting time as returned by the server to wait until the next poll of an asychronous request.

Definition at line 171 of file SRMClient.h.


The documentation for this class was generated from the following file: