[java-identity-provider COMMIT] in /trunk: idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/r...
noreply at shibboleth.net
noreply at shibboleth.net
Sun Oct 11 17:14:49 EDT 2015
Author: scantor
Date: Sun Oct 11 17:14:49 2015
New Revision: 7809
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7809&view=rev
Log:
IDP-829 - Update decoder classes to account for new interface.
Modified:
trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java
trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoder.java
trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdGenerationStrategy.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoderTest.java
Modified: trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java?rev=7809&r1=7808&r2=7809&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java (original)
+++ trunk/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/pc/impl/StoredIdConnectorParser.java Sun Oct 11 17:14:49 2015
@@ -73,7 +73,7 @@
* @param connector the data connector of interest
*/
public EmbeddedStoredPersistentIdDecoder(StoredIDDataConnector connector) {
- setPersistentIdStore(connector.getStoredIDStore());
+ setPersistentIdStoreEx(connector.getStoredIDStore());
}
}
Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoder.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoder.java?rev=7809&r1=7808&r2=7809&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoder.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/StoredPersistentIdDecoder.java Sun Oct 11 17:14:49 2015
@@ -20,6 +20,8 @@
import java.io.IOException;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import javax.sql.DataSource;
import org.opensaml.saml.saml2.core.NameID;
import org.slf4j.Logger;
@@ -41,40 +43,94 @@
* An abstract action which contains the logic to decode SAML persistent IDs that are managed with a store.
* This reverses the work done by {@link StoredPersistentIdGenerationStrategy}.
*/
+ at SuppressWarnings("deprecation")
public class StoredPersistentIdDecoder extends AbstractIdentifiableInitializableComponent implements NameIDDecoder {
/** Class logger. */
@Nonnull private final Logger log = LoggerFactory.getLogger(StoredPersistentIdDecoder.class);
-
- /** Data store for IDs. */
- @NonnullAfterInit private PersistentIdStore idStore;
+
+ /** Updated version of persistent identifier data store layer. */
+ @NonnullAfterInit private PersistentIdStoreEx idStore;
+
+ /** A DataSource to auto-provision a {@link JDBCPersistentIdStoreEx} instance. */
+ @Nullable private DataSource dataSource;
+
+ /** Deprecated version of persistent identifier data store. */
+ @Nullable private PersistentIdStore deprecatedStore;
/**
* Get the data store.
*
* @return the data store
+ * @deprecated
*/
@NonnullAfterInit public PersistentIdStore getPersistentIdStore() {
- return idStore;
+ return deprecatedStore;
}
/**
- * Set the data store.
+ * Set a deprecated data store to use.
*
* @param store the data store
+ * @deprecated
*/
public void setPersistentIdStore(@Nonnull final PersistentIdStore store) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+ deprecatedStore = Constraint.isNotNull(store, "PersistentIdStore cannot be null");
+ }
+
+ /**
+ * Set a {@link PersistentIdStoreEx} used to retrieve the IDs.
+ *
+ * @param store the data store
+ */
+ public void setPersistentIdStoreEx(@Nonnull final PersistentIdStoreEx store) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
idStore = Constraint.isNotNull(store, "PersistentIdStore cannot be null");
}
-
+
+
+
/** {@inheritDoc} */
@Override protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
if (null == idStore) {
- throw new ComponentInitializationException("PersistentIdStore cannot be null");
+ if (deprecatedStore != null) {
+ if (deprecatedStore instanceof JDBCPersistentIdStore) {
[... 107 lines stripped ...]
More information about the commits
mailing list