00001 /******************************************************************************* 00002 * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved. 00003 * Copyright (C) 2004 Novell, Inc. All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * - Redistributions of source code must retain the above copyright notice, 00009 * this list of conditions and the following disclaimer. 00010 * 00011 * - Redistributions in binary form must reproduce the above copyright notice, 00012 * this list of conditions and the following disclaimer in the documentation 00013 * and/or other materials provided with the distribution. 00014 * 00015 * - Neither the name of Vintela, Inc. nor the names of its 00016 * contributors may be used to endorse or promote products derived from this 00017 * software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 00020 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00022 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS 00023 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00024 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00025 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00026 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00027 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00029 * POSSIBILITY OF SUCH DAMAGE. 00030 *******************************************************************************/ 00031 00037 #ifndef OW_PROVIDERAGENT_HPP_INCLUDE_GUARD_ 00038 #define OW_PROVIDERAGENT_HPP_INCLUDE_GUARD_ 00039 #include "OW_config.h" 00040 #include "OW_String.hpp" 00041 #include "OW_IntrusiveReference.hpp" 00042 #include "OW_RequestHandlerIFC.hpp" 00043 #include "OW_Logger.hpp" 00044 #include "OW_ConfigFile.hpp" 00045 #include "OW_UnnamedPipe.hpp" 00046 #include "OW_CppProviderBaseIFC.hpp" 00047 #include "OW_AuthenticatorIFC.hpp" 00048 #include "OW_CommonFwd.hpp" 00049 #include "OW_ServicesHttpFwd.hpp" 00050 #include "OW_ProviderAgentFwd.hpp" 00051 #include "OW_ProviderAgentLifecycleCallbackIFC.hpp" 00052 #include "OW_ProviderAgentLockerIFC.hpp" 00053 #include "OW_IntrusiveCountableBase.hpp" 00054 00055 namespace OW_NAMESPACE 00056 { 00057 00058 00059 class OW_PROVIDERAGENT_API ProviderAgent : public IntrusiveCountableBase 00060 { 00061 public: 00062 // option which specifies the locking strategy. 00063 // Valid values are LockingTypeNone ("none"), LockingTypeSWMR ("swmr"), or LockingTypeSingleThreaded ("single_threaded") 00064 // If not specified the default of LockingTypeNone is assumed. 00065 static const char* const LockingType_opt; 00066 00067 // option value which specifies that no locking will be done. 00068 static const char* const LockingTypeNone; 00069 00070 // option value which specifies that single-writer, multiple-reader locking will be done. 00071 static const char* const LockingTypeSWMR; 00072 00073 // option value which specifies that full locking will be done. All requests will be serialized. 00074 static const char* const LockingTypeSingleThreaded; 00075 00076 // option which specifies the timeout to use if the LockingType option specifies SWMR locking (LockingTypeSWMR). 00077 // valid values are positive integers. 00078 // If not specified the default of 300 is assumed. 00079 static const char* const LockingTimeout_opt; 00080 00081 // option which specifies whether classes will be retrieved using the callbackURL. 00082 // valid values are "true" or "false". 00083 // If not specified the default of "false" is assumed. 00084 static const char* const DynamicClassRetrieval_opt; 00085 00086 // option which specifies whether to use the connection credentials when calling back into the cimom 00087 // valid values are "true" or "false". 00088 // If not specified the default of "false" is assumed. 00089 static const char* const UseConnectionCredentials_opt; 00090 00148 ProviderAgent( 00149 const ConfigFile::ConfigMap& configMap, 00150 const Array<CppProviderBaseIFCRef>& providers, 00151 const Array<CIMClass>& classes, 00152 const Array<RequestHandlerIFCRef>& requestHandlers, 00153 const AuthenticatorIFCRef& authenticator, 00154 const LoggerRef& logger = LoggerRef(), 00155 const String& callbackURL = String(""), 00156 const ProviderAgentLockerIFCRef& locker = ProviderAgentLockerIFCRef(), 00157 const ProviderAgentLifecycleCallbackIFCRef& lifecycleCB = ProviderAgentLifecycleCallbackIFCRef()); 00158 virtual ~ProviderAgent(); 00164 void shutdownHttpServer(); 00165 private: 00166 HTTPServerRef m_httpServer; 00167 ThreadRef m_httpThread; 00168 UnnamedPipeRef m_stopHttpPipe; 00169 ProviderAgentLifecycleCallbackIFCRef m_lifecycleCB; 00170 }; 00171 00172 } // end namespace OW_NAMESPACE 00173 00174 #endif //#ifndef OW_PROVIDERAGENT_HPP_INCLUDE_GUARD_