[java-identity-provider COMMIT] in /trunk/idp-attribute-resolver-impl/src: main/java/net/shibboleth/idp/attribute/res...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Jun 12 23:22:32 EDT 2013
Author: scantor
Date: Wed Jun 12 23:22:31 2013
New Revision: 4531
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4531&view=rev
Log:
Rebasing transientId defn on storage API.
Modified:
trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinition.java
trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdEntry.java
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/TestIdStore.java
trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinitionTest.java
Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinition.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinition.java?rev=4531&r1=4530&r2=4531&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinition.java (original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/ad/TransientIdAttributeDefinition.java Wed Jun 12 23:22:31 2013
@@ -17,6 +17,7 @@
package net.shibboleth.idp.attribute.resolver.impl.ad;
+import java.io.IOException;
import java.util.Collections;
import java.util.Set;
@@ -30,35 +31,47 @@
import net.shibboleth.idp.attribute.resolver.AttributeResolutionContext;
import net.shibboleth.idp.attribute.resolver.ResolutionException;
import net.shibboleth.idp.attribute.resolver.BaseAttributeDefinition;
-import net.shibboleth.idp.persistence.PersistenceManager;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
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 net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy;
import net.shibboleth.utilities.java.support.security.RandomIdentifierGenerationStrategy;
+import org.opensaml.util.storage.StorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An attribute definition that generates random identifiers useful for transient subject IDs.
*
- * Information about the created IDs are stored within a provided {@link PersistenceManager} in the form of
- * {@link TransientIdEntry}s. Each entry is mapped under two keys; the generated ID and a key derived from the tuple
- * (outbound message issuer, inbound message issuer, principal name).
+ * Information about the created IDs are stored within a provided {@link StorageService}.
+ * The identifier itself is the record key, and the value combines the principal name
+ * with the identifier of the recipient.
*/
public class TransientIdAttributeDefinition extends BaseAttributeDefinition {
+ /** Context label for storage of IDs. */
+ public static final String CONTEXT = "TransientId";
+
+ /** Delimiter for storage of ID-associated data. */
+ public static final String DELIMITER = "!";
+
+ /** Index into delimited field storage of relying party identifier. */
+ public static final int RELYING_PARTY_ID_INDEX = 0;
+
+ /** Index into delimited field storage of principal name. */
+ public static final int PRINCIPAL_NAME_INDEX = 1;
+
/** Class logger. */
private final Logger log = LoggerFactory.getLogger(TransientIdAttributeDefinition.class);
- /** Store used to map tokens to principals. */
- // TODO This needs to be changed when Persistence is finalized.
- private PersistenceManager<TransientIdEntry> idStore;
-
- /** Generator of random, hex-encoded, tokens. */
+ /** Store used to map identifiers to principals. */
+ private StorageService idStore;
+
+ /** Generator of random, hex-encoded, identifiers. */
private IdentifierGenerationStrategy idGenerator;
/** Size, in bytes, of the token. */
@@ -80,7 +93,7 @@
*
* @return the ID store we are using.
*/
- @Nullable @NonnullAfterInit public PersistenceManager<TransientIdEntry> getIdStore() {
+ @Nullable @NonnullAfterInit public StorageService getIdStore() {
return idStore;
}
@@ -89,9 +102,9 @@
*
* @param store the store to use.
*/
- public void setIdStore(PersistenceManager<TransientIdEntry> store) {
+ public void setIdStore(@Nonnull final StorageService store) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
[... 236 lines stripped ...]
More information about the commits
mailing list