<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Brent,</div><div><br></div><div>I've finished to configure and setup the call to the services and reload them successfully!!! :) </div><div><br></div><div>Next are the steps of the whole process:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>1) I have a servlet configured to received the information of the SP that is about to be added (e.g. EntityID, AttributeFilterPolicy, etc.)</div><div><br></div><div>2) I make a backup of the configuration files of Shibboleth (Mainly relying-party.xml and attribute-filter.xml) and put these files in two folders: <b>tmp/ </b>and <b>tmpConf/</b></div><div><br></div><div>3) I validate the XML (using the schemas from the classpath) of these files (from the <b>tmp/</b> folder) using DocumentBuilder and related classes</div><div><br></div><div>4) With the information of the SP from the first step, I create new XML node(s) and add them to the respective configuration files. In here I also create the xml information that will go into the Metadata file.</div><div><br></div><div>5) Validate the XMLs with the newly added nodes (all of this from memory)</div><div><br></div><div>6) Once the previous step is successful I write the XML into the configuration files located in the <b>tmp/</b> folder, overwriting the content of the files.</div><div><br></div><div>7) Copy the configuration files from the <b>tmp/</b> folder to the <b>conf/</b> folder, replacing the necessary files.</div><div><br></div><div>8) Using the HttpServletHelper I obtain the service beans from the ServletContext and reload the necessary services.</div><div><br></div><div>9) If something goes wrong, from the <b>tmpConf/</b> folder (step 2) I copy and replace all the original configuration files to the <b>conf/</b> folder and trigger the previous step (reload services) to leave everything as it was before step 1</div></blockquote><div><br></div><div><br></div><div>Do you think there's something missing, wrong or that needs to be improved? Any suggestion is very welcome. </div><div><br></div><div>Now, my next step is to add concurrency protection. I saw some lines (which I'll start study) in the class <b>SAMLMDRelyingPartyConfigurationManager</b> that I believe are the ones Shibboleth uses:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Lock readLock = getReadWriteLock().readLock();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>readLock.lock();</div></div><div><br></div><div><br></div><div>Thank you very much for all your help and all the information.</div><div><br></div><div>Cheers!</div><div><br></div><div>-Mark</div><div><br></div><br><div><div>On Sep 24, 2012, at 6:15 PM, Brent Putman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 9/24/12 4:30 PM, Brent Putman wrote:<br><blockquote type="cite">You can obtain those service bean references via their Spring bean id's,<br></blockquote><blockquote type="cite">which are in turn exported to and so easily available from the<br></blockquote><blockquote type="cite">ServletContext (see the servlet context attribute exporter at the bottom<br></blockquote><blockquote type="cite">of service.xml). <br></blockquote><br><br>I forgot that we actually have a more well-defined and official API for<br>getting these service beans. See:<br><br>edu.internet2.middleware.shibboleth.idp.util.HttpServletHelper<br><br>methods getProfileHandlerManager, getRelyingPartyConfigurationManager,<br>getAttributeResolver, getAttributeFilterEngine.<br><br>These are probably better to use than accessing the servlet context<br>attributes directly, as the Spring bean id's (or how you use them) are<br>in theory subject to change, but the helper methods guarantee a stable<br>API to get at these services.<br><br>--Brent<br><br>--<br>To unsubscribe from this list send an email to <a href="mailto:dev-unsubscribe@shibboleth.net">dev-unsubscribe@shibboleth.net</a><br></div></blockquote></div><br></body></html>