Package de.hybris.e2e.transport.cts.impl
Class SimpleCtsClient
java.lang.Object
de.hybris.e2e.transport.cts.impl.SimpleCtsClient
- All Implemented Interfaces:
CtsClient
Basic implementation of CTS+ client
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleCtsClient(ConfigurationHolder holder, CtsService service, String fileName) Creates @SimpleCtsClient instance -
Method Summary
Modifier and TypeMethodDescriptionAttaches uploaded file to given requestPrepare @CtsWsRequestFilter so that default request can be retrieved from export web serviceContacts export web service by sending configured @CtsWsRequestFilter and gets default request information like request idGets file handleGets request idprotected static byte[]handleBytesLeft(int bytesRead, byte[] bytes) Uploads filevoidsetRequestResponse(CtsWsRequestResponse response) Sets request responsevoidsetUploadResponse(CtsWsUploadResponse response) Sets upload responseSubmits requestfinal voidHandles whole web service flowprotected voidverifyReply(CtsWsReply reply, String phaseName) Verifies return codes
-
Constructor Details
-
SimpleCtsClient
Creates @SimpleCtsClient instance- Parameters:
holder- - @ConfigurationHolder instanceservice- - @CtsService instancefileName- - name of the file to be exported
-
-
Method Details
-
uploadFile
public final void uploadFile()Handles whole web service flow- Specified by:
uploadFilein interfaceCtsClient
-
setUploadResponse
Sets upload response- Specified by:
setUploadResponsein interfaceCtsClient- Parameters:
response- - @CtsWsUploadResponse instance
-
setRequestResponse
Sets request response- Specified by:
setRequestResponsein interfaceCtsClient- Parameters:
response- - @CtsWsRequestResponse instance
-
configureRequestFilter
Prepare @CtsWsRequestFilter so that default request can be retrieved from export web service- Specified by:
configureRequestFilterin interfaceCtsClient- Returns:
- configured @CtsWsRequestFilter
-
verifyReply
Verifies return codes- Parameters:
reply- - @CtsWsReply from a serverphaseName- -name of a phase of call sequence
-
getDefaultRequest
Contacts export web service by sending configured @CtsWsRequestFilter and gets default request information like request id- Specified by:
getDefaultRequestin interfaceCtsClient- Returns:
-
internalUploadFile
Uploads file- Specified by:
internalUploadFilein interfaceCtsClient- Returns:
-
handleBytesLeft
protected static byte[] handleBytesLeft(int bytesRead, byte[] bytes) - Parameters:
bytesRead-bytes-- Returns:
- byte[] - array of file's bytes left
-
attachToRequest
Description copied from interface:CtsClientAttaches uploaded file to given request- Specified by:
attachToRequestin interfaceCtsClient- Returns:
-
submitRequest
Submits request- Specified by:
submitRequestin interfaceCtsClient- Returns:
-
getRequestId
Gets request id- Returns:
- request id
-
getFileHandle
Gets file handle- Returns:
- file handle
-