[java-identity-provider COMMIT] in /trunk: idp-attribute-api/pom.xml idp-attribute-api/src/main/java/net/shibboleth/i...

noreply at shibboleth.net noreply at shibboleth.net
Tue May 6 12:01:24 EDT 2014


Author: scantor
Date: Tue May  6 12:01:23 2014
New Revision: 5852

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5852&view=rev
Log:
IDP-377: add an activation condition to AttributeEncoder interface

Modified:
    trunk/idp-attribute-api/pom.xml
    trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/AttributeEncoder.java
    trunk/idp-attribute-api/src/test/java/net/shibboleth/idp/attribute/MockEncoder.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/MockAttributeEncoder.java
    trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/encoding/AbstractSAML1NameIdentifierEncoder.java
    trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/encoding/AbstractSAML2NameIDEncoder.java
    trunk/idp-saml-api/src/main/java/net/shibboleth/idp/saml/attribute/encoding/AbstractSAMLAttributeEncoder.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML1StringNameIdentifierEncoder.java
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/encoding/impl/SAML2StringNameIDEncoder.java

Modified: trunk/idp-attribute-api/pom.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/pom.xml?rev=5852&r1=5851&r2=5852&view=diff
==============================================================================
--- trunk/idp-attribute-api/pom.xml (original)
+++ trunk/idp-attribute-api/pom.xml Tue May  6 12:01:23 2014
@@ -24,6 +24,12 @@
         </dependency>
 
         <dependency>
+            <groupId>${opensaml.groupId}</groupId>
+            <artifactId>opensaml-profile-api</artifactId>
+            <version>${opensaml.version}</version>
+        </dependency>
+
+        <dependency>
           <groupId>commons-codec</groupId>
           <artifactId>commons-codec</artifactId>
         </dependency>

Modified: trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/AttributeEncoder.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/AttributeEncoder.java?rev=5852&r1=5851&r2=5852&view=diff
==============================================================================
--- trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/AttributeEncoder.java (original)
+++ trunk/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/AttributeEncoder.java Tue May  6 12:01:23 2014
@@ -20,16 +20,21 @@
 import javax.annotation.Nonnull;
 import javax.annotation.concurrent.ThreadSafe;
 
+import org.opensaml.profile.context.ProfileRequestContext;
+
+import com.google.common.base.Predicate;
+
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 
 /**
- * Attribute encoders convert {@link IdPAttribute}s into protocol specific representations. Implementations must take in
- * to account that an {@link IdPAttribute} may contain values of multiple types. An encoder implementation encountering
+ * Attribute encoders convert an {@link IdPAttribute} into a protocol specific representation. Implementations must take
+ * into account that an {@link IdPAttribute} may contain values of multiple types. An implementation encountering
  * a value type it does not understand may either decide to ignore it or throw an {@link AttributeEncodingException}.
- * <p>
- * Encoders <strong>MUST</strong> be thread-safe and stateless and <strong>MUST</strong> implement appropriate
- * {@link Object#equals(Object)} and {@link Object#hashCode()} methods.
- * </p>
+ * 
+ * <p>Encoders implement a {@link Predicate} interface to determine their applicability to a request.</p>
+ * 
+ * <p>Encoders <strong>MUST</strong> be thread-safe and stateless and <strong>MUST</strong> implement appropriate
+ * {@link Object#equals(Object)} and {@link Object#hashCode()} methods.</p>
  * 
  * @param <EncodedType> the type of object created by encoding the attribute
  */
@@ -37,16 +42,23 @@
 public interface AttributeEncoder<EncodedType> {
 
     /**
-     * Gets the identifier of the protocol targeted by this encoder. Note, some protocols may have different types of
+     * Get the identifier of the protocol targeted by this encoder. Note, some protocols may have different types of
      * encoders that are used to encode attributes in to different parts of the protocol message. This identifier should
      * not be used to distinguish between the different message structure, it should only identify the protocol itself.
      * 
      * @return identifier of the protocol targeted by this encounter
      */
-    @Nonnull @NotEmpty public String getProtocol();
+    @Nonnull @NotEmpty String getProtocol();
+    
+    /**
+     * Get an activation condition for this encoder.
+     * 
+     * @return  a predicate indicating whether the encoder should be applied
+     */
+    @Nonnull Predicate<ProfileRequestContext> getActivationCondition();
 
     /**
-     * Encodes the attribute into a protocol specific representations.
+     * Encode the supplied attribute into a protocol specific representation.

[... 340 lines stripped ...]


More information about the commits mailing list