Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
Arc::TargetRetrieverUNICORE Class Reference

#include <TargetRetrieverUNICORE.h>

Inheritance diagram for Arc::TargetRetrieverUNICORE:
Inheritance graph
[legend]
Collaboration diagram for Arc::TargetRetrieverUNICORE:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~TargetRetrieverUNICORE ()
void GetTargets (TargetGenerator &mom, int targetType, int detailLevel)
 Method for collecting targets.

Static Public Member Functions

static PluginInstance (PluginArgument *arg)

Protected Attributes

const std::string flavour
const UserConfigusercfg
const URL url
const ServiceType serviceType

Private Member Functions

 TargetRetrieverUNICORE (const UserConfig &usercfg, const URL &url, ServiceType st)
ThreadArgCreateThreadArg (TargetGenerator &mom, int targetType, int detailLevel)

Static Private Member Functions

static void QueryIndex (void *arg)
static void InterrogateTarget (void *arg)

Static Private Attributes

static Logger logger

Detailed Description

Definition at line 14 of file TargetRetrieverUNICORE.h.


Constructor & Destructor Documentation

Arc::TargetRetrieverUNICORE::TargetRetrieverUNICORE ( const UserConfig usercfg,
const URL url,
ServiceType  st 
) [private]

Definition at line 46 of file TargetRetrieverUNICORE.cpp.

    : TargetRetriever(usercfg, url, st, "UNICORE") {}

Here is the caller graph for this function:

Definition at line 50 of file TargetRetrieverUNICORE.cpp.

{}

Member Function Documentation

ThreadArg * Arc::TargetRetrieverUNICORE::CreateThreadArg ( TargetGenerator mom,
int  targetType,
int  detailLevel 
) [private]

Definition at line 32 of file TargetRetrieverUNICORE.cpp.

                                                                      {
    ThreadArg *arg = new ThreadArg;
    arg->mom = &mom;
    arg->usercfg = &usercfg;
    arg->url = url;
    arg->targetType = targetType;
    arg->detailLevel = detailLevel;
    return arg;
  }

Here is the caller graph for this function:

void Arc::TargetRetrieverUNICORE::GetTargets ( TargetGenerator mom,
int  targetType,
int  detailLevel 
) [virtual]

Method for collecting targets.

Pure virtual method for collecting targets. Implementation depends on the Grid middleware in question and is thus left to the specialized class.

Parameters:
momis the reference to the TargetGenerator which has loaded the TargetRetriever
targetTypeis the identificaion of targets to find (0=ExecutionTargets, 1=Grid Jobs)
detailLevelis the required level of details (1 = All details, 2 = Limited details)

Implements Arc::TargetRetriever.

Definition at line 60 of file TargetRetrieverUNICORE.cpp.

                                                           {

    logger.msg(INFO, "TargetRetriverUNICORE initialized with %s service url: %s",
               tostring(serviceType), url.str());

    switch (serviceType) {
    case COMPUTING:
      if (mom.AddService(url)) {
        ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
        if (!CreateThreadFunction(&InterrogateTarget, arg)) {
          delete arg;
          mom.RetrieverDone();
        }
      }
      break;
    case INDEX:
      if (mom.AddIndexServer(url)) {
        ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
        if (!CreateThreadFunction(&QueryIndex, arg)) {
          delete arg;
          mom.RetrieverDone();
        }
      }
      break;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 52 of file TargetRetrieverUNICORE.cpp.

                                                              {
    TargetRetrieverPluginArgument *trarg =
      dynamic_cast<TargetRetrieverPluginArgument*>(arg);
    if (!trarg)
      return NULL;
    return new TargetRetrieverUNICORE(*trarg, *trarg, *trarg);
  }

Here is the call graph for this function:

void Arc::TargetRetrieverUNICORE::InterrogateTarget ( void *  arg) [static, private]

Definition at line 108 of file TargetRetrieverUNICORE.cpp.

                                                          {
    ThreadArg *thrarg = (ThreadArg*)arg;
    TargetGenerator& mom = *thrarg->mom;
    const UserConfig& usercfg = *thrarg->usercfg;

    URL& url = thrarg->url;
    MCCConfig cfg;
    usercfg.ApplyToConfig(cfg);
    UNICOREClient uc(url, cfg, usercfg.Timeout());
    std::string status;
    if (!uc.sstat(status)) {
      delete thrarg;
      mom.RetrieverDone();
      return;
    }


    ExecutionTarget target;
    target.GridFlavour = "UNICORE";
    target.Cluster = url;
    target.url = url;
    target.InterfaceName = "BES";
    target.Implementor = "UNICORE";
    target.Implementation = Software("UNICORE");
    target.HealthState = "ok";
    target.DomainName = url.Host();


    delete thrarg;
    mom.AddTarget(target);
    mom.RetrieverDone();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::TargetRetrieverUNICORE::QueryIndex ( void *  arg) [static, private]

Definition at line 88 of file TargetRetrieverUNICORE.cpp.

                                                   {
    ThreadArg *thrarg = (ThreadArg*)arg;
    TargetGenerator& mom = *thrarg->mom;
    const UserConfig& usercfg = *thrarg->usercfg;

    URL& url = thrarg->url;
    MCCConfig cfg;
    usercfg.ApplyToConfig(cfg);
    UNICOREClient uc(url, cfg, usercfg.Timeout());
    std::list< std::pair<URL, ServiceType> > beses;
    uc.listTargetSystemFactories(beses);
    for (std::list< std::pair<URL, ServiceType> >::iterator it = beses.begin(); it != beses.end(); it++) {
      TargetRetrieverUNICORE r(usercfg, it->first, it->second);
      r.GetTargets(mom, thrarg->targetType, thrarg->detailLevel);
    }

    delete thrarg;
    mom.RetrieverDone();
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

const std::string Arc::TargetRetriever::flavour [protected, inherited]

Definition at line 64 of file TargetRetriever.h.

Reimplemented from Arc::TargetRetriever.

Definition at line 31 of file TargetRetrieverUNICORE.h.

const ServiceType Arc::TargetRetriever::serviceType [protected, inherited]

Definition at line 67 of file TargetRetriever.h.

const URL Arc::TargetRetriever::url [protected, inherited]

Definition at line 66 of file TargetRetriever.h.

const UserConfig& Arc::TargetRetriever::usercfg [protected, inherited]

Definition at line 65 of file TargetRetriever.h.


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