com.atlassian.usercontext.api.UserContextProvider Maven / Gradle / Ivy
package com.atlassian.usercontext.api;
import com.atlassian.annotations.PublicApi;
import java.util.Optional;
/**
* The UserContext provider API. It allows us to retrieve the {@link UserContext} corresponding to the
* supplied earlier {@code userContext} via the UserContextSetter.setUserContext(String) method. The {@link #getUserContext}
* method can be called multiple times while processing the current piece of work.
*/
@PublicApi
public interface UserContextProvider {
/**
* Retrieves the {@link UserContext} corresponding to the set earlier.
*
* @throws IllegalStateException if the underlying WorkContext reference is not properly initialised.
*/
Optional getUserContext();
}