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 Summary
Constructors Constructor Description RequestContext()Initializes a new instance of the RequestContext class.RequestContext(String locale)Initializes a new instance of the RequestContext class with provided locale.RequestContext(UUID correlationId)Initializes a new instance of the RequestContext class with a correlation Id.RequestContext(UUID correlationId, String locale)Initializes a new instance of the RequestContext class with a correlation Id and the provided locale.RequestContext(UUID correlationId, UUID requestId, String locale)Initializes a new instance of the RequestContext class with the given correlation, request identifier and locale. -
Method Summary
Modifier and Type Method Description UUIDgetCorrelationId()Gets the correlation identifier.StringgetLocale()Gets the locale.UUIDgetRequestId()Gets the request identifier.voidsetCorrelationId(UUID value)Sets the correlation identifier.voidsetLocale(String value)Sets the locale.voidsetRequestId(UUID value)Sets the request identifier.StringtoString()Returns a string representation of the request context.
-
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
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
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
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
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
Gets the request identifier. Uniquely identifies the operation.- Specified by:
getRequestIdin interfaceIRequestContext- Returns:
- the request identifier.
-
setRequestId
Sets the request identifier.- Parameters:
value- The request identifier.
-
getCorrelationId
Gets the correlation identifier. This identifier is used to group logical operations together.- Specified by:
getCorrelationIdin interfaceIRequestContext- Returns:
- The correlation identifier.
-
setCorrelationId
Sets the correlation identifier.- Parameters:
value- The correlation identifier.
-
getLocale
Gets the locale.- Specified by:
getLocalein interfaceIRequestContext- Returns:
- The locale.
-
setLocale
Sets the locale.- Parameters:
value- The locale.
-
toString
Returns a string representation of the request context.
-