Class RequestContext

java.lang.Object
com.microsoft.store.partnercenter.requestcontext.RequestContext
All Implemented Interfaces:
IRequestContext

public class RequestContext
extends Object
implements IRequestContext
Request context implementation.
  • Constructor Details

    • RequestContext

      public RequestContext()
      Initializes a new instance of the RequestContext class. Correlation Id will be generated. The request Id will be automatically generated for each service API call.
    • RequestContext

      public RequestContext​(String locale)
      Initializes a new instance of the RequestContext class with provided locale. Correlation Id will be generated. The request Id will be automatically generated for each service API call.
      Parameters:
      locale - The locale.
    • RequestContext

      public RequestContext​(UUID correlationId)
      Initializes a new instance of the RequestContext class with a correlation Id. The request Id will be automatically generated and a default Locale is set for each service API call.
      Parameters:
      correlationId - The correlation Id. This Id is used to group logical operations together.
    • RequestContext

      public RequestContext​(UUID correlationId, String locale)
      Initializes a new instance of the RequestContext class with a correlation Id and the provided locale. The request Id will be automatically generated for each service API call.
      Parameters:
      correlationId - The correlation Id. This Id is used to group logical operations together.
      locale - The locale.
    • RequestContext

      public RequestContext​(UUID correlationId, UUID requestId, String locale)
      Initializes a new instance of the RequestContext class with the given correlation, request identifier and locale.
      Parameters:
      correlationId - The correlation Id. This Id is used to group logical operations together.
      requestId - The request Id. Uniquely identifies the operation.
      locale - The locale.
  • Method Details

    • getRequestId

      public UUID getRequestId()
      Gets the request identifier. Uniquely identifies the operation.
      Specified by:
      getRequestId in interface IRequestContext
      Returns:
      the request identifier.
    • setRequestId

      public void setRequestId​(UUID value)
      Sets the request identifier.
      Parameters:
      value - The request identifier.
    • getCorrelationId

      public UUID getCorrelationId()
      Gets the correlation identifier. This identifier is used to group logical operations together.
      Specified by:
      getCorrelationId in interface IRequestContext
      Returns:
      The correlation identifier.
    • setCorrelationId

      public void setCorrelationId​(UUID value)
      Sets the correlation identifier.
      Parameters:
      value - The correlation identifier.
    • getLocale

      public String getLocale()
      Gets the locale.
      Specified by:
      getLocale in interface IRequestContext
      Returns:
      The locale.
    • setLocale

      public void setLocale​(String value)
      Sets the locale.
      Parameters:
      value - The locale.
    • toString

      public String toString()
      Returns a string representation of the request context.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the request context.