Back to index

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

Complements DataPoint with attributes common for Indexing Service URLs. More...

#include <DataPointIndex.h>

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

List of all members.

Public Member Functions

 DataPointIndex (const URL &url, const UserConfig &usercfg)
virtual ~DataPointIndex ()
virtual const URLCurrentLocation () const
 Returns current (resolved) URL.
virtual const std::string & CurrentLocationMetadata () const
 Returns meta information used to create current URL.
virtual DataStatus CompareLocationMetadata () const
 Compare metadata of DataPoint and current location.
virtual bool NextLocation ()
 Switch to next location in list of URLs.
virtual bool LocationValid () const
 Returns false if out of retries.
virtual bool HaveLocations () const
 Returns true if number of resolved URLs is not 0.
virtual DataStatus RemoveLocation ()
 Remove current URL from list.
virtual DataStatus RemoveLocations (const DataPoint &p)
 Remove locations present in another DataPoint object.
virtual DataStatus AddLocation (const URL &url, const std::string &meta)
 Add URL to list.
virtual bool IsIndex () const
 Check if URL is an Indexing Service.
virtual bool AcceptsMeta ()
 If endpoint can have any use from meta information.
virtual bool ProvidesMeta ()
 If endpoint can provide at least some meta information directly.
virtual bool Registered () const
 Check if file is registered in Indexing Service.
virtual void SetTries (const int n)
 Set number of retries.
virtual long long int BufSize () const
 Get suggested buffer size for transfers.
virtual int BufNum () const
 Get suggested number of buffers for transfers.
virtual bool Local () const
 Returns true if file is local, e.g. file:// urls.
virtual bool ReadOnly () const
virtual DataStatus StartReading (DataBuffer &buffer)
 Start reading data from URL.
virtual DataStatus StartWriting (DataBuffer &buffer, DataCallback *space_cb=NULL)
 Start writing data to URL.
virtual DataStatus StopReading ()
 Stop reading.
virtual DataStatus StopWriting ()
 Stop writing.
virtual DataStatus Check ()
 Query the DataPoint to check if object is accessible.
virtual DataStatus Remove ()
 Remove/delete object at URL.
virtual void ReadOutOfOrder (bool v)
 Allow/disallow DataPoint to produce scattered data during reading operation.
virtual bool WriteOutOfOrder ()
 Returns true if URL can accept scattered data for writing operation.
virtual void SetAdditionalChecks (bool v)
 Allow/disallow additional checks.
virtual bool GetAdditionalChecks () const
 Check if additional checks before will be performed.
virtual void SetSecure (bool v)
 Allow/disallow heavy security during data transfer.
virtual bool GetSecure () const
 Check if heavy security during data transfer is allowed.
virtual void Passive (bool v)
 Request passive transfers for FTP-like protocols.
virtual void Range (unsigned long long int start=0, unsigned long long int end=0)
 Set range of bytes to retrieve.
virtual const URLGetURL () const
 Returns the URL that was passed to the constructor.
virtual const UserConfigGetUserConfig () const
 Returns the UserConfig that was passed to the constructor.
virtual std::string str () const
 Returns a string representation of the DataPoint.
virtual operator bool () const
 Is DataPoint valid?
virtual bool operator! () const
 Is DataPoint valid?
virtual DataStatus ListFiles (std::list< FileInfo > &files, bool long_list=false, bool resolve=false, bool metadata=false)=0
 List file(s).
virtual DataStatus GetFailureReason (void) const
 Returns reason of transfer failure, as reported by callbacks. This could be different from the failure returned by the methods themselves.
virtual DataStatus Resolve (bool source)=0
 Resolves index service URL into list of ordinary URLs.
virtual DataStatus PreRegister (bool replication, bool force=false)=0
 Index service preregistration.
virtual DataStatus PostRegister (bool replication)=0
 Index Service postregistration.
virtual DataStatus PreUnregister (bool replication)=0
 Index Service preunregistration.
virtual DataStatus Unregister (bool all)=0
 Index Service unregistration.
virtual bool CheckSize () const
 Check if meta-information 'size' is available.
virtual void SetSize (const unsigned long long int val)
 Set value of meta-information 'size'.
virtual unsigned long long int GetSize () const
 Get value of meta-information 'size'.
virtual bool CheckCheckSum () const
 Check if meta-information 'checksum' is available.
virtual void SetCheckSum (const std::string &val)
 Set value of meta-information 'checksum'.
