[java-opensaml] branch main updated: Collapse extended storage caps interface back into the original.

Scott Cantor cantor.2 at osu.edu
Mon Aug 8 14:46:48 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=d978627e333654d47a012a418b61aecdd743245f

The following commit(s) were added to refs/heads/main by this push:
     new d978627e3 Collapse extended storage caps interface back into the original.
d978627e3 is described below

commit d978627e333654d47a012a418b61aecdd743245f
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Aug 8 10:46:45 2022 -0400

    Collapse extended storage caps interface back into the original.
---
 .../org/opensaml/storage/StorageCapabilities.java  | 18 ++++++++++
 .../opensaml/storage/StorageCapabilitiesEx.java    | 39 ----------------------
 .../opensaml/storage/impl/LDAPStorageService.java  |  4 +--
 .../storage/impl/MemoryStorageService.java         |  4 +--
 .../storage/impl/StorageServiceReplayCache.java    |  6 +---
 .../impl/StorageServiceRevocationCache.java        |  6 +---
 .../storage/impl/client/ClientStorageService.java  |  4 +--
 .../memcached/MemcachedStorageCapabilities.java    |  4 +--
 8 files changed, 28 insertions(+), 57 deletions(-)

diff --git a/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilities.java b/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilities.java
index c0b2b3492..d80f50646 100644
--- a/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilities.java
+++ b/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilities.java
@@ -44,5 +44,23 @@ public interface StorageCapabilities {
      * @return  max size of values in characters
      */
     long getValueSize();
+    
+    /**
+     * Returns true iff the storage implementation manages data independent of the client.
+     * 
+     * @return  true iff the storage implementation manages data independent of the client
+     * 
+     * @since 5.0.0
+     */
+    boolean isServerSide();
+
+    /**
+     * Returns true iff the storage implementation manages data independent of a single server node.
+     * 
+     * @return true iff the storage implementation manages data independent of a single server node
+     * 
+     * @since 5.0.0
+     */
+    boolean isClustered();
 
 }
\ No newline at end of file
diff --git a/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilitiesEx.java b/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilitiesEx.java
deleted file mode 100644
index dae5b22ec..000000000
--- a/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageCapabilitiesEx.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opensaml.storage;
-
-/**
- * Exposes capabilities of a {@link StorageService} implementation.
- */
-public interface StorageCapabilitiesEx extends StorageCapabilities {
-    
-    /**
-     * Returns true iff the storage implementation manages data independent of the client.
-     * 
-     * @return  true iff the storage implementation manages data independent of the client
-     */
-    boolean isServerSide();
-
-    /**
-     * Returns true iff the storage implementation manages data independent of a single server node.
-     * 
-     * @return true iff the storage implementation manages data independent of a single server node
-     */
-    boolean isClustered();
-
-}
\ No newline at end of file
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
index 9854b67f4..c234adde0 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/LDAPStorageService.java
@@ -47,7 +47,7 @@ import org.ldaptive.ext.MergeOperation;
 import org.ldaptive.ext.MergeRequest;
 import org.ldaptive.pool.PooledConnectionFactory;
 import org.opensaml.storage.AbstractStorageService;
-import org.opensaml.storage.StorageCapabilitiesEx;
+import org.opensaml.storage.StorageCapabilities;
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.VersionMismatchException;
 import org.slf4j.Logger;
@@ -57,7 +57,7 @@ import org.slf4j.LoggerFactory;
  * Implementation of {@link org.opensaml.storage.StorageService} that stores data in an LDAP. Does not support
  * expiration or versioning at this time.
  */
