Package io.narayana.lra
Class Current
- java.lang.Object
-
- io.narayana.lra.Current
-
public class Current extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.net.URIbuildFullLRAUrl(java.lang.String baseURI, java.net.URI parentId)static voidclearContext(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)static java.util.List<java.lang.Object>getContexts()static java.lang.StringgetFirstParent(java.net.URI parent)static <T> TgetLast(java.util.List<T> objects)static java.lang.ObjectgetState(java.lang.String key)static java.net.URIpeek()static java.net.URIpop()static booleanpop(java.net.URI lra)static voidpopAll()static voidpush(java.net.URI lraId)push the current context onto the stack of contexts for this threadstatic java.lang.ObjectputState(java.lang.String key, java.lang.Object value)static voidupdateLRAContext(java.net.URI lraId, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)static voidupdateLRAContext(javax.ws.rs.client.ClientRequestContext context)If there is an LRA context on the calling thread then make it available as a header on outgoing JAX-RS invocationsstatic voidupdateLRAContext(javax.ws.rs.container.ContainerResponseContext responseContext)If there is an LRA context on the calling thread then add it to the provided headersjava.lang.ObjectupdateState(java.lang.String key, java.lang.Object value)
-
-
-
Method Detail
-
putState
public static java.lang.Object putState(java.lang.String key, java.lang.Object value)
-
getState
public static java.lang.Object getState(java.lang.String key)
-
buildFullLRAUrl
public static java.net.URI buildFullLRAUrl(java.lang.String baseURI, java.net.URI parentId) throws java.net.URISyntaxException- Throws:
java.net.URISyntaxException
-
getFirstParent
public static java.lang.String getFirstParent(java.net.URI parent) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
updateState
public java.lang.Object updateState(java.lang.String key, java.lang.Object value)
-
peek
public static java.net.URI peek()
-
pop
public static java.net.URI pop()
-
pop
public static boolean pop(java.net.URI lra)
-
push
public static void push(java.net.URI lraId)
push the current context onto the stack of contexts for this thread- Parameters:
lraId- id of context to push (must not be null)
-
getContexts
public static java.util.List<java.lang.Object> getContexts()
-
updateLRAContext
public static void updateLRAContext(javax.ws.rs.container.ContainerResponseContext responseContext)
If there is an LRA context on the calling thread then add it to the provided headers- Parameters:
responseContext- the header map to add the KRA context to
-
updateLRAContext
public static void updateLRAContext(java.net.URI lraId, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)
-
updateLRAContext
public static void updateLRAContext(javax.ws.rs.client.ClientRequestContext context)
If there is an LRA context on the calling thread then make it available as a header on outgoing JAX-RS invocations- Parameters:
context- the context for the JAX-RS request
-
popAll
public static void popAll()
-
clearContext
public static void clearContext(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers)
-
getLast
public static <T> T getLast(java.util.List<T> objects)
-
-