//----------------------------------------------------------------------------- // // Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // A copy of the License is located at // // http://aws.amazon.com/apache2.0 // // or in the "license" file accompanying this file. This file 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. // //----------------------------------------------------------------------------- using System; using Amazon.XRay.Recorder.Core.Exceptions; using Amazon.XRay.Recorder.Core.Internal.Entities; using Amazon.XRay.Recorder.Core.Strategies; namespace Amazon.XRay.Recorder.Core.Internal.Context { /// /// Interface to save trace segment which will be preserved across thread. /// public interface ITraceContext { /// /// Get entity (segment/subsegment) from the trace context. /// /// The segment get from context /// Thrown when the entity is not available to get. Entity GetEntity(); /// /// Set the specified entity (segment/subsegment) into trace context. /// /// The segment to be set /// Thrown when the entity is not available to set void SetEntity(Entity entity); /// /// Clear entity from trace context for cleanup. /// void ClearEntity(); /// /// Checks whether enity is present in trace context. /// /// True if entity is present incontext container else false. Boolean IsEntityPresent(); /// /// If the entity is missing from the context, the behavior is defined using /// /// instance /// Instance of /// String message void HandleEntityMissing(IAWSXRayRecorder recorder, Exception e, string message); } }