-public class LDAPStorageService extends AbstractStorageService implements StorageCapabilitiesEx {
+public class LDAPStorageService extends AbstractStorageService implements StorageCapabilities {
 
     /** Class logger. */
     private final Logger log = LoggerFactory.getLogger(LDAPStorageService.class);
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/MemoryStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/MemoryStorageService.java
index 583d72beb..a15fb0782 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/MemoryStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/MemoryStorageService.java
@@ -36,7 +36,7 @@ import net.shibboleth.utilities.java.support.component.ComponentInitializationEx
 
 import org.opensaml.storage.AbstractMapBackedStorageService;
 import org.opensaml.storage.MutableStorageRecord;
-import org.opensaml.storage.StorageCapabilitiesEx;
+import org.opensaml.storage.StorageCapabilities;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
  * Implementation of {@link AbstractMapBackedStorageService} that stores data in-memory in a shared data structure 
  * with no persistence.
  */
-public class MemoryStorageService extends AbstractMapBackedStorageService implements StorageCapabilitiesEx {
+public class MemoryStorageService extends AbstractMapBackedStorageService implements StorageCapabilities {
 
     /** Class logger. */
     @Nonnull private final Logger log = LoggerFactory.getLogger(MemoryStorageService.class);
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceReplayCache.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceReplayCache.java
index 83def11c6..aba36eeac 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceReplayCache.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceReplayCache.java
@@ -25,7 +25,6 @@ import javax.annotation.Nonnull;
 
 import org.opensaml.storage.ReplayCache;
 import org.opensaml.storage.StorageCapabilities;
-import org.opensaml.storage.StorageCapabilitiesEx;
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.StorageService;
 import org.slf4j.Logger;
@@ -81,10 +80,7 @@ public class StorageServiceReplayCache extends AbstractIdentifiableInitializable
         checkSetterPreconditions();
         
         storage = Constraint.isNotNull(storageService, "StorageService cannot be null");
-        final StorageCapabilities caps = storage.getCapabilities();
-        if (caps instanceof StorageCapabilitiesEx) {
-            Constraint.isTrue(((StorageCapabilitiesEx) caps).isServerSide(), "StorageService cannot be client-side");
-        }
+        Constraint.isTrue(storage.getCapabilities().isServerSide(), "StorageService cannot be client-side");
     }
     
     /**
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceRevocationCache.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceRevocationCache.java
index 565bb45f1..7cdc40b7b 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceRevocationCache.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/StorageServiceRevocationCache.java
@@ -27,7 +27,6 @@ import javax.annotation.Nullable;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.opensaml.storage.RevocationCache;
 import org.opensaml.storage.StorageCapabilities;
-import org.opensaml.storage.StorageCapabilitiesEx;
 import org.opensaml.storage.StorageRecord;
 import org.opensaml.storage.StorageService;
 import org.slf4j.Logger;
@@ -105,10 +104,7 @@ public class StorageServiceRevocationCache extends AbstractIdentifiableInitializ
         checkSetterPreconditions();
 
         storage = Constraint.isNotNull(storageService, "StorageService cannot be null");
-        final StorageCapabilities caps = storage.getCapabilities();
-        if (caps instanceof StorageCapabilitiesEx) {
-            Constraint.isTrue(((StorageCapabilitiesEx) caps).isServerSide(), "StorageService cannot be client-side");
-        }
+        Constraint.isTrue(storage.getCapabilities().isServerSide(), "StorageService cannot be client-side");
     }
 
     /**
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
index f723ec7f0..ebf9ff103 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
@@ -32,7 +32,7 @@ import javax.annotation.Nullable;
 
 import org.opensaml.storage.AbstractMapBackedStorageService;
 import org.opensaml.storage.MutableStorageRecord;
-import org.opensaml.storage.StorageCapabilitiesEx;
+import org.opensaml.storage.StorageCapabilities;
 import org.opensaml.storage.impl.client.ClientStorageServiceStore.Factory;
 import org.opensaml.storage.impl.client.JSONClientStorageServiceStore.JSONClientStorageServiceStoreFactory;
 import org.slf4j.Logger;
@@ -69,7 +69,7 @@ import net.shibboleth.utilities.java.support.security.DataSealerKeyStrategy;
  * load/store of the data to/from that object is driven via companion classes. The serialization
  * of data is inside the storage object class, but the encryption/decryption is here.</p>
  */
-public class ClientStorageService extends AbstractMapBackedStorageService implements Filter, StorageCapabilitiesEx {
+public class ClientStorageService extends AbstractMapBackedStorageService implements Filter, StorageCapabilities {
 
     /** Name of session attribute for session lock. */
     @Nonnull protected static final String LOCK_ATTRIBUTE =
diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageCapabilities.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageCapabilities.java
index 6d82b589e..8987e1296 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageCapabilities.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageCapabilities.java
@@ -19,7 +19,7 @@ package org.opensaml.storage.impl.memcached;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.Positive;
 import net.shibboleth.utilities.java.support.logic.Constraint;
-import org.opensaml.storage.StorageCapabilitiesEx;
+import org.opensaml.storage.StorageCapabilities;
 
 /**
  * Provides a description of memcached capabilities. Note that only value size is configurable since memcached supports
@@ -28,7 +28,7 @@ import org.opensaml.storage.StorageCapabilitiesEx;
  *
  * @author Marvin S. Addison
  */
-public class MemcachedStorageCapabilities implements StorageCapabilitiesEx {
+public class MemcachedStorageCapabilities implements StorageCapabilities {
 
     /** Memcached supports 1M slabs (i.e. values) by default and issues warning on increase. */
     private static long defaultMaxValue = 1024 * 1024;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list