00001
00009 #include "PKIFCacheMediator2.h"
00010 #include "PKIFCacheErrors.h"
00011 #include "PKIFCacheException.h"
00012 #include "PKIFLog.h"
00013 #include "PKIFCRLDPRetrieval.h"
00014 #include "ToolkitUtils.h"
00015 #include "ScopeGuard.h"
00016 #include "PKIFCRLNodeEntry.h"
00017 #include "GottaMatch.h"
00018
00019
00020 #ifdef _WIN32
00021 #include "PKIFCAPIRepository2.h"
00022 #include "PKIFCAPITrustStore2.h"
00023 #include "CAPITrustRootCRLRepository2.h"
00024 #else
00025
00026 #include "PKIFNSSRepository.h"
00027 #include "PKIFNSSTrustStore.h"
00028 #include "PKIFNSSCertUpdate.h"
00029 #include "PKIFNSSCRLUpdate.h"
00030 #endif //_WIN32
00031
00032
00033 #include "boost/thread/recursive_mutex.hpp"
00034
00035 #ifdef _WIN32
00036 #ifdef _DEBUG
00037 #include "crtdbg.h"
00038 #endif //_DEBUG
00039 #endif //_WIN32
00040
00041 using namespace std;
00042 using namespace boost;
00043
00045 struct CPKIFCacheMediator2Impl
00046 {
00054 CPKIFCacheMediator2Impl(): m_me()
00055 {
00056 m_bInitialized = false;
00057 m_addDefaultColleagues = false;
00058 };
00059
00060 boost::recursive_mutex m_me;
00061
00062
00063
00064
00065
00066
00068 std::vector<IPKIFColleaguePtr> m_vModules;
00069
00071 std::vector<IPKIFCRLRepositoryUpdatePtr> m_vCRLRepUptadeModules;
00073 std::vector<IPKIFCRLRepositoryPtr> m_vCRLRepModules;
00075 std::vector<IPKIFCertRepositoryUpdatePtr> m_vCertRepUpdateModules;
00077 std::vector<IPKIFCertRepositoryPtr> m_vCertRepModules;
00079 std::vector<IPKIFCertSearchPtr> m_vCertSearchModules;
00081 std::vector<IPKIFTrustCachePtr> m_vTrustCacheModules;
00083 std::vector<IPKIFSupportsSynonymousCRLSourcesPtr> m_vSynonymousCRLSources;
00085 std::vector<IPKIFSupportsSynonymousCertSourcesPtr> m_vSynonymousCertSources;
00087 std::vector<IPKIFSynonymousSourceStorePtr> m_vSynonymousStore;
00088
00090 std::vector<IPKIFCRLRepositoryPtr> m_vNoCRLSynSourceSupport;
00092 std::vector<IPKIFCertRepositoryPtr> m_vNoCertSynSourceSupport;
00093
00095 bool m_addDefaultColleagues;
00096
00098 bool m_bInitialized;
00099
00100
00101 void GetCerts(CPKIFCertificateSourceList& certSources, CPKIFCertificateNodeList& certNodeList);
00102 void GetCerts(CPKIFCertificateSourcePtr& certSource, CPKIFCertificateNodeList& certNodeList);
00103 void AddCerts(CPKIFCertificateNodeList& certNodeList);
00104
00105 void GetCrls(const CPKIFCertificatePtr& cert,CPKIFCrlSourceList& crlSources, CPKIFCRLNodeList& crlNodeList);
00106 void GetCrls(const CPKIFCertificatePtr& cert,CPKIFCrlSourcePtr& crlSource, CPKIFCRLNodeList& crlNodeList);
00107 void AddCrls(CPKIFCRLNodeList& crlNodeList);
00108 };
00116 void CPKIFCacheMediator2Impl::AddCerts(
00118 CPKIFCertificateNodeList& certNodeList)
00119 {
00120 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storePos;
00121 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storeEnd = m_vSynonymousStore.end();
00122 for(storePos = m_vSynonymousStore.begin(); storePos != storeEnd; ++storePos)
00123 {
00124 CPKIFCertificateNodeList::iterator certNodePos;
00125 CPKIFCertificateNodeList::iterator certNodeEnd = certNodeList.end();
00126 for(certNodePos = certNodeList.begin(); certNodePos != certNodeEnd; ++certNodePos)
00127 {
00128 (*storePos)->AddCert(*certNodePos);
00129 }
00130 }
00131 }
00132
00133 void CPKIFCacheMediator2Impl::AddCrls(
00135 CPKIFCRLNodeList& crlNodeList)
00136 {
00137 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storePos;
00138 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storeEnd = m_vSynonymousStore.end();
00139 for(storePos = m_vSynonymousStore.begin(); storePos != storeEnd; ++storePos)
00140 {
00141 CPKIFCRLNodeList::iterator crlNodePos;
00142 CPKIFCRLNodeList::iterator crlNodeEnd = crlNodeList.end();
00143 for(crlNodePos = crlNodeList.begin(); crlNodePos != crlNodeEnd; ++crlNodePos)
00144 {
00145 (*storePos)->AddCRL(*crlNodePos);
00146 }
00147 }
00148 }
00156 void CPKIFCacheMediator2Impl::GetCerts(
00158 CPKIFCertificateSourcePtr& certSource,
00160 CPKIFCertificateNodeList& certNodeList)
00161 {
00162 CPKIFCertificateSourceList list;
00163 list.push_back(certSource);
00164 GetCerts(list, certNodeList);
00165 }
00166
00167 void CPKIFCacheMediator2Impl::GetCrls(
00168 const CPKIFCertificatePtr& cert,
00170 CPKIFCrlSourcePtr& crlSource,
00172 CPKIFCRLNodeList& crlNodeList)
00173 {
00174 CPKIFCrlSourceList list;
00175 list.push_back(crlSource);
00176 GetCrls(cert, list, crlNodeList);
00177 }
00178
00186 void CPKIFCacheMediator2Impl::GetCerts(
00188 CPKIFCertificateSourceList& certSources,
00190 CPKIFCertificateNodeList& certNodeList)
00191 {
00192 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storePos;
00193 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storeEnd = m_vSynonymousStore.end();
00194 for(storePos = m_vSynonymousStore.begin(); storePos != storeEnd; ++storePos)
00195 {
00196 (*storePos)->GetCerts(certSources, certNodeList);
00197 }
00198 }
00199
00200 void CPKIFCacheMediator2Impl::GetCrls(
00201 const CPKIFCertificatePtr& cert,
00203 CPKIFCrlSourceList& crlSources,
00205 CPKIFCRLNodeList& crlNodeList)
00206 {
00207 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storePos;
00208 std::vector<IPKIFSynonymousSourceStorePtr>::iterator storeEnd = m_vSynonymousStore.end();
00209 for(storePos = m_vSynonymousStore.begin(); storePos != storeEnd; ++storePos)
00210 {
00211 (*storePos)->GetCRLs(cert, crlSources, crlNodeList);
00212 }
00213 }
00214
00216
00228 CPKIFCacheMediator2::CPKIFCacheMediator2(
00230 bool addDefaultColleagues) : m_impl (new CPKIFCacheMediator2Impl)
00231 {
00232 m_impl->m_addDefaultColleagues = addDefaultColleagues;
00233 LOG_STRING_DEBUG("CPKIFCacheMediator2::CPKIFCacheMediator2(void)", TOOLKIT_SR_MEDIATOR, 0, this);
00234 }
00235
00236
00245 CPKIFCacheMediator2::~CPKIFCacheMediator2(void)
00246 {
00247 LOG_STRING_DEBUG("CPKIFCacheMediator2::~CPKIFCacheMediator2(void)", TOOLKIT_SR_MEDIATOR, 0, this);
00248
00249 Terminate();
00250
00251 if(m_impl) delete m_impl;
00252 m_impl = NULL;
00253 }
00254
00264 void CPKIFCacheMediator2::Terminate()
00265 {
00266 LOG_STRING_DEBUG("CPKIFCacheMediator2::Terminate()", TOOLKIT_SR_MEDIATOR, 0, this);
00267
00268 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00269 try
00270 {
00271
00272 RemoveParentRelationships(m_impl->m_vModules, this);
00273
00274 RemoveMediatorAssociations();
00275
00276
00277 IPKIFMediator::Terminate();
00278
00279
00280 m_impl->m_vCRLRepUptadeModules.clear();
00281 m_impl->m_vCRLRepModules.clear();
00282 m_impl->m_vCertRepUpdateModules.clear();
00283 m_impl->m_vCertRepModules.clear();
00284 m_impl->m_vCertSearchModules.clear();
00285 m_impl->m_vTrustCacheModules.clear();
00286 m_impl->m_vSynonymousCRLSources.clear();
00287 m_impl->m_vSynonymousCertSources.clear();
00288 m_impl->m_vSynonymousStore.clear();
00289 m_impl->m_vNoCRLSynSourceSupport.clear();
00290 m_impl->m_vNoCertSynSourceSupport.clear();
00291
00292
00293 m_impl->m_vModules.clear();
00294 }
00295 catch(CPKIFException& )
00296 {
00297
00298
00299 LOG_STRING_ERROR("CPKIFException encountered during CPKIFCacheMediator2 mediator termination", thisComponent, COMMON_TERMINATION_ERROR, this);
00300
00301 _ASSERT(false);
00302 }
00303 catch(...)
00304 {
00305 LOG_STRING_FATAL("Unknown exception encountered during CPKIFCacheMediator2 mediator termination", thisComponent, COMMON_TERMINATION_ERROR, this);
00306 _ASSERT(false);
00307 }
00308 }
00309
00320 void CPKIFCacheMediator2::Initialize()
00321 {
00322 InitializeMediator(NULL);
00323 }
00324
00339 void CPKIFCacheMediator2::InitializeMediator(
00341 std::vector<CPKIFException*>* errorInfo)
00342 {
00343 LOG_STRING_DEBUG("CPKIFCacheMediator2::InitializeMediator(std::vector<CPKIFException*>* errorInfo)", TOOLKIT_SR_MEDIATOR, 0, this);
00344
00345
00346 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00347 LOG_STRING_DEBUG("Initializing CPKIFCacheMediator2 mediator", thisComponent, 0, this);
00348
00349
00350 if(m_impl->m_bInitialized)
00351 throw CPKIFCacheException(thisComponent, COMMON_ALREADY_INITIALIZED, "This instance has already been initialized. Call Terminate prior to re-initializing.");
00352
00353 if(m_impl->m_addDefaultColleagues)
00354 {
00355 #ifdef _WIN32
00356
00357
00358
00359 IPKIFColleaguePtr cp;
00360 CPKIFCAPIRepository2Ptr x1(new CPKIFCAPIRepository2());
00361 CPKIFCAPITrustStore2Ptr x2(new CPKIFCAPITrustStore2());
00362 CPKIFCAPITrustRootCRLRepository2Ptr x3(new CPKIFCAPITrustRootCRLRepository2());
00363 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFCAPIRepository2>(x1);
00364 AddColleague(cp);
00365 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFCAPITrustStore2>(x2);
00366 AddColleague(cp);
00367 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFCAPITrustRootCRLRepository2>(x3);
00368 AddColleague(cp);
00369 #else
00370
00371
00372 CPKIFNSSRepositoryPtr repo(new CPKIFNSSRepository());
00373 CPKIFNSSTrustStorePtr trust(new CPKIFNSSTrustStore());
00374 CPKIFNSSCertUpdatePtr certup(new CPKIFNSSCertUpdate());
00375 CPKIFNSSCRLUpdatePtr crlup(new CPKIFNSSCRLUpdate());
00376
00377
00378 IPKIFColleaguePtr cp = dynamic_pointer_cast<IPKIFColleague,CPKIFNSSRepository>(repo);
00379 AddColleague(cp);
00380 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFNSSTrustStore>(trust);
00381 AddColleague(cp);
00382 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFNSSCertUpdate>(certup);
00383 AddColleague(cp);
00384 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFNSSCRLUpdate>(crlup);
00385 AddColleague(cp);
00386 #endif
00387 CPKIFCRLDPRetrievalPtr x4(new CPKIFCRLDPRetrieval());
00388 cp = dynamic_pointer_cast<IPKIFColleague,CPKIFCRLDPRetrieval>(x4);
00389 AddColleague(cp);
00390 }
00391 m_impl->m_bInitialized = true;
00392 }
00393
00421 void CPKIFCacheMediator2::AddColleague(
00423 IPKIFColleaguePtr& module)
00424 {
00425 LOG_STRING_DEBUG("CPKIFCacheMediator2::AddColleague(IPKIFColleague* module, bool transferOwnership)", TOOLKIT_SR_MEDIATOR, 0, this);
00426
00427 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00428
00429 if(!module)
00430 return;
00431
00432
00433 module->Initialize();
00434 module->AddParent(this);
00435
00436 try
00437 {
00438 m_impl->m_vModules.push_back(module);
00439 if(dynamic_pointer_cast<IPKIFCRLRepositoryUpdate, IPKIFColleague>(module))
00440 m_impl->m_vCRLRepUptadeModules.push_back(dynamic_pointer_cast<IPKIFCRLRepositoryUpdate, IPKIFColleague>(module));
00441 if(dynamic_pointer_cast<IPKIFCRLRepository, IPKIFColleague>(module))
00442 m_impl->m_vCRLRepModules.push_back(dynamic_pointer_cast<IPKIFCRLRepository, IPKIFColleague>(module));
00443 if(dynamic_pointer_cast<IPKIFCertRepositoryUpdate, IPKIFColleague>(module))
00444 m_impl->m_vCertRepUpdateModules.push_back(dynamic_pointer_cast<IPKIFCertRepositoryUpdate, IPKIFColleague>(module));
00445 if(dynamic_pointer_cast<IPKIFCertRepository, IPKIFColleague>(module))
00446 m_impl->m_vCertRepModules.push_back(dynamic_pointer_cast<IPKIFCertRepository, IPKIFColleague>(module));
00447 if(dynamic_pointer_cast<IPKIFCertSearch, IPKIFColleague>(module))
00448 m_impl->m_vCertSearchModules.push_back(dynamic_pointer_cast<IPKIFCertSearch, IPKIFColleague>(module));
00449 if(dynamic_pointer_cast<IPKIFTrustCache, IPKIFColleague>(module))
00450 m_impl->m_vTrustCacheModules.push_back(dynamic_pointer_cast<IPKIFTrustCache, IPKIFColleague>(module));
00451
00452 if(dynamic_pointer_cast<IPKIFSupportsSynonymousCRLSources, IPKIFColleague>(module))
00453 m_impl->m_vSynonymousCRLSources.push_back(dynamic_pointer_cast<IPKIFSupportsSynonymousCRLSources, IPKIFColleague>(module));
00454 else if(dynamic_pointer_cast<IPKIFCRLRepository, IPKIFColleague>(module))
00455 m_impl->m_vNoCRLSynSourceSupport.push_back(dynamic_pointer_cast<IPKIFCRLRepository, IPKIFColleague>(module));
00456
00457 if(dynamic_pointer_cast<IPKIFSupportsSynonymousCertSources, IPKIFColleague>(module))
00458 m_impl->m_vSynonymousCertSources.push_back(dynamic_pointer_cast<IPKIFSupportsSynonymousCertSources, IPKIFColleague>(module));
00459 else if(dynamic_pointer_cast<IPKIFCertRepository, IPKIFColleague>(module))
00460 m_impl->m_vNoCertSynSourceSupport.push_back(dynamic_pointer_cast<IPKIFCertRepository, IPKIFColleague>(module));
00461
00462 if(dynamic_pointer_cast<IPKIFSynonymousSourceStore, IPKIFColleague>(module))
00463 m_impl->m_vSynonymousStore.push_back(dynamic_pointer_cast<IPKIFSynonymousSourceStore, IPKIFColleague>(module));
00464 }
00465 catch(...)
00466 {
00467 throw;
00468 }
00469 }
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00498 void CPKIFCacheMediator2::GetCRLs(const CPKIFCertificatePtr& cert, CPKIFCRLNodeList& crlNodeList, PKIInfoSource source)
00499 {
00500 CPKIFPathSettingsPtr ps;
00501 GetCRLs(cert, crlNodeList, source, ps);
00502 }
00503 void CPKIFCacheMediator2::GetCRLs(const CPKIFCertificatePtr& cert, CPKIFCRLNodeList& crlNodeList, PKIInfoSource source, CPKIFPathSettingsPtr& ps)
00504 {
00505 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00506
00507 vector<IPKIFCRLRepositoryPtr>::iterator pos;
00508 vector<IPKIFCRLRepositoryPtr>::iterator end;
00509
00510 bool opAttempted = false, opSucceeded = false;
00511 if(!m_impl->m_vSynonymousStore.empty() || !m_impl->m_vSynonymousCRLSources.empty())
00512 {
00513
00514 opAttempted = true;
00515 opSucceeded = true;
00516
00517 CPKIFCrlSourceList crlSources;
00518
00519
00520 std::vector<IPKIFSupportsSynonymousCRLSourcesPtr>::iterator sourcePos;
00521 std::vector<IPKIFSupportsSynonymousCRLSourcesPtr>::iterator sourceEnd = m_impl->m_vSynonymousCRLSources.end();
00522 for(sourcePos = m_impl->m_vSynonymousCRLSources.begin(); sourcePos != sourceEnd; ++sourcePos)
00523 {
00524 (*sourcePos)->GetCRLSources(cert, crlSources);
00525 }
00526
00527
00528
00529 CPKIFCrlSourceList::iterator sourceListPos;
00530 CPKIFCrlSourceList::iterator sourceListEnd = crlSources.end();
00531 for(sourceListPos = crlSources.begin(); sourceListPos != sourceListEnd; ++sourceListPos)
00532 {
00533 bool bAddToSynStore = false;
00534 CPKIFCRLNodeList tempNodeList;
00535
00536 m_impl->GetCrls(cert, *sourceListPos, tempNodeList);
00537
00538 if(tempNodeList.empty() && PAS_PENDING == (*sourceListPos)->GetState() && LOCAL != source)
00539 {
00540
00541 (*sourceListPos)->GetCrls(tempNodeList);
00542 bAddToSynStore = true;
00543 }
00544
00545 if(!tempNodeList.empty())
00546 {
00547
00548 (*sourceListPos)->SetState(PAS_AVAILABLE);
00549
00550
00551 GottaMatch<CPKIFCRLNodeEntryPtr> gm;
00552 CPKIFCRLNodeList::iterator crlNodePos;
00553 CPKIFCRLNodeList::iterator crlNodeEnd = tempNodeList.end();
00554 for(crlNodePos = tempNodeList.begin(); crlNodePos != crlNodeEnd; ++crlNodePos)
00555 {
00556 gm.SetRHS(*crlNodePos);
00557 if(crlNodeList.end() == find_if(crlNodeList.begin(), crlNodeList.end(), gm))
00558 {
00559 crlNodeList.push_back(*crlNodePos);
00560 }
00561 }
00562
00563
00564 if(bAddToSynStore)
00565 m_impl->AddCrls(tempNodeList);
00566 }
00567 else if(LOCAL != source)
00568 {
00569
00570 CPKIFCRLNodeEntryPtr newNode(new CPKIFCRLNodeEntry);
00571 newNode->SetState(PAS_UNAVAILABLE);
00572 vector<string> unavailableSources;
00573 (*sourceListPos)->GetSources(unavailableSources);
00574 vector<string>::iterator uapos;
00575 vector<string>::iterator uaend = unavailableSources.end();
00576 for(uapos = unavailableSources.begin(); uapos != uaend; ++uapos)
00577 newNode->AddSource(*uapos);
00578
00579 tempNodeList.push_back(newNode);
00580 m_impl->AddCrls(tempNodeList);
00581 }
00582 }
00583
00584
00585 pos = m_impl->m_vNoCRLSynSourceSupport.begin();
00586 end = m_impl->m_vNoCRLSynSourceSupport.end();
00587 }
00588 else
00589 {
00590
00591 pos = m_impl->m_vCRLRepModules.begin();
00592 end = m_impl->m_vCRLRepModules.end();
00593 }
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 IPKIFCRLRepository* crlRep = NULL;
00649 for(; pos != end; ++pos)
00650 {
00651 try
00652 {
00653 opAttempted = true;
00654 (*pos)->GetCRLs(cert, crlNodeList, source, ps);
00655 opSucceeded = true;
00656 }
00657 catch(CPKIFException& e)
00658 {
00659
00660
00661
00662 std::string reason = "A cache-related exception was thrown. ";
00663 reason.append(*e.print());
00664 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
00665 }
00666 }
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701 }
00702
00718 void CPKIFCacheMediator2::GetCRLs(
00720 const CPKIFCertificatePtr& cert,
00722 CPKIFCRLList& crlList,
00724 PKIInfoSource source)
00725 {
00726 CPKIFPathSettingsPtr ps;
00727 GetCRLs(cert, crlList, source, ps);
00728 }
00729 void CPKIFCacheMediator2::GetCRLs(const CPKIFCertificatePtr& cert, CPKIFCRLList& crlList, PKIInfoSource source, CPKIFPathSettingsPtr& ps)
00730 {
00731 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCRLs", TOOLKIT_SR_MEDIATOR, 0, this);
00732
00733
00734
00735
00736 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00737
00738 vector<IPKIFCRLRepositoryPtr>::iterator pos;
00739 vector<IPKIFCRLRepositoryPtr>::iterator end = m_impl->m_vCRLRepModules.end();
00740 IPKIFCRLRepository* crlRep = NULL;
00741 bool opAttempted = false, opSucceeded = false;
00742 for(pos = m_impl->m_vCRLRepModules.begin(); pos != end; ++pos)
00743 {
00744 try
00745 {
00746 opAttempted = true;
00747 (*pos)->GetCRLs(cert, crlList, source, ps);
00748 opSucceeded = true;
00749 }
00750 catch(CPKIFException& e)
00751 {
00752
00753
00754
00755 std::string reason = "A cache-related exception was thrown. ";
00756 reason.append(*e.print());
00757 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
00758
00759 }
00760 }
00761
00762 if(!opAttempted)
00763 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
00764
00765 if(!opSucceeded)
00766 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
00767 }
00768
00794 void CPKIFCacheMediator2::GetCertificates(
00797 const CPKIFNamePtr& subDN,
00800 CPKIFCertificateList& certList,
00802 PKIInfoSource source)
00803 {
00804 CPKIFPathSettingsPtr ps;
00805 GetCertificates(subDN, certList, source, ps);
00806 }
00832 void CPKIFCacheMediator2::GetCertificates(
00835 const CPKIFNamePtr& subDN,
00838 CPKIFCertificateList& certList,
00840 PKIInfoSource source,
00842 CPKIFPathSettingsPtr& ps)
00843 {
00844 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCertificates", TOOLKIT_SR_MEDIATOR, 0, this);
00845
00846
00847
00848
00849
00850 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00851
00852 vector<IPKIFCertRepositoryPtr>::iterator pos;
00853 vector<IPKIFCertRepositoryPtr>::iterator end = m_impl->m_vCertRepModules.end();
00854 IPKIFCertRepository* certRep = NULL;
00855 bool opAttempted = false, opSucceeded = false;
00856 for(pos = m_impl->m_vCertRepModules.begin(); pos != end; ++pos)
00857 {
00858
00859 try
00860 {
00861 opAttempted = true;
00862 (*pos)->GetCertificates(subDN, certList, source, ps);
00863 opSucceeded = true;
00864 }
00865 catch(CPKIFException& e)
00866 {
00867 std::string reason = "A cache-related exception was thrown. ";
00868 reason.append(*e.print());
00869 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
00870
00871 }
00872
00873 }
00874
00875 if(!opAttempted)
00876 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
00877
00878 if(!opSucceeded)
00879 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
00880 }
00881
00907 void CPKIFCacheMediator2::GetCertificates(
00910 const CPKIFNamePtr& subDN,
00913 CPKIFCertificateNodeList& certList,
00915 PKIInfoSource source)
00916 {
00917 CPKIFPathSettingsPtr ps;
00918 GetCertificates(subDN, certList, source, ps);
00919 }
00945 void CPKIFCacheMediator2::GetCertificates(
00948 const CPKIFNamePtr& subDN,
00951 CPKIFCertificateNodeList& certList,
00953 PKIInfoSource source,
00955 CPKIFPathSettingsPtr& ps)
00956 {
00957 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCertificates", TOOLKIT_SR_MEDIATOR, 0, this);
00958
00959
00960
00961
00962
00963 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
00964
00965 vector<IPKIFCertRepositoryPtr>::iterator pos;
00966 vector<IPKIFCertRepositoryPtr>::iterator end = m_impl->m_vCertRepModules.end();
00967 IPKIFCertRepository* certRep = NULL;
00968 bool opAttempted = false, opSucceeded = false;
00969 for(pos = m_impl->m_vCertRepModules.begin(); pos != end; ++pos)
00970 {
00971 try
00972 {
00973 opAttempted = true;
00974 (*pos)->GetCertificates(subDN, certList, source, ps);
00975 opSucceeded = true;
00976 }
00977 catch(CPKIFException& e)
00978 {
00979
00980
00981
00982 std::string reason = "A cache-related exception was thrown. ";
00983 reason.append(*e.print());
00984 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
00985
00986 }
00987
00988 }
00989
00990 if(!opAttempted)
00991 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
00992
00993 if(!opSucceeded)
00994 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
00995 }
01013 void CPKIFCacheMediator2::GetCertificates(
01015 const CPKIFCertificatePtr& cert,
01017 CPKIFCertificateList& certList,
01019 PKIInfoSource source,
01021 PathBuildingDirection pbd)
01022 {
01023 CPKIFPathSettingsPtr ps;
01024 GetCertificates(cert, certList, source, pbd, ps);
01025 }
01043 void CPKIFCacheMediator2::GetCertificates(
01045 const CPKIFCertificatePtr& cert,
01047 CPKIFCertificateList& certList,
01049 PKIInfoSource source,
01051 PathBuildingDirection pbd,
01053 CPKIFPathSettingsPtr& ps)
01054 {
01055 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCertificates", TOOLKIT_SR_MEDIATOR, 0, this);
01056
01057
01058
01059
01060
01061 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01062
01063 vector<IPKIFCertRepositoryPtr>::iterator pos;
01064 vector<IPKIFCertRepositoryPtr>::iterator end = m_impl->m_vCertRepModules.end();
01065 IPKIFCertRepository* certRep = NULL;
01066 bool opAttempted = false, opSucceeded = false;
01067 for(pos = m_impl->m_vCertRepModules.begin(); pos != end; ++pos)
01068 {
01069 try
01070 {
01071 opAttempted = true;
01072 (*pos)->GetCertificates(cert, certList, source, pbd, ps);
01073 opSucceeded = true;
01074 }
01075 catch(CPKIFException& e)
01076 {
01077
01078
01079
01080 std::string reason = "A cache-related exception was thrown. ";
01081 reason.append(*e.print());
01082 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01083
01084 }
01085 }
01086
01087 if(!opAttempted)
01088 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01089
01090 if(!opSucceeded)
01091 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01092 }
01110 void CPKIFCacheMediator2::GetCertificates(
01112 const CPKIFCertificatePtr& cert,
01114 CPKIFCertificateNodeList& certNodeList,
01116 PKIInfoSource source,
01118 PathBuildingDirection pbd)
01119 {
01120 CPKIFPathSettingsPtr ps;
01121 GetCertificates(cert, certNodeList, source, pbd, ps);
01122 }
01140 void CPKIFCacheMediator2::GetCertificates(
01142 const CPKIFCertificatePtr& cert,
01144 CPKIFCertificateNodeList& certNodeList,
01146 PKIInfoSource source,
01148 PathBuildingDirection pbd,
01150 CPKIFPathSettingsPtr& ps)
01151 {
01152 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCertificates", TOOLKIT_SR_MEDIATOR, 0, this);
01153
01154
01155
01156
01157
01158 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01159
01160 vector<IPKIFCertRepositoryPtr>::iterator pos;
01161 vector<IPKIFCertRepositoryPtr>::iterator end;
01162
01163 bool opAttempted = false, opSucceeded = false;
01164
01165 if(!m_impl->m_vSynonymousStore.empty() || !m_impl->m_vSynonymousCertSources.empty())
01166 {
01167
01168 opAttempted = true;
01169 opSucceeded = true;
01170
01171 CPKIFCertificateSourceList certSources;
01172
01173
01174 std::vector<IPKIFSupportsSynonymousCertSourcesPtr>::iterator sourcePos;
01175 std::vector<IPKIFSupportsSynonymousCertSourcesPtr>::iterator sourceEnd = m_impl->m_vSynonymousCertSources.end();
01176 for(sourcePos = m_impl->m_vSynonymousCertSources.begin(); sourcePos != sourceEnd; ++sourcePos)
01177 {
01178 (*sourcePos)->GetCertificateSources(cert, certSources, pbd);
01179 }
01180
01181
01182
01183 CPKIFCertificateSourceList::iterator sourceListPos;
01184 CPKIFCertificateSourceList::iterator sourceListEnd = certSources.end();
01185 for(sourceListPos = certSources.begin(); sourceListPos != sourceListEnd; ++sourceListPos)
01186 {
01187 bool bAddToSynStore = false;
01188 CPKIFCertificateNodeList tempNodeList;
01189
01190
01191 m_impl->GetCerts(*sourceListPos, tempNodeList);
01192
01193 if(tempNodeList.empty() && PAS_PENDING == (*sourceListPos)->GetState() && LOCAL != source)
01194 {
01195
01196 (*sourceListPos)->GetCertificates(tempNodeList, pbd);
01197 bAddToSynStore = true;
01198 }
01199
01200 if(!tempNodeList.empty())
01201 {
01202
01203 (*sourceListPos)->SetState(PAS_AVAILABLE);
01204
01205
01206 GottaMatch<CPKIFCertificateNodeEntryPtr> gm;
01207 CPKIFCertificateNodeList::iterator certNodePos;
01208 CPKIFCertificateNodeList::iterator certNodeEnd = tempNodeList.end();
01209 for(certNodePos = tempNodeList.begin(); certNodePos != certNodeEnd; ++certNodePos)
01210 {
01211 gm.SetRHS(*certNodePos);
01212 if(certNodeList.end() == find_if(certNodeList.begin(), certNodeList.end(), gm))
01213 {
01214 certNodeList.push_back(*certNodePos);
01215 }
01216 }
01217
01218
01219 if(bAddToSynStore)
01220 m_impl->AddCerts(tempNodeList);
01221 }
01222 else if(LOCAL != source)
01223 {
01224
01225 CPKIFCertificateNodeEntryPtr newNode(new CPKIFCertificateNodeEntry);
01226 newNode->SetState(PAS_UNAVAILABLE);
01227 vector<string> unavailableSources;
01228 (*sourceListPos)->GetSources(unavailableSources);
01229 vector<string>::iterator uapos;
01230 vector<string>::iterator uaend = unavailableSources.end();
01231 for(uapos = unavailableSources.begin(); uapos != uaend; ++uapos)
01232 newNode->AddSource(*uapos);
01233
01234 tempNodeList.push_back(newNode);
01235 m_impl->AddCerts(tempNodeList);
01236 }
01237 }
01238
01239
01240 pos = m_impl->m_vNoCertSynSourceSupport.begin();
01241 end = m_impl->m_vNoCertSynSourceSupport.end();
01242 }
01243 else
01244 {
01245
01246 pos = m_impl->m_vCertRepModules.begin();
01247 end = m_impl->m_vCertRepModules.end();
01248 }
01249
01250 IPKIFCertRepository* certRep = NULL;
01251 for(; pos != end; ++pos)
01252 {
01253 try
01254 {
01255 opAttempted = true;
01256 (*pos)->GetCertificates(cert, certNodeList, source, pbd, ps);
01257 opSucceeded = true;
01258 }
01259 catch(CPKIFException& e)
01260 {
01261
01262
01263
01264 std::string reason = "A cache-related exception was thrown. ";
01265 reason.append(*e.print());
01266 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01267
01268 }
01269 }
01270
01271 if(!opAttempted)
01272 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01273
01274 if(!opSucceeded)
01275 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01276 }
01277
01293 bool CPKIFCacheMediator2::GetTrustRoots(
01295 const CPKIFNamePtr& subDN,
01297 IPKIFTrustAnchorList& rootList)
01298 {
01299 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetTrustRoots", TOOLKIT_SR_MEDIATOR, 0, this);
01300
01301
01302
01303
01304
01305 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01306
01307 vector<IPKIFTrustCachePtr>::iterator pos;
01308 vector<IPKIFTrustCachePtr>::iterator end = m_impl->m_vTrustCacheModules.end();
01309 IPKIFTrustCache* trustCache = NULL;
01310 const size_t origSize = rootList.size();
01311 bool opAttempted = false, opSucceeded = false;
01312 for(pos = m_impl->m_vTrustCacheModules.begin(); pos != end; ++pos)
01313 {
01314
01315 try
01316 {
01317 opAttempted = true;
01318 (*pos)->GetTrustRoots(subDN, rootList);
01319 opSucceeded = true;
01320 }
01321 catch(CPKIFException& e)
01322 {
01323
01324
01325
01326 std::string reason = "A cache-related exception was thrown. ";
01327 reason.append(*e.print());
01328 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01329
01330 }
01331
01332 }
01333
01334 if(!opAttempted)
01335 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01336
01337 if(!opSucceeded)
01338 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01339
01340 return origSize != rootList.size();
01341 }
01342
01357 void CPKIFCacheMediator2::AddCRL(
01359 const CPKIFCRLPtr& crl,
01361 const CPKIFGeneralNamePtr& dp)
01362 {
01363 LOG_STRING_DEBUG("CPKIFCacheMediator2::AddCRL", TOOLKIT_SR_MEDIATOR, 0, this);
01364
01365
01366
01367
01368
01369
01370 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01371
01372 vector<IPKIFCRLRepositoryUpdatePtr>::iterator pos;
01373 vector<IPKIFCRLRepositoryUpdatePtr>::iterator end = m_impl->m_vCRLRepUptadeModules.end();
01374 IPKIFCRLRepositoryUpdate* crlRep = NULL;
01375 bool opAttempted = false, opSucceeded = false;
01376 for(pos = m_impl->m_vCRLRepUptadeModules.begin(); pos != end; ++pos)
01377 {
01378
01379 try
01380 {
01381 opAttempted = true;
01382 (*pos)->AddCRL(crl, dp);
01383 opSucceeded = true;
01384 }
01385 catch(CPKIFException& e)
01386 {
01387
01388
01389
01390 std::string reason = "A cache-related exception was thrown. ";
01391 reason.append(*e.print());
01392 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01393
01394 }
01395
01396 }
01397
01398
01399 if(!opAttempted)
01400 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01401
01402 if(!opSucceeded)
01403 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01404 }
01405
01421 void CPKIFCacheMediator2::AddCertificate(
01423 CertType certType,
01425 const CPKIFCertificatePtr& cert)
01426 {
01427 LOG_STRING_DEBUG("CPKIFCacheMediator2::AddCertificate(CertType certType, const CPKIFCertificatePtr& cert)", TOOLKIT_SR_MEDIATOR, 0, this);
01428
01429
01430
01431
01432
01433
01434 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01435
01436 vector<IPKIFCertRepositoryUpdatePtr>::iterator pos;
01437 vector<IPKIFCertRepositoryUpdatePtr>::iterator end = m_impl->m_vCertRepUpdateModules.end();
01438 IPKIFCertRepositoryUpdate* certRep = NULL;
01439 bool opAttempted = false, opSucceeded = false;
01440 for(pos = m_impl->m_vCertRepUpdateModules.begin(); pos != end; ++pos)
01441 {
01442 try
01443 {
01444 opAttempted = true;
01445 (*pos)->AddCertificate(certType, cert);
01446 opSucceeded = true;
01447 }
01448 catch(CPKIFException& e)
01449 {
01450
01451
01452
01453 std::string reason = "A cache-related exception was thrown. ";
01454 reason.append(*e.print());
01455 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01456
01457 }
01458
01459 }
01460
01461 if(!opAttempted)
01462 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01463
01464 if(!opSucceeded)
01465 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01466 }
01467
01483 void CPKIFCacheMediator2::AddCertificate(
01485 CertType certType,
01487 const CPKIFCertificateNodeEntryPtr& cert)
01488 {
01489 LOG_STRING_DEBUG("CPKIFCacheMediator2::AddCertificate(CertType certType, const CPKIFCertificateNodeEntryPtr& cert)", TOOLKIT_SR_MEDIATOR, 0, this);
01490
01491
01492
01493
01494
01495
01496 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01497
01498 vector<IPKIFCertRepositoryUpdatePtr>::iterator pos;
01499 vector<IPKIFCertRepositoryUpdatePtr>::iterator end = m_impl->m_vCertRepUpdateModules.end();
01500 IPKIFCertRepositoryUpdate* certRep = NULL;
01501 bool opAttempted = false, opSucceeded = false;
01502 for(pos = m_impl->m_vCertRepUpdateModules.begin(); pos != end; ++pos)
01503 {
01504
01505 try
01506 {
01507 opAttempted = true;
01508 (*pos)->AddCertificate(certType, cert);
01509 opSucceeded = true;
01510 }
01511 catch(CPKIFException& e)
01512 {
01513
01514
01515
01516 std::string reason = "A cache-related exception was thrown. ";
01517 reason.append(*e.print());
01518 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01519
01520 }
01521
01522 }
01523
01524 if(!opAttempted)
01525 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01526
01527 if(!opSucceeded)
01528 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01529 }
01530
01531 void CPKIFCacheMediator2::FindKeys(IPKIFSearchCriteria* searchCriteria, IPKIFNameAndKeyList& keyList, PKIInfoSource source)
01532 {
01533 LOG_STRING_DEBUG("CPKIFCacheMediator2::FindKeys", TOOLKIT_SR_MEDIATOR, 0, this);
01534
01535
01536
01537
01538
01539 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01540
01541 vector<IPKIFCertSearchPtr>::iterator pos;
01542 vector<IPKIFCertSearchPtr>::iterator end = m_impl->m_vCertSearchModules.end();
01543 IPKIFCertSearch* certRep = NULL;
01544 bool opAttempted = false, opSucceeded = false;
01545 for(pos = m_impl->m_vCertSearchModules.begin(); pos != end; ++pos)
01546 {
01547 try
01548 {
01549 opAttempted = true;
01550 (*pos)->FindKeys(searchCriteria, keyList, source);
01551 opSucceeded = true;
01552 }
01553 catch(CPKIFException& e)
01554 {
01555
01556
01557
01558 std::string reason = "A cache-related exception was thrown. ";
01559 reason.append(*e.print());
01560 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01561
01562 }
01563 }
01564
01565 if(!opAttempted)
01566 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01567
01568 if(!opSucceeded)
01569 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01570 }
01571
01582 void CPKIFCacheMediator2::FindCertificates(
01584 IPKIFSearchCriteria* searchCriteria,
01586 CPKIFCertificateList& certList,
01588 PKIInfoSource source)
01589 {
01590 LOG_STRING_DEBUG("CPKIFCacheMediator2::FindCertificates", TOOLKIT_SR_MEDIATOR, 0, this);
01591
01592
01593
01594
01595
01596 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01597
01598 vector<IPKIFCertSearchPtr>::iterator pos;
01599 vector<IPKIFCertSearchPtr>::iterator end = m_impl->m_vCertSearchModules.end();
01600 IPKIFCertSearch* certRep = NULL;
01601 bool opAttempted = false, opSucceeded = false;
01602 for(pos = m_impl->m_vCertSearchModules.begin(); pos != end; ++pos)
01603 {
01604 try
01605 {
01606 opAttempted = true;
01607 (*pos)->FindCertificates(searchCriteria, certList, source);
01608 opSucceeded = true;
01609 }
01610 catch(CPKIFException& e)
01611 {
01612
01613
01614
01615 std::string reason = "A cache-related exception was thrown. ";
01616 reason.append(*e.print());
01617 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01618
01619 }
01620
01621 }
01622
01623 if(!opAttempted)
01624 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01625
01626 if(!opSucceeded)
01627 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01628 }
01636 void CPKIFCacheMediator2::GetColleagues(
01638 std::vector<IPKIFColleaguePtr>& v) const
01639 {
01640 copy(m_impl->m_vModules.begin(),m_impl->m_vModules.end(), back_inserter(v));
01641 }
01650 void CPKIFCacheMediator2::GetCertificateSources(
01652 const CPKIFCertificatePtr& cert,
01654 CPKIFCertificateSourceList& certs,
01656 PathBuildingDirection pbd)
01657 {
01658 LOG_STRING_DEBUG("CPKIFCacheMediator2::GetCertificateSources", TOOLKIT_SR_MEDIATOR, 0, this);
01659
01660
01661
01662
01663
01664 boost::recursive_mutex::scoped_lock lock(m_impl->m_me);
01665
01666 vector<IPKIFSupportsSynonymousCertSourcesPtr>::iterator pos;
01667 vector<IPKIFSupportsSynonymousCertSourcesPtr>::iterator end = m_impl->m_vSynonymousCertSources.end();
01668 IPKIFCertSearch* certRep = NULL;
01669 bool opAttempted = false, opSucceeded = false;
01670 for(pos = m_impl->m_vSynonymousCertSources.begin(); pos != end; ++pos)
01671 {
01672 try
01673 {
01674 opAttempted = true;
01675 (*pos)->GetCertificateSources(cert, certs, pbd);
01676 opSucceeded = true;
01677 }
01678 catch(CPKIFException& e)
01679 {
01680
01681
01682
01683 std::string reason = "A cache-related exception was thrown. ";
01684 reason.append(*e.print());
01685 AuditString(EVENTLOG_WARNING_TYPE, CAT_PKIF_CACHE, PKIF_UNEXPECTED_EXCEPTION, reason.c_str(), thisComponent, COMMON_UNKNOWN_ERROR, this);
01686
01687 }
01688 }
01689
01690 if(!opAttempted)
01691 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_HANDLED);
01692
01693 if(!opSucceeded)
01694 throw CPKIFCacheException(thisComponent, COMMON_OPERATION_NOT_SUCCESSFUL);
01695 }