[java-opensaml COMMIT] in /trunk: opensaml-messaging-impl/src/main/java/org/opensaml/messaging/context/ opensaml-mess...
noreply at shibboleth.net
noreply at shibboleth.net
Sun Apr 6 20:22:44 EDT 2014
Author: scantor
Date: Sun Apr 6 20:22:44 2014
New Revision: 3770
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3770&view=rev
Log:
Convert CheckMandatoryIssuer to message handler.
Added:
trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuer.java
- copied, changed from r3761, trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/CheckMandatoryIssuer.java
trunk/opensaml-messaging-impl/src/test/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuerTest.java
- copied, changed from r3761, trunk/opensaml-profile-impl/src/test/java/org/opensaml/profile/action/impl/CheckMandatoryIssuerTest.java
Modified:
trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/context/
trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/CheckMandatoryIssuer.java
trunk/opensaml-profile-impl/src/test/java/org/opensaml/profile/action/impl/CheckMandatoryIssuerTest.java
Copied: trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuer.java (from r3761, trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/CheckMandatoryIssuer.java)
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuer.java?p2=trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuer.java&p1=trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/CheckMandatoryIssuer.java&r1=3761&r2=3770&rev=3770&view=diff
==============================================================================
--- trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/CheckMandatoryIssuer.java (original)
+++ trunk/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/CheckMandatoryIssuer.java Sun Apr 6 20:22:44 2014
@@ -15,51 +15,31 @@
* limitations under the License.
*/
-package org.opensaml.profile.action.impl;
+package org.opensaml.messaging.handler.impl;
import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opensaml.profile.ProfileException;
-import org.opensaml.profile.action.AbstractProfileAction;
-import org.opensaml.profile.action.ActionSupport;
-import org.opensaml.profile.action.EventIds;
-import org.opensaml.profile.context.ProfileRequestContext;
-
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
-import org.opensaml.messaging.context.BasicMessageMetadataContext;
import org.opensaml.messaging.context.MessageContext;
-import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.messaging.handler.AbstractMessageHandler;
+import org.opensaml.messaging.handler.MessageHandlerException;
import com.google.common.base.Function;
/**
- * Action that checks that an incoming message has an issuer.
- *
- * @event {@link EventIds#PROCEED_EVENT_ID}
- * @event {@link EventIds#INVALID_MSG_MD}
+ * Message handler that checks that a message context has an issuer.
*/
-public final class CheckMandatoryIssuer extends AbstractProfileAction {
+public final class CheckMandatoryIssuer extends AbstractMessageHandler {
/**
- * Strategy used to look up the {@link BasicMessageMetadataContext} associated with the inbound message context.
+ * Strategy used to look up the issuer associated with the message context.
*/
- @Nonnull private Function<MessageContext, BasicMessageMetadataContext> messageMetadataContextLookupStrategy;
-
- /** The context to check. */
- @Nullable private BasicMessageMetadataContext msgContext;
+ @NonnullAfterInit private Function<MessageContext,String> issuerLookupStrategy;
- /**
- * Constructor.
- *
- * Initializes {@link #messageMetadataContextLookupStrategy} to {@link ChildContextLookup}.
- */
- public CheckMandatoryIssuer() {
- messageMetadataContextLookupStrategy = new ChildContextLookup<>(BasicMessageMetadataContext.class, false);
- }
-
/**
* Set the strategy used to look up the {@link BasicMessageMetadataContext} associated with the inbound message
* context.
@@ -67,28 +47,28 @@
* @param strategy strategy used to look up the {@link BasicMessageMetadataContext} associated with the inbound
* message context
*/
- public void setMessageMetadataContextLookupStrategy(
- @Nonnull final Function<MessageContext, BasicMessageMetadataContext> strategy) {
+ public void setIssuerLookupStrategy(@Nonnull final Function<MessageContext,String> strategy) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
- messageMetadataContextLookupStrategy = Constraint.isNotNull(strategy,
[... 112 lines stripped ...]
More information about the commits
mailing list