nc::Helper

NAME
SYNOPSIS
Detailed Description
Constructor & Destructor Documentation
Member Function Documentation
Member Data Documentation
Author

NAME

nc::Helper −

SYNOPSIS

#include <acsncHelper.h>

Inherited by nc::Consumer [protected], nc::HelperTest, and nc::Supplier [protected].

Public Member Functions

Helper (const char *channelName, const char *acsNCDomainName=0)

void resolveNamingService (CORBA::ORB_ptr orb_mp)

bool resolveNotifyChannel ()

bool resolveInternalNotificationChannel ()

virtual std::string createRandomizedClientName (const std::string &clientName)

virtual void reconnect (::NotifyMonitoringExt::EventChannelFactory *ecf)

virtual std::string getCombinedChannelAndDomainName () const

Static Public Member Functions

static char * extractStructName (const char *idlStruct)

Protected Member Functions

virtual const char * getChannelKind ()

virtual const char * getChannelDomain ()

virtual const char * getNotificationFactoryName ()

virtual void resolveNotificationFactory ()

virtual void createNotificationChannel ()

virtual ~Helper ()

virtual const CosNotification::QoSProperties getQoSProps ()

virtual const CosNotification::AdminProperties getAdminProps ()

void integrationLog (const std::string &log)

Protected Attributes

CosNaming::NamingContext_var namingContext_m

CosNotifyChannelAdmin::EventChannel_var notifyChannel_m

CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_m

char * channelName_mp

char * acsNCDomainName_mp

std::string channelAndDomainName_m

char * notificationServiceName_mp

ORBHelper * orbHelper_mp

NotifyMonitoringExt::EventChannelFactory_var notifyFactory_m

CosNotifyChannelAdmin::EventChannelFactory_var notifyFactoryOld_m

CosNotifyChannelAdmin::ChannelID channelID_m

ReconnectionCallback * callback_m

Private Member Functions

void operator= (const Helper &)

Helper (const Helper &)

Private Attributes

bool okToLog_m

Detailed Description

Class Helper is a base class used to provide common functionality between the Consumer and Supplier classes. That is, it hides much of the ACE/TAO code used to access the Naming Service and channels from these classes.

TODO:

elminate use of the ORBHelper class

check for memory leaks

Constructor & Destructor Documentation

nc::Helper::Helper (const char * channelName, const char * acsNCDomainName = 0) Constructor

Parameters:

channelName Name of the channel
acsNCDomainName
Name of the ACS NC domain name

virtual nc::Helper::~Helper () [protected, virtual] Destructor is protected.

nc::Helper::Helper (const Helper &) [private] ALMA C++ coding standards state copy constructors should be disabled.

Member Function Documentation

virtual void nc::Helper::createNotificationChannel () [protected, virtual] Utility method. Create notification channel. Only used by Supplier to create NC.

Exceptions:

ACSErrTypeCommon::CORBAProblemEx
NotifyMonitoringExt::NameAlreadyUsed
when the factory tries to create a notification channel with the same name
NotifyMonitoringExt::NameMapError

Reimplemented in nc::HelperTest.

virtual std::string nc::Helper::createRandomizedClientName (const std::string & clientName) [virtual] Create the name of the client by appending a random number to the given client name and replacing ’/’ in the name with ’_’ This is used when setting names on NC proxy objects via the TAO extension API.

Parameters:

clientName The name of the client

Returns:

the name to register in the NC proxy

static char* nc::Helper::extractStructName (const char * idlStruct) [static] Helper method designed to eliminate ’xxx::’ from a passed string where ’xxx’ is some namespace. Designed to access the stringified name of an ’ICD event’.

Parameters:

idlStruct a string that may or may not contain ’xxx::’

Returns:

the string without ’xxx::’

virtual const CosNotification::AdminProperties nc::Helper::getAdminProps () [protected, virtual] Utility method. Returns admin properties used to create a notification channel. Developers should override this method if the defaults are insufficient.

Returns:

quality of service properties used to create a notification channel

virtual const char* nc::Helper::getChannelDomain () [protected, virtual] This method returns a constant character pointer to the domain of notification channel which is normally equivalent to acscommon::ALMADOMAIN. The sole reason this method is provided is to accommodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.

Returns:

pointer to a constant string.

virtual const char* nc::Helper::getChannelKind () [protected, virtual] This method returns a constant character pointer to the ’kind’ of notification channel as registered with the naming service (i.e., the kind field of a CosNaming::Name) which is normally equivalent to acscommon::NC_KIND. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.

Returns:

pointer to a constant string.

virtual std::string nc::Helper::getCombinedChannelAndDomainName () const [inline, virtual] Returns Combined channel and domain name which looks like channel_name and which is used in the naming service to identify the channel

References channelAndDomainName_m.

virtual const char* nc::Helper::getNotificationFactoryName () [inline, protected, virtual] This method returns a constant character pointer to the name of the notification service as registered with the CORBA Naming Service.

