[java-opensaml] branch main updated: OSJ-318 - Deprecate terms from classes and configuration

Scott Cantor cantor.2 at osu.edu
Wed Mar 10 14:56:38 UTC 2021


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=1d19a044a50ec3f0c0e955784e44374f9904a57e

The following commit(s) were added to refs/heads/main by this push:
       new  1d19a044a OSJ-318 - Deprecate terms from classes and configuration
1d19a044a is described below

commit 1d19a044a50ec3f0c0e955784e44374f9904a57e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Mar 10 09:56:35 2021 -0500

    OSJ-318 - Deprecate terms from classes and configuration
    
    https://issues.shibboleth.net/jira/browse/OSJ-318
---
 .../impl/memcached/MemcachedStorageService.java    | 55 ++++++++++------------
 1 file changed, 26 insertions(+), 29 deletions(-)

diff --git a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
index 88849d808..2882aa66d 100644
--- a/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
+++ b/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/memcached/MemcachedStorageService.java
@@ -91,37 +91,34 @@ import java.util.concurrent.TimeoutException;
 public class MemcachedStorageService extends AbstractIdentifiableInitializableComponent implements StorageService {
 
     /** Key suffix for entry that contains a list of context keys. */
-    protected static final String CTX_KEY_LIST_SUFFIX = ":contextKeyList";
+    @Nonnull @NotEmpty protected static final String CTX_KEY_LIST_SUFFIX = ":contextKeyList";
 
-    /** Key suffix for entry that contains a list of blacklisted (deleted) context keys. */
-    protected static final String CTX_KEY_BLACKLIST_SUFFIX = ":contextKeyBlackList";
+    /** Key suffix for entry that contains a list of deleted context keys. */
+    @Nonnull @NotEmpty protected static final String CTX_KEY_DELETED_SUFFIX = ":contextKeyDeletedList";
 
     /** Delimiter of items in the context key list. */
-    private static final String CTX_KEY_LIST_DELIMITER = "\n";
+    @Nonnull @NotEmpty private static final String CTX_KEY_LIST_DELIMITER = "\n";
 
     /** Maximum length in bytes of memcached keys. */
     private static final int MAX_KEY_LENGTH = 250;
 
     /** Logger instance. */
-    private final Logger logger = LoggerFactory.getLogger(MemcachedStorageService.class);
+    @Nonnull private final Logger logger = LoggerFactory.getLogger(MemcachedStorageService.class);
 
     /** Handles conversion of {@link MemcachedStorageRecord} to bytes and vice versa. */
-    private final Transcoder<MemcachedStorageRecord<?>> storageRecordTranscoder = new StorageRecordTranscoder();
+    @Nonnull private final Transcoder<MemcachedStorageRecord<?>> storageRecordTranscoder;
 
     /** Handles conversion of strings to bytes and vice versa. */
-    private final Transcoder<String> stringTranscoder = new StringTranscoder();
+    @Nonnull private final Transcoder<String> stringTranscoder;
 
     /** Invariant storage capabilities. */
-    @Nonnull
-    private MemcachedStorageCapabilities storageCapabilities;
+    @Nonnull private MemcachedStorageCapabilities storageCapabilities;
 
     /** Memcached client instance. */
-    @Nonnull
-    private final MemcachedClient memcacheClient;
+    @Nonnull private final MemcachedClient memcacheClient;
 
     /** Memcached asynchronous operation timeout in seconds. */
-    @Positive
-    private int operationTimeout;
+    @Positive private int operationTimeout;
 
     /** Flag that controls context key tracking. */
     private boolean trackContextKeys;
@@ -154,9 +151,7 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
      *                                 not needed, the flag should be set to <code>false</code> for better
      *                                 performance. The feature is disabled by default.
      */
-    public MemcachedStorageService(
-            @Nonnull final MemcachedClient client,
-            @Positive final int timeout,
+    public MemcachedStorageService(@Nonnull final MemcachedClient client, @Positive final int timeout,
             final boolean enableContextKeyTracking) {
         Constraint.isNotNull(client, "Client cannot be null");
         Constraint.isGreaterThan(0, timeout, "Operation timeout must be positive");
@@ -164,6 +159,8 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
         operationTimeout = timeout;
         trackContextKeys = enableContextKeyTracking;
         storageCapabilities = new MemcachedStorageCapabilities();
+        storageRecordTranscoder = new StorageRecordTranscoder();
+        stringTranscoder = new StringTranscoder();
     }
 
     /** {@inheritDoc} */
@@ -449,9 +446,9 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
         logger.debug("Deleting entry at {} for context={}, key={}", cacheKey, context, key);
         final boolean success = handleAsyncResult(memcacheClient.delete(cacheKey));
         if (success && trackContextKeys) {
-            logger.debug("Blacklisting key {} for context {}", cacheKey, context);
-            if (!updateContextKeyList(CTX_KEY_BLACKLIST_SUFFIX, namespace, cacheKey)) {
-                logger.debug("Failed appending {} to list of blacklisted keys for context {}", cacheKey, context);
+            logger.debug("Noting deletion of key {} for context {}", cacheKey, context);
+            if (!updateContextKeyList(CTX_KEY_DELETED_SUFFIX, namespace, cacheKey)) {
+                logger.debug("Failed appending {} to list of deleted keys for context {}", cacheKey, context);
             }
         }
         return success;
@@ -483,9 +480,9 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
         logger.debug("Deleting entry at {} for context={}, key={}, version={}", cacheKey, context, key, version);
         final boolean success = handleAsyncResult(memcacheClient.delete(cacheKey, version));
         if (success && trackContextKeys) {
-            logger.debug("Blacklisting key {} for context {}", cacheKey, context);
-            if (!updateContextKeyList(CTX_KEY_BLACKLIST_SUFFIX, namespace, cacheKey)) {
-                logger.debug("Failed appending {} to list of blacklisted keys for context {}", cacheKey, context);
+            logger.debug("Noting deletion of key {} for context {}", cacheKey, context);
+            if (!updateContextKeyList(CTX_KEY_DELETED_SUFFIX, namespace, cacheKey)) {
+                logger.debug("Failed appending {} to list of deleted keys for context {}", cacheKey, context);
             }
         }
         return success;
@@ -532,10 +529,10 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
             return;
         }
         final Set<String> keySet = new HashSet<>(Arrays.asList(keys.getValue().split(CTX_KEY_LIST_DELIMITER)));
-        final CASValue<String> blacklistKeys = handleAsyncResult(
-                memcacheClient.asyncGets(namespace + CTX_KEY_BLACKLIST_SUFFIX, stringTranscoder));
-        if (blacklistKeys != null) {
-            keySet.removeAll(Arrays.asList(blacklistKeys.getValue().split(CTX_KEY_LIST_DELIMITER)));
+        final CASValue<String> deletedKeys = handleAsyncResult(
+                memcacheClient.asyncGets(namespace + CTX_KEY_DELETED_SUFFIX, stringTranscoder));
+        if (deletedKeys != null) {
+            keySet.removeAll(Arrays.asList(deletedKeys.getValue().split(CTX_KEY_LIST_DELIMITER)));
         }
         final List<OperationFuture<Boolean>> results = new ArrayList<>(keySet.size());
         for (final String key : keySet) {
@@ -561,10 +558,10 @@ public class MemcachedStorageService extends AbstractIdentifiableInitializableCo
         final OperationFuture<Boolean> nsResult = memcacheClient.delete(namespace);
         if (trackContextKeys) {
             final OperationFuture<Boolean> keyListResult = memcacheClient.delete(namespace + CTX_KEY_LIST_SUFFIX);
-            final OperationFuture<Boolean> blackListResult =
-                    memcacheClient.delete(namespace + CTX_KEY_BLACKLIST_SUFFIX);
+            final OperationFuture<Boolean> deletedKeyResult =
+                    memcacheClient.delete(namespace + CTX_KEY_DELETED_SUFFIX);
             handleAsyncResult(keyListResult);
-            handleAsyncResult(blackListResult);
+            handleAsyncResult(deletedKeyResult);
         }
         handleAsyncResult(ctxResult);
         handleAsyncResult(nsResult);

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


More information about the commits mailing list