6034bb4798dde254975c55473140dab9e7012fbb
[netconf.git] / plugins / netconf-client-mdsal / src / main / java / org / opendaylight / netconf / client / mdsal / api / SslContextFactoryProvider.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.client.mdsal.api;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.netconf.client.SslContextFactory;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240319.connection.parameters.protocol.Specification;
14
15 /**
16  * A provider for {@link SslContextFactory} implementations. This allows the factory to be tailored with a
17  * {@link Specification}.
18  */
19 public interface SslContextFactoryProvider {
20     /**
21      * Return a {@link SslContextFactory}, optionally conforming to a particular specification.
22      *
23      * @param specification A {@link Specification}, may be {@code null}
24      * @return A {@link SslContextFactory}
25      * @throws IllegalArgumentException if {@code specification} is not {@code null} and it is not supported by this
26      *         provider.
27      */
28     @NonNull SslContextFactory getSslContextFactory(@Nullable Specification specification);
29 }