[java-identity-provider COMMIT] in /trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli: OutputAtt...

noreply at shibboleth.net noreply at shibboleth.net
Thu Dec 5 11:25:38 EST 2013


Author: scantor
Date: Thu Dec  5 11:25:38 2013
New Revision: 4986

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4986&view=rev
Log:
Bit of cleanup.

Modified:
    trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/OutputAttributes.java
    trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/StaticResolver.java

Modified: trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/OutputAttributes.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/OutputAttributes.java?rev=4986&r1=4985&r2=4986&view=diff
==============================================================================
--- trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/OutputAttributes.java (original)
+++ trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/OutputAttributes.java Thu Dec  5 11:25:38 2013
@@ -23,8 +23,6 @@
 
 import javax.annotation.Nonnull;
 
-import net.shibboleth.ext.spring.webflow.Event;
-import net.shibboleth.ext.spring.webflow.Events;
 import net.shibboleth.idp.attribute.AttributeContext;
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
@@ -36,34 +34,30 @@
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.webflow.execution.Event;
 import org.springframework.webflow.execution.RequestContext;
 
 
 /**
  * A Spring-aware action to write the attribute context information to the external output sink.
  * This is for use in command line scenarios where there is no servlet environment for output.
+ * 
+ * @event {@link org.opensaml.profile.action.EventIds.PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_ATTRIBUTE_CTX}
  */
- at Events({
-    @Event(id = org.opensaml.profile.action.EventIds.PROCEED_EVENT_ID),
-    @Event(id = EventIds.INVALID_ATTRIBUTE_CTX, description = "No attributes were available for filtering"),
-    })
 public final class OutputAttributes extends AbstractProfileAction {
 
     /** Class logger. */
-    private final Logger log = LoggerFactory.getLogger(OutputAttributes.class);
-    
-    /** Constructor. */
-    public OutputAttributes() {
-        super();
-    }
+    @Nonnull private final Logger log = LoggerFactory.getLogger(OutputAttributes.class);
 
     /** {@inheritDoc} */
-    protected org.springframework.webflow.execution.Event doExecute(@Nonnull final RequestContext springRequestContext,
+    @Override
+    protected Event doExecute(@Nonnull final RequestContext springRequestContext,
             @Nonnull final ProfileRequestContext profileRequestContext) throws ProfileException {
         
         AttributeContext attributeContext = profileRequestContext.getSubcontext(AttributeContext.class, false);
         if (attributeContext == null) {
-            log.debug("Action {}: No attribute context, no attributes to filter", getId());
+            log.debug("{} No attribute context, no attributes to filter", getLogPrefix());
             return ActionSupport.buildEvent(this, EventIds.INVALID_ATTRIBUTE_CTX);
         }
         
@@ -85,7 +79,8 @@
                 }
             }
         } catch (IOException e) {
-            throw new ProfileException("I/O error writing attributes to output context", e);
+            log.error(getLogPrefix() + " I/O error writing attributes to output context", e);
+            return ActionSupport.buildEvent(this, org.opensaml.profile.action.EventIds.IO_ERROR);
         }
         
         return ActionSupport.buildProceedEvent(this);

Modified: trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/StaticResolver.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/StaticResolver.java?rev=4986&r1=4985&r2=4986&view=diff
==============================================================================
--- trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/StaticResolver.java (original)
+++ trunk/idp-attribute-cli/src/main/java/net/shibboleth/idp/attribute/cli/StaticResolver.java Thu Dec  5 11:25:38 2013
@@ -21,11 +21,8 @@
 
 import org.opensaml.profile.ProfileException;
 import org.opensaml.profile.action.AbstractProfileAction;
-import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
 
-import net.shibboleth.ext.spring.webflow.Event;
-import net.shibboleth.ext.spring.webflow.Events;
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.AttributeContext;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
@@ -36,18 +33,13 @@
 /**
  * A dummy action to generate some data conformant to the current attribute
  * resolver action.
+ * 
+ * @event {@link org.opensaml.profile.action.EventIds#PROCEED_EVENT_ID}
  */
- at Events({
-    @Event(id = EventIds.PROCEED_EVENT_ID)
-    })
 public final class StaticResolver extends AbstractProfileAction {
 

[... 11 lines stripped ...]


More information about the commits mailing list