public interface

RequestManager

com.atlassian.stash.request.RequestManager

Class Overview

Sets up and tears down all logic for processing requests, such as logging, access logging, profiling and publishing RequestStartedEvent and RequestEndedEvent.

Summary

Public Methods
@Nullable <T, E extends Exception> T doAsRequest(RequestCallback<T, E> callback, RequestInfoProvider requestInfoProvider)
Sets up and tears down all logic for processing requests.
@Nullable RequestContext getRequestContext()
@Nullable RequestMetadata getRequestMetadata()

Public Methods

@Nullable public T doAsRequest (RequestCallback<T, E> callback, RequestInfoProvider requestInfoProvider)

Sets up and tears down all logic for processing requests.

Parameters
callback called after the RequestStartedEvent has been published.
requestInfoProvider provides request details such as sessionId, remoteAddress that are used to set up logging.
Returns
  • the return value of the callback
Throws
when withRequest(RequestContext) throws an exception.
Exception

@Nullable public RequestContext getRequestContext ()

Returns
  • the context of the current request. Returns null if there is no current request, for instance when running a task in a background thread.

@Nullable public RequestMetadata getRequestMetadata ()

Returns
  • the metadata of the current request. Returns null if there is no current request.