Пример #1
0
//-----------------------------------------------------------------------------
const CosNotification::AdminProperties
BaseHelper::getAdminProps()
{
    CosNotification::AdminProperties retVal;
    retVal.length(0);

    return retVal;
}
Пример #2
0
    //------------------------------------------------------
    CosNotification::AdminProperties
    CDBProperties::getCDBAdminProps(const std::string& channelName)
    {
	CosNotification::AdminProperties retVal;
	retVal.length(0);
	
	//sanity check
	if (cdbChannelConfigExists(channelName)==false)
	    {
	    ACS_STATIC_SHORT_LOG((LM_INFO,
				  "CDBProperties::getCDBAdminProps",
				  "Channel does not exist."));
	    return retVal;
	    }
	
	//CDB
	//complete name of the channel within the CDB
	std::string cdbChannelName = "MACI/Channels/" + channelName;
	CDB::DAL_var cdbRef = getCDB();
	CDB::DAO_var tempDAO = cdbRef->get_DAO_Servant(cdbChannelName.c_str());

	//temporary pointer points to the name of the CosNotification
	//property
	const char *name_p;
	//temporary counter
	unsigned int i = 0U;
	
	//MaxQueueLength - TAO 1.1 had a queque of ~5 events.  TAO 1.3 allows an
	//                 infinite amount of events to be stored.  20 seems like
	//                 a reasonable default.
	{
	name_p = CosNotification::MaxQueueLength;
	//allocate one extra element
	i++;
	retVal.length(i);
	
	retVal[i-1].name = CORBA::string_dup(name_p);
	retVal[i-1].value <<= tempDAO->get_long(name_p);
	}

	//Max consumers///////////////////////////////////////////////////
	{
	name_p = CosNotification::MaxConsumers;
	//allocate one extra element
	i++;
	retVal.length(i);
	retVal[i-1].name = CORBA::string_dup(name_p);
	retVal[i-1].value <<= tempDAO->get_long(name_p);
	}
	//Max suppliers///////////////////////////////////////////////////
	{
	name_p = CosNotification::MaxSuppliers;
	//allocate one extra element
	i++;
	retVal.length(i);
	retVal[i-1].name = CORBA::string_dup(name_p);
	retVal[i-1].value <<= tempDAO->get_long(name_p);
	}
	//Reject new events///////////////////////////////////////////////
	{
	name_p = CosNotification::RejectNewEvents;
	//allocate one extra element
	i++;
	retVal.length(i);
	retVal[i-1].name = CORBA::string_dup(name_p);
	std::string tString = tempDAO->get_string(name_p);
	if(tString=="false")
	    {
	    retVal[i-1].value <<= FALSE; 
	    }
	else
	    {
	    retVal[i-1].value <<= TRUE;
	    }
	}

	//for debugging purposes only
	std::string debugMessage = "Length=" + retVal.length();
	STATIC_LOG(Logging::BaseLog::LM_DEBUG, 
		   "nc::CDBProperties::getCDBAdminProps",
		   debugMessage);
	
	return retVal;
    }