/*
 * Copyright 2019 The gRPC Authors
 *
 * 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 io.grpc.xds.sds;

import io.envoyproxy.envoy.api.v2.auth.DownstreamTlsContext;
import io.envoyproxy.envoy.api.v2.auth.UpstreamTlsContext;
import io.grpc.Internal;
import io.netty.handler.ssl.SslContext;

/**
 * Class to manage secrets used to create SSL contexts - this effectively manages SSL contexts
 * (aka TlsContexts) based on inputs we get from xDS. This is used by gRPC-xds to access the
 * SSL contexts/secrets and is not public API.
 * TODO(sanjaypujare): flesh out the implementation and remove the old {@link SecretManager}
 * once done.
 */
@Internal
public class TlsContextManager {

  public SecretProvider<SslContext> findOrCreateServerSslContextProvider(
      DownstreamTlsContext downstreamTlsContext) {
    // TODO(sanjaypujare): implement required SecrerProvider
    return null;
  }

  public SecretProvider<SslContext> findOrCreateClientSslContextProvider(
      UpstreamTlsContext upstreamTlsContext) {
    // TODO(sanjaypujare): implement required SecrerProvider
    return null;
  }

}

@@ -1051,160 +1051,194 @@
 .%0A *
- TODO(sanjaypujare): flesh out the implementation and remove the old %7B@link
+/%0A@Internal%0Apublic final class TlsContextManager %7B%0A%0A  /**%0A   * Finds an existing
  Secret
-Manager%7D%0A * once done.%0A */%0A@Internal%0Apublic class TlsContextManager %7B%0A
+Provider or creates it if it doesn't exist.%0A   * Used for retrieving a server-side SslContext%0A   */
 %0A  p
@@ -1399,32 +1399,31 @@
 ment
- required
+ation of
  Secre
-r
+t
 Provider
 %0A   
@@ -1410,32 +1410,44 @@
 f SecretProvider
+%3CSslContext%3E
 %0A    return null
@@ -1453,16 +1453,151 @@
 l;%0A  %7D%0A%0A
+  /**%0A   * Finds an existing SecretProvider or creates it if it doesn't exist.%0A   * Used for retrieving a client-side SslContext%0A   */%0A
   public
@@ -1749,32 +1749,31 @@
 ment
- required
+ation of
  Secre
-r
+t
 Provider
 %0A   
@@ -1768,16 +1768,28 @@
 Provider
+%3CSslContext%3E
 %0A    ret
@@ -1802,11 +1802,10 @@
 ll;%0A  %7D%0A
-%0A
 %7D%0A

fix Javadoc comments and add final qualifier also fix typo