Returns:

pointer to a constant string. Normally acscommon::NOTIFICATION_FACTORY_NAME

Reimplemented in nc::ArchiveConsumer, and nc::HelperTest.

References acsNCDomainName_mp, channelName_mp, nc::CDBProperties::getCDB(), BaseHelper::getNotificationFactoryNameForChannel(), and notificationServiceName_mp.

virtual const CosNotification::QoSProperties nc::Helper::getQoSProps () [protected, virtual] Utility method. Returns quality of service properties used to create a notification channel. Override this method if the defaults are insufficient.

Returns:

quality of service properties used to create a notification channel

void nc::Helper::integrationLog (const std::string & log) [protected] The following was requested by Heiko Sommer and is needed for integrations. It should be removed at some later date.

void nc::Helper::operator= (const Helper &) [private] ALMA C++ coding standards state assignment operators should be disabled.

virtual void nc::Helper::reconnect (::NotifyMonitoringExt::EventChannelFactory * ecf) [virtual] This method allow to the Helper reconnect to the Notification Channel in case of Notify Service crashes. It is used by the the Persistance Notify Service extension and must be called only from the Reconnection Callback.

See also:

acsnc::ReconnectionCallback

Parameters:

ecf Pointer to the EventChannelFactory

Reimplemented in nc::Consumer, and nc::Supplier.

bool nc::Helper::resolveInternalNotificationChannel () This is used by Consumers and Suppliers to get the notification channel. It first tries to resolved and if it fails, it tries to create it. If it fails to create it, it waits 2 seconds and tries again, 20 times. If it still fails, returns false

void nc::Helper::resolveNamingService (CORBA::ORB_ptr orb_mp) Resolve the TAO naming service. In reality, this is the only CORBA service we need to create a notification channel. The naming service can be used to get references to anything registered with it.

Parameters:

orb_mp orb_mp is what we use to get a reference to the naming service. This method assumes that orb_mp was started with a correct reference to the Naming Service. It should be noted that by passing (CORBA::ORB *) 0, this method will default to Container’s ORB (which is preferred).

Exceptions:

ACSErrTypeCommon::CORBAProblemEx
ACSErrTypeCommon::CouldntCreateThreadEx

Returns:

void

virtual void nc::Helper::resolveNotificationFactory () [protected, virtual] Utility method. Try to resolve the Notify factory from the Naming service. Only used by Supplier to create NC.

Exceptions:

ACSErrTypeCommon::CORBAProblemEx

bool nc::Helper::resolveNotifyChannel () This is used to determine if the notification channel we want to use has been registered with the Naming Service. If it has, we use that directly.

Returns:

true if named channel exists. False otherwise

Exceptions:

ACSErrTypeCommon::CORBAProblemEx

Member Data Documentation

char* nc::Helper::acsNCDomainName_mp [protected] Name of the ACS NC domain.

Referenced by getNotificationFactoryName().

ReconnectionCallback* nc::Helper::callback_m [protected]

std::string nc::Helper::channelAndDomainName_m [protected] Channel and domain name (like channel_name)

Referenced by getCombinedChannelAndDomainName().

CosNotifyChannelAdmin::ChannelID nc::Helper::channelID_m [protected] Keep a reference to the channel. Should this be removed in future releases of ACS???

char* nc::Helper::channelName_mp [protected] Name of the notification channel.

Referenced by getNotificationFactoryName().

CosNotifyChannelAdmin::InterFilterGroupOperator nc::Helper::ifgop_m [protected] The group operator between admin-proxy’s. The purpose of this variable is to define how multiple Filters are considered in a proxy admin. Basically this variable does not matter since filtering at the admin level is not allowed!

CosNaming::NamingContext_var nc::Helper::namingContext_m [protected] A naming context (i.e., Naming Service reference)

char* nc::Helper::notificationServiceName_mp [protected] Name of ’resolved’ notification service.

Referenced by getNotificationFactoryName().

CosNotifyChannelAdmin::EventChannel_var nc::Helper::notifyChannel_m [protected] The notification channel used to send/receive events. This is created by the notification channel factory. This channel is bound to the naming service using channelAndDomainName_m.

NotifyMonitoringExt::EventChannelFactory_var nc::Helper::notifyFactory_m [protected] Channel factory. Used to create new channels. The extended mode of TAO is used to prevent the creation of a channel multiple times

CosNotifyChannelAdmin::EventChannelFactory_var nc::Helper::notifyFactoryOld_m [protected] Channel factory. Used to create new channels. In the case of a non TAO implementation or the initialization of the service without the extended mode, the standard mode is used

bool nc::Helper::okToLog_m [private] The following was requested by Heiko Sommer and is needed for integrations. It should be removed at some later date.

ORBHelper* nc::Helper::orbHelper_mp [protected] In case of standalone mode, this must be used!

Author

Generated automatically by Doxygen for ACS-2015.2 C++ API from the source code.