virtual const std::string & GetCheckSum () const
 Get value of meta-information 'checksum'.
virtual const std::string DefaultCheckSum () const
 Default checksum type.
virtual bool CheckCreated () const
 Check if meta-information 'creation/modification time' is available.
virtual void SetCreated (const Time &val)
 Set value of meta-information 'creation/modification time'.
virtual const TimeGetCreated () const
 Get value of meta-information 'creation/modification time'.
virtual bool CheckValid () const
 Check if meta-information 'validity time' is available.
virtual void SetValid (const Time &val)
 Set value of meta-information 'validity time'.
virtual const TimeGetValid () const
 Get value of meta-information 'validity time'.
virtual bool Cache () const
 Returns true if file is cacheable.
virtual int GetTries () const
 Returns number of retries left.
virtual void NextTry (void)
 Decrease number of retries left.
virtual void SetMeta (const DataPoint &p)
 Copy meta information from another object.
virtual bool CompareMeta (const DataPoint &p) const
 Compare meta information from another object.

Protected Member Functions

void ClearLocations ()

Protected Attributes

bool resolved
bool registered
const URLurl
const UserConfigusercfg
unsigned long long int size
std::string checksum
Time created
Time valid
int triesleft
DataStatus failure_code
bool cache
std::list< std::string > valid_url_options
 Subclasses should add their own specific options to this list.

Static Protected Attributes

static Logger logger

Private Member Functions

void SetHandle ()

Private Attributes

std::list< URLLocationlocations
 List of locations at which file can be probably found.
std::list< URLLocation >::iterator location
DataHandleh

Detailed Description

Complements DataPoint with attributes common for Indexing Service URLs.

It should never be used directly. Instead inherit from it to provide a class for specific a Indexing Service.

Definition at line 17 of file DataPointIndex.h.


Constructor & Destructor Documentation

Arc::DataPointIndex::DataPointIndex ( const URL url,
const UserConfig usercfg 
)

Definition at line 14 of file DataPointIndex.cpp.

    : DataPoint(url, usercfg),
      registered(false),
      h(NULL) {
    location = locations.end();
  }

Definition at line 21 of file DataPointIndex.cpp.

                                  {
    if (h)
      delete h;
  }

Member Function Documentation

If endpoint can have any use from meta information.

Implements Arc::DataPoint.

Definition at line 149 of file DataPointIndex.cpp.

                                   {
    return true;
  }
DataStatus Arc::DataPointIndex::AddLocation ( const URL url,
const std::string &  meta 
) [virtual]

Add URL to list.

Parameters:
urlLocation URL to add.
metaLocation meta information.

Implements Arc::DataPoint.

