Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Member Functions | Private Attributes
ARex::ARexGMConfig Class Reference

#include <job.h>

Inheritance diagram for ARex::ARexGMConfig:
Inheritance graph
[legend]
Collaboration diagram for ARex::ARexGMConfig:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ARexGMConfig (const std::string &config_file, const std::string &uname, const std::string &grid_name, const std::string &service_endpoint)
 ~ARexGMConfig (void)
 operator bool (void) const
bool operator! (void) const
JobUserUser (void)
bool ReadOnly (void) const
const std::string & GridName (void) const
const std::string & Endpoint (void) const
const std::list< std::string > & Queues (void) const
void AddAuth (Arc::MessageAuth *auth)
void ClearAuths (void)
std::list< Arc::MessageAuth * >
::iterator 
beginAuth (void)
std::list< Arc::MessageAuth * >
::iterator 
endAuth (void)
ContinuationPluginsPlugins (void)
std::vector< std::string > SessionRootsNonDraining (void)

Static Public Member Functions

static bool InitEnvironment (const std::string &configfile)

Private Attributes

JobUseruser_
bool readonly_
std::list< std::string > queues_
std::string grid_name_
std::string service_endpoint_
std::list< Arc::MessageAuth * > auths_
ContinuationPlugins cont_plugins_
std::vector< std::string > session_roots_non_draining_

Detailed Description

Definition at line 16 of file job.h.


Constructor & Destructor Documentation

ARexGMConfig::ARexGMConfig ( const std::string &  config_file,
const std::string &  uname,
const std::string &  grid_name,
const std::string &  service_endpoint 
)

Definition at line 57 of file job.cpp.

                                                                                                                                         :user_(NULL),readonly_(false),grid_name_(grid_name),service_endpoint_(service_endpoint) {
  if(!InitEnvironment(configfile)) return;
  // const char* uname = user_s.get_uname();
  //if((bool)job_map) uname=job_map.unix_name();
  user_=new JobUser(uname);
  if(!user_->is_valid()) { delete user_; user_=NULL; return; };
  if(nordugrid_loc().empty() != 0) { delete user_; user_=NULL; return; };
  /* read configuration */
  std::vector<std::string> session_roots;
  std::string control_dir;
  std::string default_lrms;
  std::string default_queue;
  RunPlugin* cred_plugin = new RunPlugin;
  std::string allowsubmit;
  bool strict_session;
  if(!configure_user_dirs(uname,control_dir,session_roots,
                          session_roots_non_draining_,
                          default_lrms,default_queue,queues_,
                          cont_plugins_,*cred_plugin,
                          allowsubmit,strict_session)) {
    // olog<<"Failed processing grid-manager configuration"<<std::endl;
    delete user_; user_=NULL; delete cred_plugin; return;
  };
  delete cred_plugin;
  if(default_queue.empty() && (queues_.size() == 1)) {
    default_queue=*(queues_.begin());
  };
  user_->SetControlDir(control_dir);
  user_->SetSessionRoot(session_roots);
  user_->SetLRMS(default_lrms,default_queue);
  user_->SetStrictSession(strict_session);
  //for(;allowsubmit.length();) {
  //  std::string group = config_next_arg(allowsubmit);
  //  if(group.length()) readonly=true;
  //  if(user_a.check_group(group)) { readonly=false; break; };
  //};
  //if(readonly) olog<<"This user is denied to submit new jobs"<<std::endl;
  /*
          * link to the class for direct file access *
          std::string direct_config = "mount "+session_root+"\n";
          direct_config+="dir / nouser read cd dirlist delete append overwrite";          direct_config+=" create "+
             inttostring(user->get_uid())+":"+inttostring(user->get_gid())+
             " 600:600";
          direct_config+=" mkdir "+
             inttostring(user->get_uid())+":"+inttostring(user->get_gid())+
             " 700:700\n";
          direct_config+="end\n";
#ifdef HAVE_SSTREAM
          std::stringstream fake_cfile(direct_config);
#else
          std::strstream fake_cfile;
          fake_cfile<<direct_config;
#endif
          direct_fs = new DirectFilePlugin(fake_cfile,user_s);
          if((bool)job_map) {
            olog<<"Job submission user: "<<uname<<
                  " ("<<user->get_uid()<<":"<<user->get_gid()<<")"<<std::endl;
  */
}

Here is the call graph for this function:

Definition at line 53 of file job.cpp.

                                {
  if(user_) delete user_;
}

Member Function Documentation

void ARex::ARexGMConfig::AddAuth ( Arc::MessageAuth auth) [inline]

Definition at line 37 of file job.h.

{ auths_.push_back(auth); };

Here is the caller graph for this function:

std::list<Arc::MessageAuth*>::iterator ARex::ARexGMConfig::beginAuth ( void  ) [inline]

Definition at line 39 of file job.h.

{ return auths_.begin(); };

Here is the caller graph for this function:

void ARex::ARexGMConfig::ClearAuths ( void  ) [inline]

Definition at line 38 of file job.h.

{ auths_.clear(); };

Here is the caller graph for this function:

std::list<Arc::MessageAuth*>::iterator ARex::ARexGMConfig::endAuth ( void  ) [inline]

Definition at line 40 of file job.h.

{ return auths_.end(); };

Here is the caller graph for this function:

const std::string& ARex::ARexGMConfig::Endpoint ( void  ) const [inline]

Definition at line 34 of file job.h.

{ return service_endpoint_; };

Here is the caller graph for this function:

const std::string& ARex::ARexGMConfig::GridName ( void  ) const [inline]

Definition at line 33 of file job.h.

{ return grid_name_; };

Here is the caller graph for this function:

bool ARexGMConfig::InitEnvironment ( const std::string &  configfile) [static]

Definition at line 42 of file job.cpp.

                                                              {
  if(env_initialized) return true;
  env_lock.lock();
  if(!env_initialized) {
    if(!configfile.empty()) nordugrid_config_loc(configfile);
    env_initialized=read_env_vars();
  };
  env_lock.unlock();
  return env_initialized;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ARex::ARexGMConfig::operator bool ( void  ) const [inline]

Definition at line 29 of file job.h.

{ return (user_ != NULL); };
bool ARex::ARexGMConfig::operator! ( void  ) const [inline]

Definition at line 30 of file job.h.

{ return (user_ == NULL); };

Definition at line 41 of file job.h.

{ return cont_plugins_; };

Here is the caller graph for this function:

const std::list<std::string>& ARex::ARexGMConfig::Queues ( void  ) const [inline]

Definition at line 35 of file job.h.

{ return queues_; };

Here is the caller graph for this function:

bool ARex::ARexGMConfig::ReadOnly ( void  ) const [inline]

Definition at line 32 of file job.h.

{ return readonly_; };
std::vector<std::string> ARex::ARexGMConfig::SessionRootsNonDraining ( void  ) [inline]

Definition at line 42 of file job.h.

Here is the caller graph for this function:

JobUser* ARex::ARexGMConfig::User ( void  ) [inline]

Definition at line 31 of file job.h.

{ return user_; };

Here is the caller graph for this function:


Member Data Documentation

Definition at line 23 of file job.h.

Definition at line 24 of file job.h.

std::string ARex::ARexGMConfig::grid_name_ [private]

Definition at line 21 of file job.h.

std::list<std::string> ARex::ARexGMConfig::queues_ [private]

Definition at line 20 of file job.h.

Definition at line 19 of file job.h.

Definition at line 22 of file job.h.

std::vector<std::string> ARex::ARexGMConfig::session_roots_non_draining_ [private]

Definition at line 25 of file job.h.

Definition at line 18 of file job.h.


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