X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fattribute%2Fresolver%2Fimpl%2FChainingAttributeExtractor.cpp;h=d10c9a14309f2720bb3bcd649fab17e667e95185;hb=0134a743f9c47b8e7ac74076cc708f11f90603f9;hp=523cdc37a4110c67a9b40c0f28a593b8884be62c;hpb=d77ccfa57ecd935d2d5b93c4d2f44d6c41612bc7;p=shibboleth%2Fsp.git diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp index 523cdc3..d10c9a1 100644 --- a/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp +++ b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 Internet2 + * Copyright 2001-2010 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,6 +64,13 @@ namespace shibsp { } } + void generateMetadata(SPSSODescriptor& role) const { + for (vector::const_iterator i=m_extractors.begin(); i!=m_extractors.end(); ++i) { + Locker locker(*i); + (*i)->generateMetadata(role); + } + } + private: vector m_extractors; }; @@ -88,17 +95,32 @@ void SHIBSP_API shibsp::registerAttributeExtractors() SPConfig::getConfig().AttributeExtractorManager.registerFactory(CHAINING_ATTRIBUTE_EXTRACTOR, ChainingExtractorFactory); } +AttributeExtractor::AttributeExtractor() +{ +} + +AttributeExtractor::~AttributeExtractor() +{ +} + +void AttributeExtractor::generateMetadata(SPSSODescriptor& role) const +{ +} + ChainingAttributeExtractor::ChainingAttributeExtractor(const DOMElement* e) { SPConfig& conf = SPConfig::getConfig(); // Load up the chain of handlers. - e = e ? XMLHelper::getFirstChildElement(e, _AttributeExtractor) : NULL; + e = XMLHelper::getFirstChildElement(e, _AttributeExtractor); while (e) { - auto_ptr_char type(e->getAttributeNS(NULL,_type)); - if (type.get() && *(type.get())) { + string t(XMLHelper::getAttrString(e, nullptr, _type)); + if (!t.empty()) { try { - m_extractors.push_back(conf.AttributeExtractorManager.newPlugin(type.get(),e)); + Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor.Chaining").info( + "building AttributeExtractor of type (%s)...", t.c_str() + ); + m_extractors.push_back(conf.AttributeExtractorManager.newPlugin(t.c_str(), e)); } catch (exception& ex) { Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor.Chaining").error(