30 #include <glite-api-wrapper/gLiteAPIWrapper.h> 177 _map->
Add(dynamic_cast<TObject*>(key), dynamic_cast<TObject*>(value));
180 struct SAddRepInfo:
public binary_function<SLFCRepInfo_t, TMap*, bool> {
181 bool operator()(first_argument_type _rep, second_argument_type m_Map)
const {
182 ostringstream strSFN;
183 strSFN <<
"sfn" << _rep.id;
184 stringstream strHost;
185 strHost <<
"host" << _rep.id;
192 struct SAddMapElementFunc:
public binary_function<SLFCFileInfo_t, TGLiteResult*, bool> {
193 bool operator()(first_argument_type _lfc_info, second_argument_type _Result)
const {
200 add_map_element(map,
"rep_count", _lfc_info.m_LFCRepInfoVector.size());
203 for_each(_lfc_info.m_LFCRepInfoVector.begin(),
204 _lfc_info.m_LFCRepInfoVector.end(),
205 bind2nd(SAddRepInfo(), map));
221 if (!CGLiteAPIWrapper::Instance().Init()) {
224 Info(
"TGLite",
"gLite API Wrapper engine has been successfully initialized.");
306 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
310 LFCFileInfoVector_t container;
314 ls.m_pattern = _pattern;
316 pCatalog->Run(ls, &container);
317 }
catch (
const exception &
e) {
318 Error(
"Query",
"Exception: %s", e.what());
324 for_each(container.begin(), container.end(), bind2nd(SAddMapElementFunc(), result));
356 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
360 LFCFileInfoVector_t container;
364 pCatalog->Run(ls, &container);
365 }
catch (
const exception &
e) {
366 Error(
"Ls",
"Exception: %s", e.what());
372 for_each(container.begin(), container.end(), bind2nd(SAddMapElementFunc(), result));
389 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
395 pCatalog->Run(pwd, &fFileCatalog_WrkDir);
396 }
catch (
const exception &
e) {
397 Error(
"Pwd",
"Exception: %s", e.what());
401 return fFileCatalog_WrkDir.c_str();
421 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
429 }
catch (
const exception &
e) {
430 Error(
"Cd",
"Exception: %s", e.what());
454 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
461 pCatalog->Run(mkdir);
462 }
catch (
const exception &
e) {
463 Error(
"Mkdir",
"Exception: %s", e.what());
486 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
493 pCatalog->Run(rmdir);
494 }
catch (
const exception &
e) {
495 Error(
"Rmdir",
"Exception: %s", e.what());
519 CCatalogManager *pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
523 gaw_lfc_register reg;
524 reg.m_file_name = _lfn;
526 reg.m_SE_server = _se;
530 }
catch (
const exception &
e) {
531 Error(
"Register",
"Exception: %s", e.what());
558 CCatalogManager * pCatalog(&CGLiteAPIWrapper::Instance().GetCatalogManager());
563 rm.m_file_name = _lfn;
566 }
catch (
const exception &
e) {
567 Error(
"Rm",
"Exception: %s", e.what());
591 CGLiteAPIWrapper::Instance().GetJobManager().DelegationCredential();
594 CGLiteAPIWrapper::Instance().GetJobManager().GetVersion(&strVer);
595 Info(
"Submit",
"GAW Job Manager uses WMProxy version: %s", strVer.c_str());
598 CGLiteAPIWrapper::Instance().GetJobManager().JobSubmit(_jdl, &sJobID);
599 Info(
"Submit",
"Job successfully submitted. Job ID \"%s\"", sJobID.c_str());
601 }
catch (
const exception &
e) {
602 Error(
"Submit",
"Exception: %s", e.what());
630 return _gridjob->
Cancel();
virtual TGridResult * LocateSites()
Not implemented for RGLite.
virtual TGridJob * Submit(const char *_jdl)
virtual Bool_t Cancel()
The Cancel() method cancels a gLite job, which was assigned to the class.
virtual Bool_t IsConnected() const
Use this method to find out whether the RGLite plug-in is connected to gLite UI or not...
Collectable string class.
virtual TGridJDL * GetJDLGenerator()
Not implemented for RGLite.
virtual void Stdout()
Not implemented for RGLite.
virtual Bool_t Cancel()=0
virtual Bool_t KillById(TString _id)
A Grid Job operations method, it cancels a gLite job by the given id.
virtual Int_t Mkdir(const char *_ldn="", Option_t *="", Bool_t=kFALSE)
A File Catalog method.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
virtual Bool_t Rm(const char *_lfn, Option_t *="", Bool_t=kFALSE)
A File Catalog method, it removes an LFC file entry from the name server.
virtual Bool_t Kill(TGridJob *_gridjob)
A Grid Job operations method, it cancels a given gLite job.
TRObject operator()(const T1 &t1) const
virtual Bool_t Rmdir(const char *_ldn="", Option_t *="", Bool_t=kFALSE)
A File Catalog method, it removes a directory from the name server if it is an empty one...
virtual Bool_t Cd(const char *_ldn="", Bool_t=kFALSE)
A File Catalog method.
virtual void Stderr()
Not implemented for RGLite.
void add_map_element(TMap *_map, const string &_key, const _T &_value)
virtual ~TGLite()
Destructor.
void Info(const char *location, const char *msgfmt,...)
gLite implementation of TGridJob
void Error(const char *location, const char *msgfmt,...)
virtual const char * Pwd(Bool_t=kFALSE)
A File Catalog method.
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
virtual TGridResult * Ls(const char *_ldn="", Option_t *="", Bool_t=kFALSE)
Interface of the class which defines interface to gLite GRID services.
TGLite(const char *_gridurl, const char *=NULL, const char *=NULL, const char *=NULL)
Initializing the RGLite plug-in and making a connection to gLite UI.
virtual void Shell()
Not implemented for RGLite.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual Bool_t Register(const char *_lfn, const char *_turl, Long_t=-1, const char *_se=0, const char *_guid=0, Bool_t=kFALSE)
A File Catalog method, it creates a new LFC file in the name server and registering a replication...
virtual TGridResult * Query(const char *_path, const char *_pattern=NULL, const char *="", const char *="")
A File Catalog method.
virtual TGridResult * Command(const char *, Bool_t=kFALSE, UInt_t=2)
Not implemented for RGLite.