00001 #ifndef ACSNC_HELPER_H 00002 #define ACSNC_HELPER_H 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) Associated Universities Inc., 2002 00006 * (c) European Southern Observatory, 2002 00007 * Copyright by ESO (in the framework of the ALMA collaboration) 00008 * and Cosylab 2002, All rights reserved 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Lesser General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2.1 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this library; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * "@(#) $Id: acsncHelper.h,v 1.71.2.1 2008/11/13 06:18:47 cparedes Exp $" 00025 * 00026 * who when what 00027 * -------- -------- ---------------------------------------------- 00028 * david 20/09/02 created 00029 */ 00030 00031 /************************************************************************ 00032 * 00033 *---------------------------------------------------------------------- 00034 */ 00035 00036 #ifndef __cplusplus 00037 #error This is a C++ include file and cannot be used from plain C 00038 #endif 00039 00040 #include <orbsvcs/CosNamingC.h> 00041 #include <orbsvcs/CosNotifyChannelAdminS.h> 00042 #include <orbsvcs/CosNotifyCommC.h> 00043 #include <orbsvcs/CosNotifyFilterC.h> 00044 #include <orbsvcs/CosNotificationC.h> 00045 #include <orbsvcs/Notify/MonitorControlExt/NotifyMonitoringExtC.h> 00046 00047 #include "acsncS.h" 00048 #include "acsncC.h" 00049 #include "acsncORBHelper.h" 00050 #include "acsncCDBProperties.h" 00051 00052 #include <basencHelper.h> 00053 00054 #include <ACSErrTypeCommon.h> 00055 00056 00066 #define ACSNC_STRING_MACRO(something) #something 00067 00068 namespace nc { 00078 class Helper 00079 { 00080 public: 00089 Helper(const char* channelName, const char* notifyServiceDomainName = 0); 00090 00106 void 00107 resolveNamingService(CORBA::ORB_ptr orb_mp); 00108 00118 bool 00119 resolveNotifyChannel(); 00120 00128 bool resolveInternalNotificationChannel(); 00129 00139 static char * 00140 extractStructName(const char* idlStruct); 00141 00142 protected: 00154 virtual const char* 00155 getChannelKind(); 00156 00167 virtual const char* 00168 getChannelDomain(); 00169 00175 virtual const char* 00176 getNotificationFactoryName() 00177 { 00178 if (!notificationServiceName_mp) 00179 { 00180 CDB::DAL_var dal = CDBProperties::getCDB(); 00181 notificationServiceName_mp = BaseHelper::getNotificationFactoryNameForChannel(dal.in(), channelName_mp, notifyServiceDomainName_mp); 00182 if (!notificationServiceName_mp) 00183 notificationServiceName_mp = CORBA::string_dup(acscommon::NOTIFICATION_FACTORY_NAME); 00184 } 00185 00186 return notificationServiceName_mp; 00187 } 00188 00189 00190 00200 virtual void 00201 resolveNotificationFactory(); 00202 00214 virtual void 00215 createNotificationChannel(); 00216 00220 virtual ~Helper(); 00221 00231 virtual const CosNotification::QoSProperties 00232 getQoSProps(); 00233 00243 virtual const CosNotification::AdminProperties 00244 getAdminProps(); 00245 00246 00250 CosNaming::NamingContext_var namingContext_m; 00251 00257 CosNotifyChannelAdmin::EventChannel_var notifyChannel_m; 00258 00265 CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_m; 00266 00270 char *channelName_mp; 00271 00272 00276 char *notifyServiceDomainName_mp; 00277 00281 char *notificationServiceName_mp; 00282 00286 ORBHelper *orbHelper_mp; 00287 00288 00294 NotifyMonitoringExt::EventChannelFactory_var notifyFactory_m; 00295 00302 CosNotifyChannelAdmin::EventChannelFactory_var notifyFactoryOld_m; 00303 00308 CosNotifyChannelAdmin::ChannelID channelID_m; 00309 00310 00315 void 00316 integrationLog(const std::string& log); 00317 00318 private: 00319 00323 void operator=(const Helper&); 00324 00328 Helper(const Helper&); 00329 00334 bool okToLog_m; 00335 }; 00336 }; 00337 00338 #endif