bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
bes::CatalogItem Class Reference

#include <CatalogItem.h>

Inheritance diagram for bes::CatalogItem:
Inheritance graph
Collaboration diagram for bes::CatalogItem:
Collaboration graph

Classes

struct  CatalogItemAscending
 

Public Types

enum  item_type { unknown , node , leaf }
 

Public Member Functions

 CatalogItem ()
 Make an empty instance.
 
 CatalogItem (const std::string &name, size_t size, const std::string &lmt, bool is_data, item_type type)
 Hold information about an item in a BES Catalog.
 
 CatalogItem (const std::string &name, size_t size, const std::string &lmt, item_type type)
 Hold information about an item in a BES Catalog.
 
virtual void dump (std::ostream &strm) const
 
void encode_item (BESInfo *info) const
 Encode this CatalogItem in an info object.
 
std::string get_dap_service_url () const
 The DAP Dataset URL for an external DAP service.
 
std::string get_description () const
 The descrtiption of this item.
 
std::string get_lmt () const
 Get the last modified time for this item.
 
std::string get_name () const
 The name of this item in the node.
 
size_t get_size () const
 The size (bytes) of the item.
 
item_type get_type () const
 Get the type of this item (unknown, node or leaf)
 
bool is_data () const
 Is this item recognized as data?
 
void set_dap_service_url (const std::string &url)
 Is this item data that the BES should interpret?
 
void set_description (const std::string &n)
 Set the name of the item.
 
void set_is_data (bool id)
 Is this item data that the BES should interpret?
 
void set_lmt (const std::string &lmt)
 Set the LMT for this item.
 
void set_name (const std::string &n)
 Set the name of the item.
 
void set_size (size_t s)
 Set the size of the item.
 
void set_type (item_type t)
 Set the type for this item.
 

Detailed Description

An item that is part of a BES Catalog. Catalogs are a simple abstraction for a hierarchical organization of data, equivalent to a tree where a node can have zero or more leaves and zero or more child nodes. in that model, the CatalogItem is a leaf or a node. However, the CatalogItem class does not support building a tree. It will return information about the contents of a node, but not about the contents of that nodes child nodes. See CatalogNode and BESCatalog for a more complete picture of how this class is used.

In the Catalog abstraction, a leaf may be either a simple file that the BES will not process other than to stream its bytes to the client, or it may be a data file that the BES can open, read, and interpret. A node is always just a node. It may be empty, have only other nodes, have only leaves or have a combination of the two.

See also
CatalogNode
BESCatalog

Definition at line 73 of file CatalogItem.h.

Member Enumeration Documentation

◆ item_type

enum bes::CatalogItem::item_type

Definition at line 75 of file CatalogItem.h.

Constructor & Destructor Documentation

◆ CatalogItem() [1/3]

bes::CatalogItem::CatalogItem ( )
inline

Make an empty instance.

Definition at line 91 of file CatalogItem.h.

◆ CatalogItem() [2/3]

bes::CatalogItem::CatalogItem ( const std::string & name,
size_t size,
const std::string & lmt,
item_type type )
inline

Hold information about an item in a BES Catalog.

Store information about an item. Sets the id_data() property to false.

To determine if a leaf item is data, the name must match a regular expression that is used to identify data objects (typically files). See BESCatalogUtils for help in doing that.

Parameters
name
size
lmt
type

Definition at line 107 of file CatalogItem.h.

◆ CatalogItem() [3/3]

bes::CatalogItem::CatalogItem ( const std::string & name,
size_t size,
const std::string & lmt,
bool is_data,
item_type type )
inline

Hold information about an item in a BES Catalog.

Store information about an item. Sets the id_data() property to false.

To determine if a leaf item is data, the name must match a regular expression that is used to identify data objects (typically files). See BESCatalogUtils for help in doing that.

This const

Parameters
name
size
lmt
is_data
type

Definition at line 126 of file CatalogItem.h.

◆ ~CatalogItem()

virtual bes::CatalogItem::~CatalogItem ( )
inlinevirtual

Definition at line 129 of file CatalogItem.h.

Member Function Documentation

◆ dump()

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

Dump out information about this object

Parameters
strmWrite to this stream

Implements BESObj.

Definition at line 114 of file CatalogItem.cc.

◆ encode_item()

void CatalogItem::encode_item ( BESInfo * info) const

Encode this CatalogItem in an info object.

A CatalogItem is encoded as XML using the following grammar, where XML attributes in square brackets are optional.

<item name="path" itemType="leaf|node" lastModified="date T time"
[size="size in bytes" isData="true|false"] >

The element may hold information about leaves or nodes elements.

Parameters
infoAdd information to this instance of BESInfo.
See also
CatalogItem::encode_item()

Definition at line 65 of file CatalogItem.cc.

◆ get_dap_service_url()

std::string bes::CatalogItem::get_dap_service_url ( ) const
inline

The DAP Dataset URL for an external DAP service.

Definition at line 161 of file CatalogItem.h.

◆ get_description()

std::string bes::CatalogItem::get_description ( ) const
inline

The descrtiption of this item.

Definition at line 141 of file CatalogItem.h.

◆ get_lmt()

std::string bes::CatalogItem::get_lmt ( ) const
inline

Get the last modified time for this item.

Definition at line 151 of file CatalogItem.h.

◆ get_name()

std::string bes::CatalogItem::get_name ( ) const
inline

The name of this item in the node.

Definition at line 136 of file CatalogItem.h.

◆ get_size()

size_t bes::CatalogItem::get_size ( ) const
inline

The size (bytes) of the item.

Definition at line 146 of file CatalogItem.h.

◆ get_type()

item_type bes::CatalogItem::get_type ( ) const
inline

Get the type of this item (unknown, node or leaf)

Definition at line 166 of file CatalogItem.h.

◆ is_data()

bool bes::CatalogItem::is_data ( ) const
inline

Is this item recognized as data?

Definition at line 156 of file CatalogItem.h.

◆ set_dap_service_url()

void bes::CatalogItem::set_dap_service_url ( const std::string & url)
inline

Is this item data that the BES should interpret?

Definition at line 163 of file CatalogItem.h.

◆ set_description()

void bes::CatalogItem::set_description ( const std::string & n)
inline

Set the name of the item.

Definition at line 143 of file CatalogItem.h.

◆ set_is_data()

void bes::CatalogItem::set_is_data ( bool id)
inline

Is this item data that the BES should interpret?

Definition at line 158 of file CatalogItem.h.

◆ set_lmt()

void bes::CatalogItem::set_lmt ( const std::string & lmt)
inline

Set the LMT for this item.

Definition at line 153 of file CatalogItem.h.

◆ set_name()

void bes::CatalogItem::set_name ( const std::string & n)
inline

Set the name of the item.

Definition at line 138 of file CatalogItem.h.

◆ set_size()

void bes::CatalogItem::set_size ( size_t s)
inline

Set the size of the item.

Definition at line 148 of file CatalogItem.h.

◆ set_type()

void bes::CatalogItem::set_type ( item_type t)
inline

Set the type for this item.

Definition at line 168 of file CatalogItem.h.


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