Package org.keycloak.services
Class HttpResponseImpl
- java.lang.Object
- 
- org.keycloak.services.HttpResponseImpl
 
- 
- All Implemented Interfaces:
- HttpResponse,- KeycloakTransaction
 
 public class HttpResponseImpl extends Object implements HttpResponse, KeycloakTransaction 
- 
- 
Constructor SummaryConstructors Constructor Description HttpResponseImpl(KeycloakSession session, org.jboss.resteasy.spi.HttpResponse delegate)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String name, String value)Add a value to the current list of values for the header with the givenname.voidbegin()voidcommit()booleangetRollbackOnly()booleanisActive()voidrollback()voidsetCookieIfAbsent(HttpCookie cookie)Sets a new cookie only if not yet set.voidsetHeader(String name, String value)Set a header.voidsetRollbackOnly()voidsetStatus(int statusCode)Sets a status code.voidsetWriteCookiesOnTransactionComplete()Adding cookies at the end of the transaction helps when retrying a transaction might add the cookie multiple times.
 
- 
- 
- 
Constructor Detail- 
HttpResponseImplpublic HttpResponseImpl(KeycloakSession session, org.jboss.resteasy.spi.HttpResponse delegate) 
 
- 
 - 
Method Detail- 
setStatuspublic void setStatus(int statusCode) Description copied from interface:HttpResponseSets a status code.- Specified by:
- setStatusin interface- HttpResponse
- Parameters:
- statusCode- the status code
 
 - 
addHeaderpublic void addHeader(String name, String value) Description copied from interface:HttpResponseAdd a value to the current list of values for the header with the givenname.- Specified by:
- addHeaderin interface- HttpResponse
- Parameters:
- name- the header name
- value- the header value
 
 - 
setHeaderpublic void setHeader(String name, String value) Description copied from interface:HttpResponseSet a header. Any existing values will be replaced.- Specified by:
- setHeaderin interface- HttpResponse
- Parameters:
- name- the header name
- value- the header value
 
 - 
setCookieIfAbsentpublic void setCookieIfAbsent(HttpCookie cookie) Description copied from interface:HttpResponseSets a new cookie only if not yet set.- Specified by:
- setCookieIfAbsentin interface- HttpResponse
- Parameters:
- cookie- the cookie
 
 - 
setWriteCookiesOnTransactionCompletepublic void setWriteCookiesOnTransactionComplete() Description copied from interface:HttpResponseAdding cookies at the end of the transaction helps when retrying a transaction might add the cookie multiple times. In some scenarios it must not be added at the end of the transaction, as at that time the response has already been sent to the caller ("committed"), so the code needs to make a choice. As retrying transactions is the exception, adding cookies at the end of the transaction is also the exception and needs to be switched on where necessary.- Specified by:
- setWriteCookiesOnTransactionCompletein interface- HttpResponse
 
 - 
beginpublic void begin() - Specified by:
- beginin interface- KeycloakTransaction
 
 - 
commitpublic void commit() - Specified by:
- commitin interface- KeycloakTransaction
 
 - 
rollbackpublic void rollback() - Specified by:
- rollbackin interface- KeycloakTransaction
 
 - 
setRollbackOnlypublic void setRollbackOnly() - Specified by:
- setRollbackOnlyin interface- KeycloakTransaction
 
 - 
getRollbackOnlypublic boolean getRollbackOnly() - Specified by:
- getRollbackOnlyin interface- KeycloakTransaction
 
 - 
isActivepublic boolean isActive() - Specified by:
- isActivein interface- KeycloakTransaction
 
 
- 
 
-