diff --git a/auth/client/src/main/java/org/wildfly/security/auth/client/ActiveSessionsSSLContext.java b/auth/client/src/main/java/org/wildfly/security/auth/client/ActiveSessionsSSLContext.java new file mode 100644 index 0000000000..691066b170 --- /dev/null +++ b/auth/client/src/main/java/org/wildfly/security/auth/client/ActiveSessionsSSLContext.java @@ -0,0 +1,33 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2024 Red Hat, Inc., and individual contributors + * as indicated by the @author tags. + * + * Licensed 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.wildfly.security.auth.client; + +/** + * An interface indicating active sessions of an SSLContext + */ +public interface ActiveSessionsSSLContext { + /** + * Indicates if the SSLContext has active sessions. + * + * @return true if SSLContext has active sessions. Otherwise, false + */ + default boolean hasActiveSessions() { + return false; + } +} diff --git a/dynamic-ssl/src/main/java/org/wildfly/security/dynamic/ssl/DynamicSSLContext.java b/dynamic-ssl/src/main/java/org/wildfly/security/dynamic/ssl/DynamicSSLContext.java index 1fcbf93a02..500d03badc 100644 --- a/dynamic-ssl/src/main/java/org/wildfly/security/dynamic/ssl/DynamicSSLContext.java +++ b/dynamic-ssl/src/main/java/org/wildfly/security/dynamic/ssl/DynamicSSLContext.java @@ -17,6 +17,8 @@ */ package org.wildfly.security.dynamic.ssl; +import org.wildfly.security.auth.client.ActiveSessionsSSLContext; + import javax.net.ssl.SSLContext; import java.security.NoSuchAlgorithmException; @@ -25,7 +27,7 @@ * * @author Diana Krepinska */ -public final class DynamicSSLContext extends SSLContext { +public final class DynamicSSLContext extends SSLContext implements ActiveSessionsSSLContext { private static SSLContext resolverSSLContext(DynamicSSLContextSPI dynamicSSLContextSPIImpl) throws NoSuchAlgorithmException, DynamicSSLContextException { return dynamicSSLContextSPIImpl.getConfiguredDefault() == null ?