1
1
package org .domainrobot .sdk .client .clients ;
2
2
3
- import java .io .IOException ;
4
3
import java .util .Map ;
5
4
6
5
import org .domainrobot .sdk .models .DomainrobotApiException ;
@@ -23,22 +22,28 @@ public class CertificateClient extends AbstractClient {
23
22
24
23
RestTemplate template ;
25
24
26
- public CertificateClient (String userName , String context , String password , String baseUrl , String version ) {
25
+ public CertificateClient (String userName , String context , String password , String baseUrl , String version ,
26
+ RestTemplate template ) {
27
27
this .userName = userName ;
28
28
this .context = context ;
29
29
this .password = password ;
30
30
this .baseUrl = baseUrl ;
31
31
this .version = version ;
32
- this .template = new RestTemplate () ;
32
+ this .template = template ;
33
33
}
34
34
35
35
/**
36
36
*
37
- * @return
38
- * @throws IOException
37
+ * Orders a certificate in realtime. The prepareOrder tasks should be called
38
+ * before to generate the necessary DCV data. <br>
39
+ * <br>
40
+ * <b>Note:</b> This works only for certain DV certificate products and dcv
41
+ * methods.
42
+ *
43
+ * @return Certificate
44
+ * @throws DomainrobotApiException
39
45
*/
40
- public Certificate realtime (Certificate body , Map <String , String > customHeaders )
41
- throws DomainrobotApiException , IOException {
46
+ public Certificate realtime (Certificate body , Map <String , String > customHeaders ) throws DomainrobotApiException {
42
47
RequestEntity <Certificate > request = buildRequestEntity (body , HttpMethod .POST ,
43
48
baseUrl + "/certificate/realtime" , customHeaders );
44
49
ResponseEntity <JsonResponseDataCertificate > response = null ;
@@ -52,11 +57,21 @@ public Certificate realtime(Certificate body, Map<String, String> customHeaders)
52
57
53
58
/**
54
59
*
55
- * @return
56
- * @throws IOException
60
+ * Check the csr and generate DCV data for an order, renew and reissue. This
61
+ * should be called everytime before the following tasks :
62
+ * <ul>
63
+ * <li>realtime</li>
64
+ * <li>create</li>
65
+ * <li>reissue</li>
66
+ * <li>renew</li>
67
+ * </ul>
68
+ * <br>
69
+ *
70
+ * @return CertificateData
71
+ * @throws DomainrobotApiException
57
72
*/
58
73
public CertificateData prepareOrder (CertificateData body , Map <String , String > customHeaders )
59
- throws DomainrobotApiException , IOException {
74
+ throws DomainrobotApiException {
60
75
RequestEntity <CertificateData > request = buildRequestEntity (body , HttpMethod .POST ,
61
76
baseUrl + "/certificate/prepareOrder" , customHeaders );
62
77
ResponseEntity <JsonResponseDataCertificateData > response = null ;
0 commit comments