Package org.kuali.rice.ksb.messaging
Class KSBHttpInvokerRequestExecutor
java.lang.Object
org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor
org.kuali.rice.ksb.messaging.KSBHttpInvokerRequestExecutor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.remoting.httpinvoker.HttpInvokerRequestExecutor
- Direct Known Subclasses:
AuthenticationCommonsHttpInvokerRequestExecutor
public class KSBHttpInvokerRequestExecutor
extends org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor
At HttpInvokerRequestExecutor which is capable of digitally signing and verifying messages. It's capabilities
to execute the signing and verification can be turned on or off via an application constant.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
CONTENT_TYPE_SERIALIZED_OBJECT, ENCODING_GZIP, HTTP_HEADER_ACCEPT_ENCODING, HTTP_HEADER_ACCEPT_LANGUAGE, HTTP_HEADER_CONTENT_ENCODING, HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_METHOD_POST, logger -
Constructor Summary
ConstructorsConstructorDescriptionKSBHttpInvokerRequestExecutor(Boolean secure) KSBHttpInvokerRequestExecutor(org.apache.http.client.HttpClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionprotected DigitalSignatureServiceprotected JavaSecurityManagementServiceprotected InputStreamgetResponseBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.HttpResponse postMethod) Returns a wrapped InputStream which is responsible for verifying the digital signature on the response after all data has been read.protected booleanisSecure()protected voidsetRequestBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.client.methods.HttpPost httpPost, ByteArrayOutputStream baos) Signs the outgoing request by generating a digital signature from the bytes in the ByteArrayOutputStream and attaching the signature and our alias to the headers of the PostMethod.voidprotected voidsignRequest(org.apache.http.client.methods.HttpPost postMethod, ByteArrayOutputStream baos) Signs the request by adding headers to the PostMethod.protected voidvalidateResponse(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.HttpResponse response) Methods inherited from class org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor
createHttpPost, createRequestConfig, doExecuteRequest, executeHttpPost, getHttpClient, isGzipResponse, setConnectionRequestTimeout, setConnectTimeout, setHttpClient, setReadTimeoutMethods inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
createObjectInputStream, decorateInputStream, decorateOutputStream, doReadRemoteInvocationResult, doWriteRemoteInvocation, executeRequest, getBeanClassLoader, getByteArrayOutputStream, getContentType, isAcceptGzipEncoding, readRemoteInvocationResult, setAcceptGzipEncoding, setBeanClassLoader, setContentType, writeRemoteInvocation
-
Constructor Details
-
KSBHttpInvokerRequestExecutor
public KSBHttpInvokerRequestExecutor() -
KSBHttpInvokerRequestExecutor
-
KSBHttpInvokerRequestExecutor
public KSBHttpInvokerRequestExecutor(org.apache.http.client.HttpClient httpClient)
-
-
Method Details
-
setRequestBody
protected void setRequestBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.client.methods.HttpPost httpPost, ByteArrayOutputStream baos) throws IOException Signs the outgoing request by generating a digital signature from the bytes in the ByteArrayOutputStream and attaching the signature and our alias to the headers of the PostMethod.- Overrides:
setRequestBodyin classorg.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor- Throws:
IOException
-
getResponseBody
protected InputStream getResponseBody(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.HttpResponse postMethod) throws IOException Returns a wrapped InputStream which is responsible for verifying the digital signature on the response after all data has been read.- Overrides:
getResponseBodyin classorg.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor- Throws:
IOException
-
validateResponse
protected void validateResponse(org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration config, org.apache.http.HttpResponse response) throws HttpException - Overrides:
validateResponsein classorg.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor- Throws:
HttpException
-
signRequest
protected void signRequest(org.apache.http.client.methods.HttpPost postMethod, ByteArrayOutputStream baos) throws Exception Signs the request by adding headers to the PostMethod.- Throws:
Exception
-
isSecure
protected boolean isSecure() -
getSecure
-
setSecure
-
getDigitalSignatureService
-
getJavaSecurityManagementService
-