/*
 * Copyright 2019, OpenTelemetry 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.opentelemetry.sdk.distributedcontext;

import io.opentelemetry.context.Scope;
import io.opentelemetry.context.propagation.BinaryFormat;
import io.opentelemetry.context.propagation.HttpTextFormat;
import io.opentelemetry.distributedcontext.DistributedContext;
import io.opentelemetry.distributedcontext.DistributedContextManager;
import io.opentelemetry.distributedcontext.unsafe.ContextUtils;

/**
 * {@link DistributedContextManagerSdk} is SDK implementation of {@link DistributedContextManager}.
 */
public class DistributedContextManagerSdk implements DistributedContextManager {

  @Override
  public DistributedContext getCurrentContext() {
    return ContextUtils.getValue();
  }

  @Override
  public DistributedContext.Builder contextBuilder() {
    return new DistributedContextSdk.Builder();
  }

  @Override
  public Scope withContext(DistributedContext distContext) {
    return ContextUtils.withDistributedContext(distContext);
  }

  @Override
  public BinaryFormat<DistributedContext> getBinaryFormat() {
    throw new UnsupportedOperationException("to be implemented");
  }

  @Override
  public HttpTextFormat<DistributedContext> getHttpTextFormat() {
    throw new UnsupportedOperationException("to be implemented");
  }
}

@@ -799,32 +799,109 @@
 HttpTextFormat;%0A
+import io.opentelemetry.distributedcontext.DefaultDistributedContextManager;%0A
 import io.opente
@@ -1716,216 +1716,298 @@
     
-throw new UnsupportedOperationException(%22to be implemented%22);%0A  %7D%0A%0A  @Override%0A  public HttpTextFormat%3CDistributedContext%3E getHttpTextFormat() %7B%0A    throw new UnsupportedOperationException(%22to be implemented%22
+// TODO: Implement this.%0A    return DefaultDistributedContextManager.getInstance().getBinaryFormat();%0A  %7D%0A%0A  @Override%0A  public HttpTextFormat%3CDistributedContext%3E getHttpTextFormat() %7B%0A    // TODO: Implement this.%0A    return DefaultDistributedContextManager.getInstance().getHttpTextFormat(
 );%0A 

Fix OpenTracingShim to run with SDK without baggages. (#608)