[java-opensaml] 02/02: Update component API calls.

Scott Cantor cantor.2 at osu.edu
Wed Aug 3 15:16:56 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=b4046c68f7fd5d6ae63196ad288fa101c19aa023

commit b4046c68f7fd5d6ae63196ad288fa101c19aa023
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Aug 3 11:16:51 2022 -0400

    Update component API calls.
---
 .../main/java/org/opensaml/storage/RevocationCache.java   | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/opensaml-storage-api/src/main/java/org/opensaml/storage/RevocationCache.java b/opensaml-storage-api/src/main/java/org/opensaml/storage/RevocationCache.java
index bad643e91..12d55d225 100644
--- a/opensaml-storage-api/src/main/java/org/opensaml/storage/RevocationCache.java
+++ b/opensaml-storage-api/src/main/java/org/opensaml/storage/RevocationCache.java
@@ -178,11 +178,9 @@ public class RevocationCache extends AbstractIdentifiableInitializableComponent
      */
     public synchronized boolean revoke(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String s,
             @Nonnull @NotEmpty final String value, @Nonnull final Duration exp) {
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        checkComponentActive();
         
         final String key;
-
         final StorageCapabilities caps = storage.getCapabilities();
         if (context.length() > caps.getContextSize()) {
             log.error("context {} too long for StorageService (limit {})", context, caps.getContextSize());
@@ -221,9 +219,8 @@ public class RevocationCache extends AbstractIdentifiableInitializableComponent
      * @since 4.3.0
      */
     public synchronized boolean unrevoke(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String s) {
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
-
+        checkComponentActive();
+        
         final String key;
         final StorageCapabilities caps = storage.getCapabilities();
         if (context.length() > caps.getContextSize()) {
@@ -252,8 +249,7 @@ public class RevocationCache extends AbstractIdentifiableInitializableComponent
      * @return true iff the check value is found in the cache
      */
     public synchronized boolean isRevoked(@Nonnull @NotEmpty final String context, @Nonnull @NotEmpty final String s) {
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        checkComponentActive();
 
         final String key;
         final StorageCapabilities caps = storage.getCapabilities();
@@ -299,8 +295,7 @@ public class RevocationCache extends AbstractIdentifiableInitializableComponent
      */
     @Nullable @NotEmpty public synchronized String getRevocationRecord(@Nonnull @NotEmpty final String context,
             @Nonnull @NotEmpty final String s) throws IOException {
-        ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-        ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
+        checkComponentActive();
 
         final String key;
         final StorageCapabilities caps = storage.getCapabilities();

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


More information about the commits mailing list