Package fr.gouv.vitam.common.server
Class HeaderIdHelper
- java.lang.Object
-
- fr.gouv.vitam.common.server.HeaderIdHelper
-
public class HeaderIdHelper extends java.lang.Object
HeaderId Helper, check and put header values
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HeaderIdHelper.Context
Context of request
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getHeaderString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, java.lang.String headerName)
static void
putVitamIdFromExternalHeaderInSession(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, HeaderIdHelper.Context ctx)
Extracts the vitam id from the headers to save it through the VitamSessionstatic void
putVitamIdFromHeaderInSession(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, HeaderIdHelper.Context ctx)
Extracts the vitam id from the headers to save it through the VitamSessionstatic void
putVitamIdFromSessionInExternalHeader(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, HeaderIdHelper.Context ctx, int statusCode)
Retrieves the vitam id from the VitamSession and add a X-TENANT-ID headerstatic void
putVitamIdFromSessionInHeader(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, HeaderIdHelper.Context ctx, int statusCode)
Retrieves the vitam id from the VitamSession and add a X-TENANT-ID headerstatic void
writeMessageToResponse(javax.servlet.ServletRequest request, javax.servlet.ServletResponse servletResponse, com.fasterxml.jackson.databind.JsonNode message)
-
-
-
Method Detail
-
writeMessageToResponse
public static void writeMessageToResponse(javax.servlet.ServletRequest request, javax.servlet.ServletResponse servletResponse, com.fasterxml.jackson.databind.JsonNode message) throws java.io.IOException
- Throws:
java.io.IOException
-
putVitamIdFromExternalHeaderInSession
public static void putVitamIdFromExternalHeaderInSession(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, HeaderIdHelper.Context ctx)
Extracts the vitam id from the headers to save it through the VitamSession- Parameters:
requestHeaders
- Complete list of HTTP message headers ; will not be changed.ctx
- Context, or rather http message type (request or response)
-
putVitamIdFromHeaderInSession
public static void putVitamIdFromHeaderInSession(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, HeaderIdHelper.Context ctx)
Extracts the vitam id from the headers to save it through the VitamSession- Parameters:
requestHeaders
- Complete list of HTTP message headers ; will not be changed.ctx
- Context, or rather http message type (request or response)
-
getHeaderString
public static java.lang.String getHeaderString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> requestHeaders, java.lang.String headerName)
-
putVitamIdFromSessionInExternalHeader
public static void putVitamIdFromSessionInExternalHeader(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, HeaderIdHelper.Context ctx, int statusCode)
Retrieves the vitam id from the VitamSession and add a X-TENANT-ID header- Parameters:
headers
- List of target HTTP headers ; required header will be added to this list.ctx
- Context, or rather http message type (request or response)statusCode
- the status code
-
putVitamIdFromSessionInHeader
public static void putVitamIdFromSessionInHeader(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, HeaderIdHelper.Context ctx, int statusCode)
Retrieves the vitam id from the VitamSession and add a X-TENANT-ID header- Parameters:
headers
- List of target HTTP headers ; required header will be added to this list.ctx
- Context, or rather http message type (request or response)statusCode
- status code
-
-