// Path: client/beadledom-client/src/main/java/com/cerner/beadledom/client/CorrelationIdContext.java
// @Deprecated
// public interface CorrelationIdContext {
//   /**
//    * The default header name for the correlationId.
//    */
//   String DEFAULT_HEADER_NAME = "Correlation-Id";
// 
//   /**
//    * The default MDC property name for the correlationId.
//    *
//    * @deprecated This property exists for legacy support of the original beadledom-1.0 release,
//    *     which allows setting a different name for the MDC property value than the header value.
//    *     Ideally the same name will be used for the header and MDC if MDC is used at all.
//    */
//   @Deprecated
//   String DEFAULT_MDC_NAME = "Correlation-Id";
// 
//   /**
//    * Returns the correlationId from the context; null if a correlationId is not found.
//    */
//   @Nullable
//   String getCorrelationId();
// }
// 
// Path: correlation/src/main/java/com/cerner/beadledom/correlation/CorrelationContext.java
// public final class CorrelationContext {
// 
//   private static final ThreadLocal<String> correlationId = new ThreadLocal<>();
// 
//   private CorrelationContext() {
// 
//   }
// 
//   /**
//    * Creates a Correlation Context.
//    */
//   public static CorrelationContext create() {
//     return new CorrelationContext();
//   }
// 
//   /**
//    * Returns the current Correlation ID, {@code null} if no Correlation ID is in context.
//    */
//   @Nullable
//   public String getId() {
//     return CorrelationContext.correlationId.get();
//   }
// 
//   /**
//    * Sets the Correlation ID. If {@code correlationId} is {@code null}, a correlation id is
//    * generated.
//    */
//   public void setId(@Nullable String correlationId) {
//     if (correlationId == null) {
//       CorrelationContext.correlationId.set(UUID.randomUUID().toString());
//     } else {
//       CorrelationContext.correlationId.set(correlationId);
//     }
//   }
// 
//   /**
//    * Sets the Correlation ID to {@code null}.
//    */
//   public void clearId() {
//     CorrelationContext.correlationId.remove();
//   }
// 
//   /**
//    * Computes the result of the {@code task} with the correlation context ID being set to {@code
//    * correlationId}. The correlation id is cleared from the context after the completion of the
//    * task. If {@code correlationId} is {@code null}, a correlation ID is generated.
//    */
//   public <V> V withId(@Nullable String correlationId, Callable<V> task) throws Exception {
//     try {
//       setId(correlationId);
//       return task.call();
//     } finally {
//       clearId();
//     }
//   }
// }


import com.cerner.beadledom.client.CorrelationIdContext;
import com.cerner.beadledom.correlation.CorrelationContext;
import javax.annotation.Nullable;
import javax.ws.rs.core.HttpHeaders;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.slf4j.MDC;
package com.cerner.beadledom.client.resteasy;


/**
 * A Resteasy implementation of {@link CorrelationIdContext} that retrieves the correlationId from
 * the request headers if present, and falls back to the MDC for compatibility with
 * beadledom-jaxrs-1.0.
 *
 * @author John Leacox
 * @since 1.0
 * @deprecated As of 3.6, use Retrofit (https://github.com/square/retrofit) instead.
 */
@Deprecated
class ResteasyCorrelationIdContext implements CorrelationIdContext {
  private final String headerName;
  private final String mdcName;
  private final CorrelationContext correlationContext;

  ResteasyCorrelationIdContext(@Nullable String headerName, @Nullable String mdcName,
      CorrelationContext correlationContext) {
// Path: client/beadledom-client/src/main/java/com/cerner/beadledom/client/CorrelationIdContext.java
// @Deprecated
// public interface CorrelationIdContext {
//   /**
//    * The default header name for the correlationId.
//    */
//   String DEFAULT_HEADER_NAME = "Correlation-Id";
// 
//   /**
//    * The default MDC property name for the correlationId.
//    *
//    * @deprecated This property exists for legacy support of the original beadledom-1.0 release,
//    *     which allows setting a different name for the MDC property value than the header value.
//    *     Ideally the same name will be used for the header and MDC if MDC is used at all.
//    */
//   @Deprecated
//   String DEFAULT_MDC_NAME = "Correlation-Id";
// 
//   /**
//    * Returns the correlationId from the context; null if a correlationId is not found.
//    */
//   @Nullable
//   String getCorrelationId();
// }
// 
// Path: correlation/src/main/java/com/cerner/beadledom/correlation/CorrelationContext.java
// public final class CorrelationContext {
// 
//   private static final ThreadLocal<String> correlationId = new ThreadLocal<>();
// 
//   private CorrelationContext() {
// 
//   }
// 
//   /**
//    * Creates a Correlation Context.
//    */
//   public static CorrelationContext create() {
//     return new CorrelationContext();
//   }
// 
//   /**
//    * Returns the current Correlation ID, {@code null} if no Correlation ID is in context.
//    */
//   @Nullable
//   public String getId() {
//     return CorrelationContext.correlationId.get();
//   }
// 
//   /**
//    * Sets the Correlation ID. If {@code correlationId} is {@code null}, a correlation id is
//    * generated.
//    */
//   public void setId(@Nullable String correlationId) {
//     if (correlationId == null) {
//       CorrelationContext.correlationId.set(UUID.randomUUID().toString());
//     } else {
//       CorrelationContext.correlationId.set(correlationId);
//     }
//   }
// 
//   /**
//    * Sets the Correlation ID to {@code null}.
//    */
//   public void clearId() {
//     CorrelationContext.correlationId.remove();
//   }
// 
//   /**
//    * Computes the result of the {@code task} with the correlation context ID being set to {@code
//    * correlationId}. The correlation id is cleared from the context after the completion of the
//    * task. If {@code correlationId} is {@code null}, a correlation ID is generated.
//    */
//   public <V> V withId(@Nullable String correlationId, Callable<V> task) throws Exception {
//     try {
//       setId(correlationId);
//       return task.call();
//     } finally {
//       clearId();
//     }
//   }
// }


// Path: client/resteasy-client/src/main/java/com/cerner/beadledom/client/resteasy/ResteasyCorrelationIdContext.java
import com.cerner.beadledom.client.CorrelationIdContext;
import com.cerner.beadledom.correlation.CorrelationContext;
import javax.annotation.Nullable;
import javax.ws.rs.core.HttpHeaders;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.slf4j.MDC;

package com.cerner.beadledom.client.resteasy;


/**
 * A Resteasy implementation of {@link CorrelationIdContext} that retrieves the correlationId from
 * the request headers if present, and falls back to the MDC for compatibility with
 * beadledom-jaxrs-1.0.
 *
 * @author John Leacox
 * @since 1.0
 * @deprecated As of 3.6, use Retrofit (https://github.com/square/retrofit) instead.
 */
@Deprecated
class ResteasyCorrelationIdContext implements CorrelationIdContext {
  private final String headerName;
  private final String mdcName;
  private final CorrelationContext correlationContext;

  ResteasyCorrelationIdContext(@Nullable String headerName, @Nullable String mdcName,
      CorrelationContext correlationContext) {
    this.headerName = headerName != null ? headerName : CorrelationIdContext.DEFAULT_HEADER_NAME;