Class DirectClient
- java.lang.Object
-
- no.digipost.signature.client.direct.DirectClient
-
public class DirectClient extends Object
-
-
Constructor Summary
Constructors Constructor Description DirectClient(ClientConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
confirm(DirectJobStatusResponse receivedStatusResponse)
Confirms that the status retrieved fromgetStatus(StatusReference)
orgetStatusChange()
is received.DirectJobResponse
create(DirectJob job)
void
deleteDocuments(DeleteDocumentsUrl deleteDocumentsUrl)
InputStream
getPAdES(PAdESReference pAdESReference)
DirectJobStatusResponse
getStatus(StatusReference statusReference)
Get the current status for the givenStatusReference
, which references the status for a specific job.DirectJobStatusResponse
getStatusChange()
If there is a job with an updatedstatus
, the returned object contains necessary information to act on the status change.DirectJobStatusResponse
getStatusChange(Sender sender)
If there is a job with an updatedstatus
, the returned object contains necessary information to act on the status change.InputStream
getXAdES(XAdESReference xAdESReference)
DirectSignerResponse
requestNewRedirectUrl(WithSignerUrl request)
-
-
-
Constructor Detail
-
DirectClient
public DirectClient(ClientConfiguration config)
-
-
Method Detail
-
create
public DirectJobResponse create(DirectJob job)
-
requestNewRedirectUrl
public DirectSignerResponse requestNewRedirectUrl(WithSignerUrl request)
-
getStatus
public DirectJobStatusResponse getStatus(StatusReference statusReference)
Get the current status for the givenStatusReference
, which references the status for a specific job. When processing of the status is complete (e.g. retrievingPAdES
and/orXAdES
documents for acompleted
job where all signers havesigned
their documents), the returned status must beconfirmed
.- Parameters:
statusReference
- the reference to the status of a specific job.- Returns:
- the
DirectJobStatusResponse
for the job referenced by the givenStatusReference
, nevernull
.
-
getStatusChange
public DirectJobStatusResponse getStatusChange()
If there is a job with an updatedstatus
, the returned object contains necessary information to act on the status change. The returned object can be queried using.is(
NO_CHANGES)
to determine if there has been a status change. When processing of the status change is complete, (e.g. retrievingPAdES
and/orXAdES
documents for acompleted
job where all signers havesigned
their documents, the returned status must beconfirmed
.Only jobs with
status retrieval method
set toPOLLING
will be returned.- Returns:
- the changed status for a job, or an instance indicating
no changes
, nevernull
.
-
getStatusChange
public DirectJobStatusResponse getStatusChange(Sender sender)
If there is a job with an updatedstatus
, the returned object contains necessary information to act on the status change. The returned object can be queried using.is(
NO_CHANGES)
to determine if there has been a status change. When processing of the status change is complete, (e.g. retrievingPAdES
and/orXAdES
documents for acompleted
job where all signers havesigned
their documents, the returned status must beconfirmed
.Only jobs with
status retrieval method
set toPOLLING
will be returned.- Returns:
- the changed status for a job, or an instance indicating
no changes
, nevernull
.
-
confirm
public void confirm(DirectJobStatusResponse receivedStatusResponse)
Confirms that the status retrieved fromgetStatus(StatusReference)
orgetStatusChange()
is received. If the confirmedDirectJobStatus
is a terminal status (i.e.completed
orfailed
), the Signature service may make the job's associated resources unavailable through the API when receiving the confirmation. Calling this method for a response with noConfirmationReference
has no effect.If the status is retrieved using
the polling method
, failing to confirm the received response may cause subsequent statuses for the same job to be reported as "changed", even though the status has not changed.- Parameters:
receivedStatusResponse
- the updated status retrieved fromgetStatus(StatusReference)
.
-
getXAdES
public InputStream getXAdES(XAdESReference xAdESReference)
-
getPAdES
public InputStream getPAdES(PAdESReference pAdESReference)
-
deleteDocuments
public void deleteDocuments(DeleteDocumentsUrl deleteDocumentsUrl)
-
-