1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.store.wiki.internal.query; |
21 |
|
|
22 |
|
import java.math.BigInteger; |
23 |
|
import java.util.List; |
24 |
|
|
25 |
|
import org.xwiki.crypto.BinaryStringEncoder; |
26 |
|
import org.xwiki.crypto.pkix.params.PrincipalIndentifier; |
27 |
|
import org.xwiki.crypto.store.CertificateStoreException; |
28 |
|
import org.xwiki.crypto.store.wiki.internal.X509CertificateWikiStore; |
29 |
|
import org.xwiki.model.reference.EntityReference; |
30 |
|
import org.xwiki.model.reference.EntityReferenceSerializer; |
31 |
|
import org.xwiki.query.QueryException; |
32 |
|
import org.xwiki.query.QueryManager; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
@version |
38 |
|
@since |
39 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
40 |
|
public abstract class AbstractX509IssuerAndSerialQuery extends AbstractX509StoreQuery |
41 |
|
{ |
42 |
|
private static final String ISSUER = "issuer"; |
43 |
|
|
44 |
|
private static final String SERIAL = "serial"; |
45 |
|
|
46 |
|
private static final String AND_OBJ = " and obj."; |
47 |
|
|
48 |
|
private static final String EQUAL = "=:"; |
49 |
|
|
50 |
|
private static final String WHERE_STATEMENT = |
51 |
|
AND_OBJ + X509CertificateWikiStore.CERTIFICATECLASS_PROP_ISSUER + EQUAL + ISSUER |
52 |
|
+ AND_OBJ + X509CertificateWikiStore.CERTIFICATECLASS_PROP_SERIAL + EQUAL + SERIAL; |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
@param |
58 |
|
@param |
59 |
|
@param |
60 |
|
@param |
61 |
|
@param |
62 |
|
@param |
63 |
|
@param |
64 |
|
@throws |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
10 |
public AbstractX509IssuerAndSerialQuery(EntityReference store, String select, String from, String where,... |
67 |
|
BinaryStringEncoder encoder, QueryManager queryManager, EntityReferenceSerializer<String> serializer) |
68 |
|
throws CertificateStoreException |
69 |
|
{ |
70 |
10 |
super(store, select, from, WHERE_STATEMENT + where, encoder, queryManager, serializer); |
71 |
|
} |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
@param |
77 |
|
@param |
78 |
|
@return |
79 |
|
@throws |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
6 |
protected <T> List<T> execute(PrincipalIndentifier issuer, BigInteger serial) throws QueryException... |
82 |
|
{ |
83 |
6 |
return getQuery().bindValue(ISSUER, issuer.getName()).bindValue(SERIAL, serial.toString()).execute(); |
84 |
|
} |
85 |
|
|
86 |
|
} |