Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Functions
Hopi Namespace Reference

Classes

class  HopiFileChunks
class  HopiFile
class  HopiFileTimeout
class  Hopi
class  PayloadFile
 Implementation of PayloadRawInterface which provides access to ordinary file. More...
class  PayloadBigFile

Functions

static Arc::Pluginget_service (Arc::PluginArgument *arg)
static off_t GetEntitySize (Arc::MessagePayload &payload)
static std::string GetPath (Arc::Message &inmsg, std::string &base)
static int open_file_read (const char *filename)
static int open_file_write (const char *filename)
Arc::MessagePayloadnewFileRead (const char *filename, Arc::PayloadRawInterface::Size_t start, Arc::PayloadRawInterface::Size_t end)

Function Documentation

static Arc::Plugin* Hopi::get_service ( Arc::PluginArgument arg) [static]

Definition at line 26 of file hopi.cpp.

{
    Arc::ServicePluginArgument* srvarg =
            arg?dynamic_cast<Arc::ServicePluginArgument*>(arg):NULL;
    if(!srvarg) return NULL;
    return new Hopi((Arc::Config*)(*srvarg));
}
static off_t Hopi::GetEntitySize ( Arc::MessagePayload payload) [static]

Definition at line 479 of file hopi.cpp.

                                                       {
    try {
        return dynamic_cast<Arc::PayloadRawInterface&>(payload).Size();
    } catch (std::exception &e) {
    }
    return 0;
}

Here is the caller graph for this function:

static std::string Hopi::GetPath ( Arc::Message inmsg,
std::string &  base 
) [static]

Definition at line 544 of file hopi.cpp.

                                                            {
  base = inmsg.Attributes()->get("HTTP:ENDPOINT");
  Arc::AttributeIterator iterator = inmsg.Attributes()->getAll("PLEXER:EXTENSION");
  std::string path;
  if(iterator.hasMore()) {
    // Service is behind plexer
    path = *iterator;
    if(base.length() > path.length()) base.resize(base.length()-path.length());
  } else {
    // Standalone service
    path=Arc::URL(base).Path();
    base.resize(0);
  };
  return path;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 164 of file PayloadFile.cpp.

                                                                                                                         {
#ifndef WIN32 
  PayloadBigFile* file1 = new PayloadBigFile(filename,start,end);
  if(!*file1) { delete file1; return NULL; };
  if(file1->Size() > PayloadBigFile::Threshold()) return file1;
  PayloadFile* file2 = new PayloadFile(filename,start,end);
  if(!*file2) { delete file2; return file1; };
  delete file1;
  return file2;
#else
  PayloadBigFile* file1 = new PayloadBigFile(filename,start,end);
  if(!*file1) { delete file1; return NULL; };
  return file1;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int Hopi::open_file_read ( const char *  filename) [static]

Definition at line 110 of file PayloadFile.cpp.

                                                {
  return ::open(filename,O_RDONLY);
}
static int Hopi::open_file_write ( const char *  filename) [static]

Definition at line 114 of file PayloadFile.cpp.

                                                 {
  return ::open(filename,O_WRONLY | O_CREAT,S_IRUSR | S_IWUSR);
}