[java-identity-provider COMMIT] /trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp

noreply at shibboleth.net noreply at shibboleth.net
Mon Jul 6 09:19:48 EDT 2015


Author: rdw
Date: Mon Jul  6 09:19:47 2015
New Revision: 7621

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7621&view=rev
Log:
IDP-743 Add time of last DataConnector fail to status

The status page now iterates over the DataConnector associated with the
Attribute resolver and if they have ever failed prints out the
time of failure.  In case of no failure a message is printed but no date.

We cannot say whether the connector is currently working.

Modified:
    trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp

Modified: trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp?rev=7621&r1=7620&r2=7621&view=diff
==============================================================================
--- trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp	(original)
+++ trunk/idp-war/src/main/webapp/WEB-INF/jsp/status.jsp	Mon Jul  6 09:19:47 2015
@@ -12,6 +12,8 @@
 <%@ page import="org.opensaml.saml.metadata.resolver.RefreshableMetadataResolver" %>
 <%@ page import="net.shibboleth.idp.Version" %>
 <%@ page import="net.shibboleth.idp.saml.metadata.impl.RelyingPartyMetadataProvider" %>
+<%@ page import="net.shibboleth.idp.attribute.resolver.AttributeResolver" %>
+<%@ page import="net.shibboleth.idp.attribute.resolver.DataConnector" %>
 <%@ page import="net.shibboleth.utilities.java.support.component.IdentifiedComponent" %>
 <%@ page import="net.shibboleth.utilities.java.support.service.ReloadableService" %>
 <%@ page import="net.shibboleth.utilities.java.support.service.ServiceableComponent" %>
@@ -20,7 +22,7 @@
 final DateTimeFormatter dateTimeFormatter = ISODateTimeFormat.dateTimeNoMillis();
 final DateTime now = DateTime.now();
 final DateTime startupTime = new DateTime(requestContext.getActiveFlow().getApplicationContext().getStartupDate());
-%>### Operating Environment Information
+%>##YY# Operating Environment Information
 operating_system: <%= System.getProperty("os.name") %>
 operating_system_version: <%= System.getProperty("os.version") %>
 operating_system_architecture: <%= System.getProperty("os.arch") %>
@@ -92,8 +94,30 @@
         } finally {
             if (null != component) {
                 component.unpinComponent();
+            } 
+        }
+    } else if (((IdentifiedComponent) service).getId().contains("AttributeResolver")) {
+        final ServiceableComponent<AttributeResolver> component = service.getServiceableComponent();
+        try {
+            AttributeResolver resolver = component.getComponent();
+            final Collection<DataConnector> connectors = resolver.getDataConnectors().values();
+            
+            for (final DataConnector connector: connectors) {
+                final long lastFail = connector.getLastFail();
+                if (0 != lastFail) {
+                    DateTime failDateTime = new DateTime(lastFail);
+                    out.println("\tDataConnector " +  connector.getId() + ": last failed at " + failDateTime.toString(dateTimeFormatter));
+                } else {
+                    out.println("\tDataConnector " +  connector.getId() + ": has never failed");
+                }
+                out.println();
             }
+        } finally {
+            if (null != component) {
+                component.unpinComponent();
+            } 
         }
-    }
+    
+    }    
 }
 %>



More information about the commits mailing list