Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes | Friends
Arc::InfoRegister Class Reference

Registration to ISIS interface. More...

#include <InfoRegister.h>

Collaboration diagram for Arc::InfoRegister:
Collaboration graph

List of all members.

Public Member Functions

 InfoRegister (XMLNode &node, Service *service_)
 ~InfoRegister ()
 operator bool (void)
bool operator! (void)
long int getPeriod (void) const
std::string getServiceID (void)
std::string getEndpoint (void)
std::string getExpiration (void)
ServicegetService (void)

Private Attributes

long int reg_period_
std::string serviceid
std::string expiration
std::string endpoint
NS ns_


class InfoRegisterContainer

Detailed Description

Registration to ISIS interface.

This class represents service registering to Information Indexing Service. It does not perform registration itself. It only collects configuration information. Configuration is as described in InfoRegisterConfig.xsd for element InfoRegistration.

Definition at line 28 of file InfoRegister.h.

Constructor & Destructor Documentation

Arc::InfoRegister::InfoRegister ( XMLNode node,
Service service_ 

Definition at line 34 of file InfoRegister.cpp.

                                                        :reg_period_(0),service_(service) {
    ns_["isis"] = ISIS_NAMESPACE;
    ns_["glue2"] = GLUE2_D42_NAMESPACE;
    ns_["register"] = REGISTRATION_NAMESPACE;

    // parse config
    std::string s_reg_period = (std::string)cfg["InfoRegister"]["Period"];
    if (!s_reg_period.empty()) {
        Period p(s_reg_period);
        reg_period_ = p.GetPeriod();
        if (reg_period_ < 120)
            reg_period_ = 120;
    } else {
        reg_period_ = -1;
    std::string s_serviceid = (std::string)cfg["InfoRegister"]["ServiceID"];
    if (!s_serviceid.empty()) {
        serviceid = s_serviceid;
    if ((bool)cfg["InfoRegister"]["Endpoint"])
        endpoint = (std::string)cfg["InfoRegister"]["Endpoint"];
    if ((bool)cfg["InfoRegister"]["Expiration"])
        expiration = (std::string)cfg["InfoRegister"]["Expiration"];

    std::string configuration_string;
    XMLNode temp;
    temp.GetDoc(configuration_string, true);
    logger_.msg(VERBOSE, "InfoRegister created with config:\n%s", configuration_string);

    // Add service to registration list. Optionally only for
    // registration through specific registrants.
    std::list<std::string> ids;
    for(XMLNode r = cfg["InfoRegister"]["Registrar"];(bool)r;++r) {
      std::string id = (std::string) r["URL"];
      if(!id.empty()) ids.push_back(id);
      else logger_.msg(WARNING, "Discarding Registrar because the \"URL\" element is missing or empty.");

Here is the call graph for this function:

Definition at line 76 of file InfoRegister.cpp.

    // This element is supposed to be destroyed with service.
    // Hence service should not be restered anymore.
    // TODO: initiate un-register of service

Here is the call graph for this function:

Member Function Documentation

std::string Arc::InfoRegister::getEndpoint ( void  ) [inline]

Definition at line 47 of file InfoRegister.h.

{ if (endpoint.empty()) return ""; else return endpoint; };

Here is the caller graph for this function:

std::string Arc::InfoRegister::getExpiration ( void  ) [inline]

Definition at line 48 of file InfoRegister.h.

{ if (expiration.empty()) return ""; else return expiration; };

Here is the caller graph for this function:

long int Arc::InfoRegister::getPeriod ( void  ) const [inline]

Definition at line 45 of file InfoRegister.h.

{ return reg_period_; };

Here is the caller graph for this function:

Service* Arc::InfoRegister::getService ( void  ) [inline]

Definition at line 49 of file InfoRegister.h.

{ return service_; };
std::string Arc::InfoRegister::getServiceID ( void  ) [inline]

Definition at line 46 of file InfoRegister.h.

{ if (serviceid.empty()) return ""; else return serviceid; };

Here is the caller graph for this function:

Arc::InfoRegister::operator bool ( void  ) [inline]

Definition at line 43 of file InfoRegister.h.

{ return service_; };
bool Arc::InfoRegister::operator! ( void  ) [inline]

Definition at line 44 of file InfoRegister.h.

{ return !service_; };

Friends And Related Function Documentation

friend class InfoRegisterContainer [friend]

Definition at line 29 of file InfoRegister.h.

Member Data Documentation

std::string Arc::InfoRegister::endpoint [private]

Definition at line 36 of file InfoRegister.h.

std::string Arc::InfoRegister::expiration [private]

Definition at line 35 of file InfoRegister.h.

Definition at line 39 of file InfoRegister.h.

long int Arc::InfoRegister::reg_period_ [private]

Definition at line 32 of file InfoRegister.h.

Definition at line 38 of file InfoRegister.h.

std::string Arc::InfoRegister::serviceid [private]

Definition at line 34 of file InfoRegister.h.

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