bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESCatalogUtils Class Reference
Inheritance diagram for BESCatalogUtils:
Inheritance graph
Collaboration diagram for BESCatalogUtils:
Collaboration graph

Public Member Functions

 BESCatalogUtils (const std::string &name, bool strict=true)
 Initialize the file system catalog utilities.
 
virtual void dump (std::ostream &strm) const
 dump the contents of this object to the specified ostream
 
virtual bool exclude (const std::string &inQuestion) const
 Should this file/directory be excluded in the catalog?
 
bool follow_sym_links () const
 
virtual unsigned int get_entries (DIR *dip, const std::string &fullnode, const std::string &use_node, BESCatalogEntry *entry, bool dirs_only)
 
std::string get_handler_name (const std::string &item) const
 Find the handler name that will process.
 
const std::string & get_root_dir () const
 Get the root directory of the catalog.
 
virtual bool include (const std::string &inQuestion) const
 Should this file/directory be included in the catalog?
 
bool is_data (const std::string &item) const
 is there a handler that can process this
 

Static Public Member Functions

static void bes_add_stat_info (BESCatalogEntry *entry, const std::string &fullnode)
 
static void display_entry (BESCatalogEntry *entry, BESInfo *info)
 
static bool isData (const std::string &inQuestion, const std::string &catalog, std::list< std::string > &services)
 

Detailed Description

Definition at line 61 of file BESCatalogUtils.h.

Constructor & Destructor Documentation

◆ BESCatalogUtils()

BESCatalogUtils::BESCatalogUtils ( const std::string & name,
bool strict = true )

Initialize the file system catalog utilities.

Use parameters in the bes.conf file to configure a BES catalog that reads data from a file system. This will set the root directory of the catalog, regular expressions to exclude and include entries, regular expressions to identify data, and whether the catalog should follow symbolic links. The bes.conf key names are (N == catalog name):

BES.Catalog.N.RootDirectory BES.Catalog.N.Exclude BES.Catalog.N.Include BES.Catalog.N.TypeMatch BES.Catalog.N.FollowSymLinks

Note
The RootDirectory and TypeMatch keys must be present for any catalog N.
Parameters
nThe name of the catalog.
strictTrue (the default) means that the RootDirectory and TypeMatch must be defined; false causes this constructor to supply placeholder values. This feature was added for tests that run without the bes.conf file.

Definition at line 83 of file BESCatalogUtils.cc.

◆ ~BESCatalogUtils()

virtual BESCatalogUtils::~BESCatalogUtils ( )
inlinevirtual

Definition at line 93 of file BESCatalogUtils.h.

Member Function Documentation

◆ bes_add_stat_info()

void BESCatalogUtils::bes_add_stat_info ( BESCatalogEntry * entry,
const std::string & fullnode )
static

Add info about a node to an BESCatalogEntry object. This method calls stat(2) and passes the result to bes_add_stat_into().

Parameters
entryThe BESCatalogEntry object to modify
fullnode

Definition at line 460 of file BESCatalogUtils.cc.

◆ display_entry()

void BESCatalogUtils::display_entry ( BESCatalogEntry * entry,
BESInfo * info )
static

Definition at line 362 of file BESCatalogUtils.cc.

◆ dump()

void BESCatalogUtils::dump ( std::ostream & strm) const
virtual

dump the contents of this object to the specified ostream

This method is implemented by all derived classes to dump their contents, in other words, any state they might have, private variables, etc...

The inline function below can be used to dump the contents of an OPeNDAPObj object. For example, the object Animal is derived from BESObj. A user could do the following:

Animal *a = new dog( "Sparky" ) ; cout << a << endl ;

And the dump method for dog could display the name passed into the constructor, the (this) pointer of the object, etc...

Parameters
strmC++ i/o stream to dump the object to

Implements BESObj.

Definition at line 501 of file BESCatalogUtils.cc.

◆ exclude()

bool BESCatalogUtils::exclude ( const std::string & inQuestion) const
virtual

Should this file/directory be excluded in the catalog?

See also
BESCatalogUtils::include
Parameters
inQuestionThe file or directory name in question
Returns
True if the file/directory should be excluded, false if not.

Definition at line 229 of file BESCatalogUtils.cc.

◆ follow_sym_links()

bool BESCatalogUtils::follow_sym_links ( ) const
inline

Definition at line 107 of file BESCatalogUtils.h.

◆ get_entries()

unsigned int BESCatalogUtils::get_entries ( DIR * dip,
const std::string & fullnode,
const std::string & use_node,
BESCatalogEntry * entry,
bool dirs_only )
virtual
Parameters
dip
fullnode
use_node

param entry

Parameters
dirs_only
Returns

Definition at line 282 of file BESCatalogUtils.cc.

◆ get_handler_name()

std::string BESCatalogUtils::get_handler_name ( const std::string & item) const

Find the handler name that will process.

  • item

Using the TypeMatch regular expressions for the Catalog that holds this instance of CatalogUtils, find a handler that can process

  • item.
Note
Use BESServiceRegistry::TheRegistry()->services_handled(...); to get a list of the services provided by the handler.
Parameters
itemThe item to be handled
Returns
The handler name. The empty string if the item cannot be processed by any handler.

Definition at line 417 of file BESCatalogUtils.cc.

◆ get_root_dir()

const std::string & BESCatalogUtils::get_root_dir ( ) const
inline

Get the root directory of the catalog.

Returns
The pathname that is the root of the 'catalog'

Definition at line 102 of file BESCatalogUtils.h.

◆ include()

bool BESCatalogUtils::include ( const std::string & inQuestion) const
virtual

Should this file/directory be included in the catalog?

First check if the file should be included (matches at least one regex on the include list). If there are no regexes on the include list, that means include everything. Then test the exclude list. If there are no regexes on the exclude list, exclude nothing.

Parameters
inQuestionFile or directory in question
Returns
True if it should be included, false if not.

Definition at line 178 of file BESCatalogUtils.cc.

◆ is_data()

bool BESCatalogUtils::is_data ( const std::string & item) const

is there a handler that can process this

  • item

Using the TypeMatch regular expressions for the Catalog that holds this instance of CatalogUtils, find a handler that can process

  • item.
Parameters
itemThe item to be handled
Returns
The handler name. The empty string if the item cannot be processed by any handler.
See also
get_handler_name()

Definition at line 442 of file BESCatalogUtils.cc.

◆ isData()

bool BESCatalogUtils::isData ( const std::string & inQuestion,
const std::string & catalog,
std::list< std::string > & services )
static

Definition at line 493 of file BESCatalogUtils.cc.


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