Class WebClient
java.lang.Object
software.xdev.bzst.dip.client.webclient.WebClient
- All Implemented Interfaces:
AutoCloseable
Helps to communicate with the BZST API.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabortSubmission(String dataTransferNumber) voidclose()closeSubmission(String dataTransferNumber) Requests the closing of the submission with the given dataTransferNumber.confirmTransfer(String transferNumber) Confirm the result protocolcreateAbortSubmissionRequest(String dataTransferNumber) createGetResultProtocolRequest(String dataTransferNumber) For every request an access token is requiredGets all data transfer numbers.Retrieval of the results logrequestTransferResult(String dataTransferNumber) Get the result protocoluploadMassData(String dataTransferNumber, String xmlString)
-
Field Details
-
DIP_MD
- See Also:
-
PATCH
- See Also:
-
OK_HTTP_STATUS_CODE
public static final int OK_HTTP_STATUS_CODE- See Also:
-
-
Constructor Details
-
WebClient
-
-
Method Details
-
getAccessToken
For every request an access token is required- Returns:
- Access Token as string
- Throws:
HttpStatusCodeNotExceptedException
-
getDataTransferNumber
- Returns:
- XML as string with data transfer numbers
- Throws:
HttpStatusCodeNotExceptedException
-
uploadMassData
public String uploadMassData(String dataTransferNumber, String xmlString) throws HttpStatusCodeNotExceptedException -
closeSubmission
Requests the closing of the submission with the given dataTransferNumber. -
requestResultLogs
Retrieval of the results log- Returns:
- String list with data transfer numbers
- Throws:
HttpStatusCodeNotExceptedExceptionIOException
-
createGetResultProtocolRequest
public HttpRequest createGetResultProtocolRequest(String dataTransferNumber) throws HttpStatusCodeNotExceptedException -
requestTransferResult
public BzstDipSingleTransferResult requestTransferResult(String dataTransferNumber) throws HttpStatusCodeNotExceptedException Get the result protocol- Returns:
- Returns complete HttpResponse
- Throws:
HttpStatusCodeNotExceptedException
-
confirmTransfer
public BzstDipSingleTransferResult confirmTransfer(String transferNumber) throws HttpStatusCodeNotExceptedException Confirm the result protocol -
createAbortSubmissionRequest
public HttpRequest createAbortSubmissionRequest(String dataTransferNumber) throws HttpStatusCodeNotExceptedException -
abortSubmission
-
readAndConfirmDataTransferNumbers
public BzstDipRequestStatusResult readAndConfirmDataTransferNumbers() throws HttpStatusCodeNotExceptedException, IOExceptionGets all data transfer numbers. Get the result protocol from a transfer number and confirm them if possible.- Returns:
- returns true if the method should be called later again because the result is not yet available
- Throws:
HttpStatusCodeNotExceptedExceptionIOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-