Class AbstractTransaction
java.lang.Object
org.eblocker.server.icap.transaction.AbstractTransaction
- All Implemented Interfaces:
TransactionContext,TransactionIdentifier,Transaction
- Direct Known Subclasses:
IcapTransaction
public abstract class AbstractTransaction
extends Object
implements Transaction, TransactionIdentifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblock()protected abstract voiddoSetHttpRequest(io.netty.handler.codec.http.FullHttpRequest httpRequest) protected abstract voiddoSetHttpResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) Returns the base URL from which the ControlBar iframe, icons and XMLHttpRequests are loaded.Returns the nonce that can be used to allow the injected ControlBar script in the Content-Security-Policy of the response.getUrl()booleanbooleanbooleanbooleanbooleanbooleanvoidvoidvoidsetBaseUrl(String baseUrl) voidsetComplete(boolean complete) voidsetContent(StringBuilder content) voidsetContentChanged(boolean contentChanged) voidsetContentEncoding(ContentEncoding contentEncoding) voidsetControlBarUrl(String controlBarUrl) Sets the base URL from which the ControlBar iframe, icons and XMLHttpRequests are loaded.voidsetCspNonce(String cspNonce) Sets the nonce that can be used to allow the injected ControlBar script in the Content-Security-Policy of the response.voidsetDecision(Decision decision) voidsetFilterResult(FilterResult filterResult) voidsetHeadersChanged(boolean headersChanged) voidsetInjections(Injections injections) voidsetPageContext(PageContext pageContext) voidsetRedirectTarget(String redirectTarget) voidsetRequest(io.netty.handler.codec.http.FullHttpRequest httpRequest) voidsetResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) This method does not only set the http response object - it will make the whole transaction a response transaction, even if it was a request transaction, before!voidsetSession(Session session) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eblocker.server.icap.transaction.Transaction
getRequest, getResponse, isPreviewMethods inherited from interface org.eblocker.server.common.transaction.TransactionIdentifier
getOriginalClientIP
-
Field Details
-
contentChanged
protected boolean contentChanged -
headersChanged
protected boolean headersChanged
-
-
Constructor Details
-
AbstractTransaction
public AbstractTransaction(boolean isRequest, boolean isResponse)
-
-
Method Details
-
getSessionId
- Specified by:
getSessionIdin interfaceTransactionContext
-
getSession
- Specified by:
getSessionin interfaceTransaction
-
setSession
- Specified by:
setSessionin interfaceTransaction
-
getUrl
- Specified by:
getUrlin interfaceTransactionContext
-
getReferrer
- Specified by:
getReferrerin interfaceTransactionContext
-
getAccept
- Specified by:
getAcceptin interfaceTransactionContext
-
getUserAgent
- Specified by:
getUserAgentin interfaceTransactionIdentifier
-
getDomain
- Specified by:
getDomainin interfaceTransactionContext
-
getReferrerHostname
- Specified by:
getReferrerHostnamein interfaceTransactionContext
-
isRequest
public boolean isRequest()- Specified by:
isRequestin interfaceTransaction
-
isResponse
public boolean isResponse()- Specified by:
isResponsein interfaceTransaction
-
getUserReference
- Specified by:
getUserReferencein interfaceTransaction
-
doSetHttpResponse
protected abstract void doSetHttpResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) -
doSetHttpRequest
protected abstract void doSetHttpRequest(io.netty.handler.codec.http.FullHttpRequest httpRequest) -
setRequest
public void setRequest(io.netty.handler.codec.http.FullHttpRequest httpRequest) - Specified by:
setRequestin interfaceTransaction
-
setResponse
public void setResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) Description copied from interface:TransactionThis method does not only set the http response object - it will make the whole transaction a response transaction, even if it was a request transaction, before!- Specified by:
setResponsein interfaceTransaction
-
getContentType
- Specified by:
getContentTypein interfaceTransaction
-
isContentChanged
public boolean isContentChanged()- Specified by:
isContentChangedin interfaceTransaction
-
setContentChanged
public void setContentChanged(boolean contentChanged) - Specified by:
setContentChangedin interfaceTransaction
-
isHeadersChanged
public boolean isHeadersChanged()- Specified by:
isHeadersChangedin interfaceTransaction
-
setHeadersChanged
public void setHeadersChanged(boolean headersChanged) - Specified by:
setHeadersChangedin interfaceTransaction
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfaceTransaction
-
setComplete
public void setComplete(boolean complete) - Specified by:
setCompletein interfaceTransaction
-
block
public void block()- Specified by:
blockin interfaceTransaction
-
noContent
public void noContent()- Specified by:
noContentin interfaceTransaction
-
redirect
- Specified by:
redirectin interfaceTransaction
-
getRedirectTarget
- Specified by:
getRedirectTargetin interfaceTransactionContext
-
setRedirectTarget
- Specified by:
setRedirectTargetin interfaceTransaction
-
getDecision
- Specified by:
getDecisionin interfaceTransactionContext
-
setDecision
- Specified by:
setDecisionin interfaceTransaction
-
isThirdParty
public boolean isThirdParty()- Specified by:
isThirdPartyin interfaceTransactionContext
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceTransaction
-
setBaseUrl
- Specified by:
setBaseUrlin interfaceTransaction
-
getFilterResult
- Specified by:
getFilterResultin interfaceTransaction
-
setFilterResult
- Specified by:
setFilterResultin interfaceTransaction
-
getPageContext
- Specified by:
getPageContextin interfaceTransaction
-
setPageContext
- Specified by:
setPageContextin interfaceTransaction
-
getInjections
- Specified by:
getInjectionsin interfaceTransaction
-
setInjections
- Specified by:
setInjectionsin interfaceTransaction
-
getContentEncoding
- Specified by:
getContentEncodingin interfaceTransaction
-
setContentEncoding
- Specified by:
setContentEncodingin interfaceTransaction
-
getContent
- Specified by:
getContentin interfaceTransaction
-
setContent
- Specified by:
setContentin interfaceTransaction
-
setControlBarUrl
Description copied from interface:TransactionSets the base URL from which the ControlBar iframe, icons and XMLHttpRequests are loaded. The ControlBar URL is only set when the ControlBar code should be injected into an HTML response.- Specified by:
setControlBarUrlin interfaceTransaction
-
getControlBarUrl
Description copied from interface:TransactionReturns the base URL from which the ControlBar iframe, icons and XMLHttpRequests are loaded.- Specified by:
getControlBarUrlin interfaceTransaction- Returns:
- ControlBar base URL or null if the ControlBar should not be injected.
-
setCspNonce
Description copied from interface:TransactionSets the nonce that can be used to allow the injected ControlBar script in the Content-Security-Policy of the response. The nonce is only set when the ControlBar code should be injected into an HTML response.- Specified by:
setCspNoncein interfaceTransaction
-
getCspNonce
Description copied from interface:TransactionReturns the nonce that can be used to allow the injected ControlBar script in the Content-Security-Policy of the response.- Specified by:
getCspNoncein interfaceTransaction- Returns:
- CSP nonce or null if the ControlBar should not be injected.
-