30 #include <glite-api-wrapper/gLiteAPIWrapper.h>
166 using namespace glite_api_wrapper;
167 using namespace LFCHelper;
168 using namespace MiscCommon;
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());
396 }
catch (
const exception &e) {
397 Error(
"Pwd",
"Exception: %s", e.what());
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)
Small helper to implement the function to create,access and destroy iterators.
virtual Bool_t Cancel()
The Cancel() method cancels a gLite job, which was assigned to the class.
Collectable string class.
virtual TGridJDL * GetJDLGenerator()
Not implemented for RGLite.
virtual void Stdout()
Not implemented for RGLite.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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.
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 IsConnected() const
Use this method to find out whether the RGLite plug-in is connected to gLite UI or not...
virtual Bool_t Kill(TGridJob *_gridjob)
A Grid Job operations method, it cancels a given gLite job.
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 ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
virtual void Stderr()
Not implemented for RGLite.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
void add_map_element(TMap *_map, const string &_key, const _T &_value)
virtual ~TGLite()
Destructor.
gLite implementation of TGridJob
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * Pwd(Bool_t=kFALSE)
A File Catalog method.
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.
TRObject operator()(const T1 &t1) const
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
std::string fFileCatalog_WrkDir
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.
ClassImp(TGLite) using namespace std