Definition at line 120 of file DataPointIndex.cpp.

                                                                {
    logger.msg(DEBUG, "Add location: url: %s", url.str());
    logger.msg(DEBUG, "Add location: metadata: %s", meta);
    for (std::list<URLLocation>::iterator i = locations.begin();
         i != locations.end(); ++i)
      if ((i->Name() == meta) && (url == (*i)))
        return DataStatus::LocationAlreadyExistsError;
    locations.push_back(URLLocation(url, meta));
    if(locations.end() == location) {
      location = locations.begin();
      SetHandle();
    }
    return DataStatus::Success;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int Arc::DataPointIndex::BufNum ( ) const [virtual]

Get suggested number of buffers for transfers.

Implements Arc::DataPoint.

Definition at line 198 of file DataPointIndex.cpp.

                                   {
    if (!h || !*h)
      return 1;
    return (*h)->BufNum();
  }
long long int Arc::DataPointIndex::BufSize ( ) const [virtual]

Get suggested buffer size for transfers.

Implements Arc::DataPoint.

Definition at line 192 of file DataPointIndex.cpp.

                                              {
    if (!h || !*h)
      return -1;
    return (*h)->BufSize();
  }
bool Arc::DataPoint::Cache ( ) const [virtual, inherited]

Returns true if file is cacheable.

Definition at line 86 of file DataPoint.cpp.

                              {
    return cache;
  }

Here is the caller graph for this function:

Query the DataPoint to check if object is accessible.

If possible this method will also try to provide meta information about the object.

Implements Arc::DataPoint.

Definition at line 186 of file DataPointIndex.cpp.

                                   {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->Check();
  }
bool Arc::DataPoint::CheckCheckSum ( ) const [virtual, inherited]

Check if meta-information 'checksum' is available.

Definition at line 102 of file DataPoint.cpp.

                                      {
    return (!checksum.empty());
  }

Here is the caller graph for this function:

bool Arc::DataPoint::CheckCreated ( ) const [virtual, inherited]

Check if meta-information 'creation/modification time' is available.

Definition at line 118 of file DataPoint.cpp.

                                     {
    return (created != -1);
  }

Here is the caller graph for this function:

bool Arc::DataPoint::CheckSize ( ) const [virtual, inherited]

Check if meta-information 'size' is available.

Definition at line 90 of file DataPoint.cpp.

                                  {
    return (size != (unsigned long long int)(-1));
  }

Here is the caller graph for this function:

bool Arc::DataPoint::CheckValid ( ) const [virtual, inherited]

Check if meta-information 'validity time' is available.

Definition at line 130 of file DataPoint.cpp.

                                   {
    return (valid != -1);
  }

Here is the caller graph for this function:

void Arc::DataPointIndex::ClearLocations ( ) [inline, protected]

Definition at line 73 of file DataPointIndex.h.

                          {
      locations.clear();
      location = locations.end();
      SetHandle();
    };

Here is the call graph for this function:

Here is the caller graph for this function:

Compare metadata of DataPoint and current location.

Returns inconsistency error or error encountered during operation, or success

Implements Arc::DataPoint.

Definition at line 40 of file DataPointIndex.cpp.

                                                           {
    if (h && *h) {
      DataStatus res = (*h)->Check();
      if (!res.Passed())
        return res;
      if (!CompareMeta(*(*h)))
        return DataStatus::InconsistentMetadataError;
    }
    return DataStatus::Success;
  }  

Here is the call graph for this function:

bool Arc::DataPoint::CompareMeta ( const DataPoint p) const [virtual, inherited]

Compare meta information from another object.

Undefined values are not used for comparison.

Parameters:
pobject to which to compare.

Definition at line 165 of file DataPoint.cpp.

                                                      {
    if (CheckSize() && p.CheckSize())
      if (GetSize() != p.GetSize())
        return false;
    if (CheckCheckSum() && p.CheckCheckSum())
      // TODO: compare checksums properly
      if (strcasecmp(GetCheckSum().c_str(), p.GetCheckSum().c_str()))
        return false;
    if (CheckValid() && p.CheckValid())
      if (GetValid() != p.GetValid())
        return false;
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const URL & Arc::DataPointIndex::CurrentLocation ( ) const [virtual]

Returns current (resolved) URL.

Implements Arc::DataPoint.

Definition at line 26 of file DataPointIndex.cpp.

                                                   {
    static const URL empty;
    if (locations.end() == location)
      return empty;
    return *location;
  }

Here is the caller graph for this function:

const std::string & Arc::DataPointIndex::CurrentLocationMetadata ( ) const [virtual]

Returns meta information used to create current URL.

Usage differs between different indexing services.

Implements Arc::DataPoint.

Definition at line 33 of file DataPointIndex.cpp.

                                                                 {
    static const std::string empty;
    if (locations.end() == location)
      return empty;
    return location->Name();
  }
const std::string Arc::DataPoint::DefaultCheckSum ( ) const [virtual, inherited]

Default checksum type.

Reimplemented in Arc::DataPointSRM, and Arc::DataPointLFC.

Definition at line 114 of file DataPoint.cpp.

                                                   {
    return std::string("cksum");
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::DataPointIndex::GetAdditionalChecks ( ) const [virtual]

Check if additional checks before will be performed.

Implements Arc::DataPoint.

Definition at line 238 of file DataPointIndex.cpp.

                                                 {
    if (!h || !*h)
      return false;
    return (*h)->GetAdditionalChecks();
  }
const std::string & Arc::DataPoint::GetCheckSum ( ) const [virtual, inherited]

Get value of meta-information 'checksum'.

Definition at line 110 of file DataPoint.cpp.

                                                {
    return checksum;
  }

Here is the caller graph for this function:

const Time & Arc::DataPoint::GetCreated ( ) const [virtual, inherited]

Get value of meta-information 'creation/modification time'.

Definition at line 126 of file DataPoint.cpp.

                                          {
    return created;
  }

Here is the caller graph for this function:

DataStatus Arc::DataPoint::GetFailureReason ( void  ) const [virtual, inherited]

Returns reason of transfer failure, as reported by callbacks. This could be different from the failure returned by the methods themselves.

Definition at line 82 of file DataPoint.cpp.

                                               {
    return failure_code;
  }

Here is the caller graph for this function:

bool Arc::DataPointIndex::GetSecure ( ) const [virtual]

Check if heavy security during data transfer is allowed.

Implements Arc::DataPoint.

Definition at line 249 of file DataPointIndex.cpp.

                                       {
    if (!h || !*h)
      return false;
    return (*h)->GetSecure();
  }
unsigned long long int Arc::DataPoint::GetSize ( ) const [virtual, inherited]

Get value of meta-information 'size'.

Definition at line 98 of file DataPoint.cpp.

                                                  {
    return size;
  }

Here is the caller graph for this function:

int Arc::DataPoint::GetTries ( ) const [virtual, inherited]

Returns number of retries left.

Definition at line 142 of file DataPoint.cpp.

                                {
    return triesleft;
  }

Here is the caller graph for this function:

const URL & Arc::DataPoint::GetURL ( ) const [virtual, inherited]

Returns the URL that was passed to the constructor.

Definition at line 45 of file DataPoint.cpp.

                                     {
    return url;
  }

Here is the caller graph for this function:

const UserConfig & Arc::DataPoint::GetUserConfig ( ) const [virtual, inherited]

Returns the UserConfig that was passed to the constructor.

Definition at line 49 of file DataPoint.cpp.

                                                   {
    return usercfg;
  }

Here is the caller graph for this function:

const Time & Arc::DataPoint::GetValid ( ) const [virtual, inherited]

Get value of meta-information 'validity time'.

Definition at line 138 of file DataPoint.cpp.

                                        {
    return valid;
  }

Here is the caller graph for this function:

bool Arc::DataPointIndex::HaveLocations ( ) const [virtual]

Returns true if number of resolved URLs is not 0.

Implements Arc::DataPoint.

Definition at line 51 of file DataPointIndex.cpp.

                                           {
    return (locations.size() != 0);
  }

Here is the caller graph for this function:

bool Arc::DataPointIndex::IsIndex ( ) const [virtual]

Check if URL is an Indexing Service.

Implements Arc::DataPoint.

Definition at line 145 of file DataPointIndex.cpp.

                                     {
    return true;
  }
virtual DataStatus Arc::DataPoint::ListFiles ( std::list< FileInfo > &  files,
bool  long_list = false,
bool  resolve = false,
bool  metadata = false 
) [pure virtual, inherited]

List file(s).

If the DataPoint represents a directory its contents will be listed.

Parameters:
fileswill contain list of file names and optionally their attributes.
long)listif true, list additional properties of each file.
resolveif true, resolve physical locations (relevant for indexing services only).

Implemented in Arc::DataPointGridFTP, Arc::DataPointARC, Arc::DataPointRLS, Arc::DataPointSRM, Arc::DataPointLDAP, Arc::DataPointFile, Arc::DataPointLFC, and Arc::DataPointHTTP.

Here is the caller graph for this function:

bool Arc::DataPointIndex::Local ( ) const [virtual]

Returns true if file is local, e.g. file:// urls.

Implements Arc::DataPoint.

Definition at line 204 of file DataPointIndex.cpp.

                                   {
    if (!h || !*h)
      return false;
    return (*h)->Local();
  }
bool Arc::DataPointIndex::LocationValid ( ) const [virtual]

Returns false if out of retries.

Implements Arc::DataPoint.

Definition at line 55 of file DataPointIndex.cpp.

                                           {
    if (triesleft <= 0)
      return false;
    if (locations.end() == location)
      return false;
    return true;
  }

Here is the caller graph for this function:

Switch to next location in list of URLs.

At last location switch to first if number of allowed retries is not exceeded. Returns false if no retries left.

Implements Arc::DataPoint.

Definition at line 73 of file DataPointIndex.cpp.

                                    {
    if (!LocationValid()) {
      --triesleft;
      return false;
    }
    ++location;
    if (locations.end() == location)
      if (--triesleft > 0)
        location = locations.begin();
    SetHandle();
    return LocationValid();
  }

Here is the call graph for this function:

void Arc::DataPoint::NextTry ( void  ) [virtual, inherited]

Decrease number of retries left.

Definition at line 150 of file DataPoint.cpp.

                          {
    if(triesleft) --triesleft;
  }

Here is the caller graph for this function:

Arc::DataPoint::operator bool ( void  ) const [virtual, inherited]

Is DataPoint valid?

Definition at line 57 of file DataPoint.cpp.

                                 {

    if (!url)
      return false;
      
    // URL option validation. Subclasses which do not want to validate
    // URL options should override this method.
    std::map<std::string, std::string> options = url.Options();
    for (std::map<std::string, std::string>::iterator i = options.begin(); i != options.end(); i++) {
      bool valid = false; 
      for (std::list<std::string>::const_iterator j = valid_url_options.begin(); j != valid_url_options.end(); j++) {
        if (i->first == *j) valid = true;
      }
      if (!valid) {
        logger.msg(ERROR, "Invalid URL option: %s", i->first);
        return false;
      }
    }
    return true;
  }

Here is the call graph for this function:

bool Arc::DataPoint::operator! ( void  ) const [virtual, inherited]

Is DataPoint valid?

Definition at line 78 of file DataPoint.cpp.

                                  {
    return !((bool)*this);
  }
void Arc::DataPointIndex::Passive ( bool  v) [virtual]

Request passive transfers for FTP-like protocols.

Parameters:
trueto request.

Implements Arc::DataPoint.

Definition at line 255 of file DataPointIndex.cpp.

                                     {
    if (h && *h)
      (*h)->Passive(v);
  }
virtual DataStatus Arc::DataPoint::PostRegister ( bool  replication) [pure virtual, inherited]

Index Service postregistration.

Used for same purpose as PreRegister. Should be called after actual transfer of file successfully finished.

Parameters:
replicationif true, the file is being replicated between two locations registered in Indexing Service under same name.

Implemented in Arc::DataPointDirect, Arc::DataPointRLS, and Arc::DataPointLFC.

Here is the caller graph for this function:

virtual DataStatus Arc::DataPoint::PreRegister ( bool  replication,
bool  force = false 
) [pure virtual, inherited]

Index service preregistration.

This function registers the physical location of a file into an indexing service. It should be called before the actual transfer to that location happens.

Parameters:
replicationif true, the file is being replicated between two locations registered in the indexing service under same name.
forceif true, perform registration of a new file even if it already exists. Should be used to fix failures in Indexing Service.

Implemented in Arc::DataPointDirect, Arc::DataPointRLS, and Arc::DataPointLFC.

Here is the caller graph for this function:

virtual DataStatus Arc::DataPoint::PreUnregister ( bool  replication) [pure virtual, inherited]

Index Service preunregistration.

Should be called if file transfer failed. It removes changes made by PreRegister.

Parameters:
replicationif true, the file is being replicated between two locations registered in Indexing Service under same name.

Implemented in Arc::DataPointDirect, Arc::DataPointRLS, and Arc::DataPointLFC.

Here is the caller graph for this function:

If endpoint can provide at least some meta information directly.

Implements Arc::DataPoint.

Definition at line 153 of file DataPointIndex.cpp.

                                    {
    return true;
  }
void Arc::DataPointIndex::Range ( unsigned long long int  start = 0,
unsigned long long int  end = 0 
) [virtual]

Set range of bytes to retrieve.

Default values correspond to whole file.

Implements Arc::DataPoint.

Definition at line 260 of file DataPointIndex.cpp.

                                                         {
    if (h && *h)
      (*h)->Range(start, end);
  }
bool Arc::DataPointIndex::ReadOnly ( ) const [virtual]

Implements Arc::DataPoint.

Definition at line 210 of file DataPointIndex.cpp.

                                      {
    if (!h || !*h)
      return true;
    return (*h)->ReadOnly();
  }
void Arc::DataPointIndex::ReadOutOfOrder ( bool  v) [virtual]

Allow/disallow DataPoint to produce scattered data during reading operation.

Parameters:
vtrue if allowed (default is false).

Implements Arc::DataPoint.

Definition at line 222 of file DataPointIndex.cpp.

                                            {
    if (h && *h)
      (*h)->ReadOutOfOrder(v);
  }
bool Arc::DataPointIndex::Registered ( ) const [virtual]

Check if file is registered in Indexing Service.

Proper value is obtainable only after Resolve.

Implements Arc::DataPoint.

Definition at line 157 of file DataPointIndex.cpp.

                                        {
    return registered;
  }

Remove/delete object at URL.

Implements Arc::DataPoint.

Definition at line 216 of file DataPointIndex.cpp.

                                    {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->Remove();
  }

Remove current URL from list.

Implements Arc::DataPoint.

Definition at line 86 of file DataPointIndex.cpp.

Here is the call graph for this function:

Remove locations present in another DataPoint object.

Implements Arc::DataPoint.

Definition at line 96 of file DataPointIndex.cpp.

                                                                {
    if (!p_.IsIndex())
      return DataStatus::Success;
    const DataPointIndex& p = dynamic_cast<const DataPointIndex&>(p_);
    std::list<URLLocation>::iterator p_int;
    std::list<URLLocation>::const_iterator p_ext;
    for (p_ext = p.locations.begin(); p_ext != p.locations.end(); ++p_ext)
      for (p_int = locations.begin(); p_int != locations.end();)
        // Compare URLs
        if (*p_int == *p_ext)
          if (location == p_int) {
            p_int = locations.erase(p_int);
            location = p_int;
          }
          else
            p_int = locations.erase(p_int);
        else
          ++p_int;
    if (locations.end() == location)
      location = locations.begin();
    SetHandle();
    return DataStatus::Success;
  }

Here is the call graph for this function:

virtual DataStatus Arc::DataPoint::Resolve ( bool  source) [pure virtual, inherited]

Resolves index service URL into list of ordinary URLs.

Also obtains meta information about the file.

Parameters:
sourcetrue if DataPoint object represents source of information.

Implemented in Arc::DataPointDirect, Arc::DataPointRLS, and Arc::DataPointLFC.

Here is the caller graph for this function:

void Arc::DataPointIndex::SetAdditionalChecks ( bool  v) [virtual]

Allow/disallow additional checks.

Check for existance of remote file (and probably other checks too) before initiating reading and writing operations.

Parameters:
vtrue if allowed (default is true).

Implements Arc::DataPoint.

Definition at line 233 of file DataPointIndex.cpp.

                                                 {
    if (h && *h)
      (*h)->SetAdditionalChecks(v);
  }
void Arc::DataPoint::SetCheckSum ( const std::string &  val) [virtual, inherited]

Set value of meta-information 'checksum'.

Definition at line 106 of file DataPoint.cpp.

                                                  {
    checksum = val;
  }

Here is the caller graph for this function:

void Arc::DataPoint::SetCreated ( const Time val) [virtual, inherited]

Set value of meta-information 'creation/modification time'.

Definition at line 122 of file DataPoint.cpp.

                                            {
    created = val;
  }

Here is the caller graph for this function:

void Arc::DataPointIndex::SetHandle ( void  ) [private]

Definition at line 63 of file DataPointIndex.cpp.

                                     {
    // TODO: pass various options from old handler to new
    if (h)
      delete h;
    if (locations.end() != location)
      h = new DataHandle(*location, usercfg);
    else
      h = NULL;
  }

Here is the caller graph for this function:

void Arc::DataPoint::SetMeta ( const DataPoint p) [virtual, inherited]

Copy meta information from another object.

Already defined values are not overwritten.

Parameters:
pobject from which information is taken.

Definition at line 154 of file DataPoint.cpp.

                                            {
    if (!CheckSize())
      SetSize(p.GetSize());
    if (!CheckCheckSum())
      SetCheckSum(p.GetCheckSum());
    if (!CheckCreated())
      SetCreated(p.GetCreated());
    if (!CheckValid())
      SetValid(p.GetValid());
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::DataPointIndex::SetSecure ( bool  v) [virtual]

Allow/disallow heavy security during data transfer.

Parameters:
vtrue if allowed (default depends on protocol).

Implements Arc::DataPoint.

Definition at line 244 of file DataPointIndex.cpp.

                                       {
    if (h && *h)
      (*h)->SetSecure(v);
  }
void Arc::DataPoint::SetSize ( const unsigned long long int  val) [virtual, inherited]

Set value of meta-information 'size'.

Definition at line 94 of file DataPoint.cpp.

                                                          {
    size = val;
  }

Here is the caller graph for this function:

void Arc::DataPointIndex::SetTries ( const int  n) [virtual]

Set number of retries.

Reimplemented from Arc::DataPoint.

Definition at line 136 of file DataPointIndex.cpp.

                                           {
    triesleft = std::max(0, n);
    if (triesleft == 0)
      location = locations.end();
    else if (locations.end() == location)
      location = locations.begin();
    SetHandle();
  }

Here is the call graph for this function:

void Arc::DataPoint::SetValid ( const Time val) [virtual, inherited]

Set value of meta-information 'validity time'.

Definition at line 134 of file DataPoint.cpp.

                                          {
    valid = val;
  }

Here is the caller graph for this function:

Start reading data from URL.

Separate thread to transfer data will be created. No other operation can be performed while reading is in progress.

Parameters:
bufferoperation will use this buffer to put information into. Should not be destroyed before stop_reading was called and returned.

Implements Arc::DataPoint.

Definition at line 161 of file DataPointIndex.cpp.

                                                            {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->StartReading(buffer);
  }
DataStatus Arc::DataPointIndex::StartWriting ( DataBuffer buffer,
DataCallback space_cb = NULL 
) [virtual]

Start writing data to URL.

Separate thread to transfer data will be created. No other operation can be performed while writing is in progress.

Parameters:
bufferoperation will use this buffer to get information from. Should not be destroyed before stop_writing was called and returned.
space_cbcallback which is called if there is not enough space to store data. May not implemented for all protocols.

Implements Arc::DataPoint.

Definition at line 167 of file DataPointIndex.cpp.

                                                            {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->StartWriting(buffer, cb);
  }

Stop reading.

Must be called after corresponding start_reading method, either after all data is transferred or to cancel transfer. Use buffer object to find out when data is transferred. Must return failure if any happened during transfer.

Implements Arc::DataPoint.

Definition at line 174 of file DataPointIndex.cpp.

                                         {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->StopReading();
  }

Stop writing.

Must be called after corresponding start_writing method, either after all data is transferred or to cancel transfer. Use buffer object to find out when data is transferred. Must return failure if any happened during transfer.

Implements Arc::DataPoint.

Definition at line 180 of file DataPointIndex.cpp.

                                         {
    if (!h || !*h)
      return DataStatus::NoLocationError;
    return (*h)->StopWriting();
  }
std::string Arc::DataPoint::str ( ) const [virtual, inherited]

Returns a string representation of the DataPoint.

Definition at line 53 of file DataPoint.cpp.

                                 {
    return url.str();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual DataStatus Arc::DataPoint::Unregister ( bool  all) [pure virtual, inherited]

Index Service unregistration.

Remove information about file registered in Indexing Service.

Parameters:
allif true, information about file itself is (LFN) is removed. Otherwise only particular physical instance is unregistered.

Implemented in Arc::DataPointDirect, Arc::DataPointRLS, and Arc::DataPointLFC.

Here is the caller graph for this function:

Returns true if URL can accept scattered data for writing operation.

Implements Arc::DataPoint.

Definition at line 227 of file DataPointIndex.cpp.

                                       {
    if (!h || !*h)
      return false;
    return (*h)->WriteOutOfOrder();
  }

Member Data Documentation

bool Arc::DataPoint::cache [protected, inherited]

Definition at line 325 of file DataPoint.h.

std::string Arc::DataPoint::checksum [protected, inherited]

Definition at line 320 of file DataPoint.h.

Time Arc::DataPoint::created [protected, inherited]

Definition at line 321 of file DataPoint.h.

DataStatus Arc::DataPoint::failure_code [protected, inherited]

Definition at line 324 of file DataPoint.h.

Definition at line 83 of file DataPointIndex.h.

std::list<URLLocation>::iterator Arc::DataPointIndex::location [private]

Definition at line 82 of file DataPointIndex.h.

List of locations at which file can be probably found.

Definition at line 77 of file DataPointIndex.h.

Logger Arc::DataPoint::logger [static, protected, inherited]

Definition at line 72 of file DataPointIndex.h.

Definition at line 71 of file DataPointIndex.h.

unsigned long long int Arc::DataPoint::size [protected, inherited]

Definition at line 319 of file DataPoint.h.

int Arc::DataPoint::triesleft [protected, inherited]

Definition at line 323 of file DataPoint.h.

const URL& Arc::DataPoint::url [protected, inherited]

Definition at line 315 of file DataPoint.h.

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

Definition at line 316 of file DataPoint.h.

Time Arc::DataPoint::valid [protected, inherited]

Definition at line 322 of file DataPoint.h.

std::list<std::string> Arc::DataPoint::valid_url_options [protected, inherited]

Subclasses should add their own specific options to this list.

Definition at line 327 of file DataPoint.h.


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