[java-opensaml2 COMMIT] in /branches/REL_2: doc/RELEASE-NOTES.txt src/main/java/org/opensaml/saml2/metadata/provider/...

noreply at shibboleth.net noreply at shibboleth.net
Fri Mar 22 15:14:48 EDT 2013


Author: putmanb
Date: Fri Mar 22 15:14:48 2013
New Revision: 1636

URL: http://svn.shibboleth.net/view/java-opensaml2?rev=1636&view=rev
Log:
JOST-208: FileBackedHTTPMetadataProvider constructor doesn't behave correctly vis-a-vis fail-fast setting if the backing file path has problems 

Modified:
    branches/REL_2/doc/RELEASE-NOTES.txt
    branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java
    branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProvider.java
    branches/REL_2/src/test/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProviderTest.java

Modified: branches/REL_2/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/doc/RELEASE-NOTES.txt?rev=1636&r1=1635&r2=1636&view=diff
==============================================================================
--- branches/REL_2/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_2/doc/RELEASE-NOTES.txt Fri Mar 22 15:14:48 2013
@@ -20,6 +20,7 @@
 [JOST-203] - Head/body template injection for SAML binding templates
 [JOST-205] - MetadataProvider doesn't report error during refresh if the metadata file doesn't exist any more
 [JOST-206] - Setting failFastInitialization=false has no effect
+[JOST-208] - FileBackedHTTPMetadataProvider constructor doesn't behave correctly vis-a-vis fail-fast setting if the backing file path has problems 
 
 Changes in Release 2.5.3
 =============================================

Modified: branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java?rev=1636&r1=1635&r2=1636&view=diff
==============================================================================
--- branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java (original)
+++ branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java Fri Mar 22 15:14:48 2013
@@ -408,10 +408,11 @@
             initialized = true;
         } catch (MetadataProviderException e) {
             if (failFastInitialization) {
-                log.error("Metadata provider failed to properly initializing, halting", e);
+                log.error("Metadata provider failed to properly initialize, fail-fast=true, halting", e);
                 throw e;
             } else {
-                log.error("Metadata provider failed to properly initializing, continuing on without metadata", e);
+                log.error("Metadata provider failed to properly initialize, fail-fast=false, " 
+                        + "continuing on in a degraded state", e);
                 initialized = true;
             }
         }

Modified: branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProvider.java
URL: http://svn.shibboleth.net/view/java-opensaml2/branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProvider.java?rev=1636&r1=1635&r2=1636&view=diff
==============================================================================
--- branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProvider.java (original)
+++ branches/REL_2/src/main/java/org/opensaml/saml2/metadata/provider/FileBackedHTTPMetadataProvider.java Fri Mar 22 15:14:48 2013
@@ -53,7 +53,7 @@
      * @param backupFilePath the file that will keep a backup copy of the metadata,
      * 
      * @throws MetadataProviderException thrown if the URL is not a valid URL, the metadata can not be retrieved from
-     *             the URL, the given file can not be created or written to
+     *             the URL
      */
     @Deprecated
     public FileBackedHTTPMetadataProvider(String metadataURL, int requestTimeout, String backupFilePath)
@@ -71,7 +71,7 @@
      * @param backupFilePath the file that will keep a backup copy of the metadata,
      * 
      * @throws MetadataProviderException thrown if the URL is not a valid URL, the metadata can not be retrieved from
-     *             the URL, the given file can not be created or written to
+     *             the URL
      */
     public FileBackedHTTPMetadataProvider(Timer backgroundTaskTimer, HttpClient client, String metadataURL,
             String backupFilePath) throws MetadataProviderException {
@@ -86,6 +86,22 @@
         super.destroy();
     }
 
+    /** {@inheritDoc} */
+    protected void doInitialization() throws MetadataProviderException {
+        try {
+            validateBackupFile(metadataBackupFile);
+        } catch (MetadataProviderException e) {
+            if (isFailFastInitialization()) {
+                log.error("Metadata backup file path was invalid, initialization is fatal");
+                throw e;
+            } else {
+                log.error("Metadata backup file path was invalid, continuing without known good backup file");
+            }
+        }
+        
+        super.doInitialization();

[... 241 lines stripped ...]


More information about the commits mailing list