Skip to content

Commit

Permalink
[ELY-1996] Add new interface indicating active sessions of an SSLContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyllarr committed Mar 20, 2024
1 parent 79e8952 commit 0a13c93
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -25,7 +27,7 @@
*
* @author <a href="mailto:dvilkola@redhat.com">Diana Krepinska</a>
*/
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 ?
Expand Down

0 comments on commit 0a13c93

Please sign in to comment.