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.util.List; |
23 |
|
|
24 |
|
import org.xwiki.crypto.BinaryStringEncoder; |
25 |
|
import org.xwiki.crypto.pkix.params.PrincipalIndentifier; |
26 |
|
import org.xwiki.crypto.store.CertificateStoreException; |
27 |
|
import org.xwiki.crypto.store.wiki.internal.X509CertificateWikiStore; |
28 |
|
import org.xwiki.model.reference.EntityReference; |
29 |
|
import org.xwiki.model.reference.EntityReferenceSerializer; |
30 |
|
import org.xwiki.query.QueryException; |
31 |
|
import org.xwiki.query.QueryManager; |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@version |
37 |
|
@since |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
39 |
|
public abstract class AbstractX509SubjectQuery extends AbstractX509StoreQuery |
40 |
|
{ |
41 |
|
private static final String SUBJECT = "subject"; |
42 |
|
|
43 |
|
private static final String WHERE_STATEMENT = |
44 |
|
" and obj." + X509CertificateWikiStore.CERTIFICATECLASS_PROP_SUBJECT + "=:" + SUBJECT; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@param |
50 |
|
@param |
51 |
|
@param |
52 |
|
@param |
53 |
|
@param |
54 |
|
@param |
55 |
|
@param |
56 |
|
@throws |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
6 |
public AbstractX509SubjectQuery(EntityReference store, String select, String from, String where,... |
59 |
|
BinaryStringEncoder encoder, QueryManager queryManager, EntityReferenceSerializer<String> serializer) |
60 |
|
throws CertificateStoreException |
61 |
|
{ |
62 |
6 |
super(store, select, from, WHERE_STATEMENT + where, encoder, queryManager, serializer); |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@param |
69 |
|
@return |
70 |
|
@throws |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
2 |
protected <T> List<T> execute(PrincipalIndentifier subject) throws QueryException... |
73 |
|
{ |
74 |
2 |
return getQuery().bindValue(SUBJECT, subject.getName()).execute(); |
75 |
|
} |
76 |
|
|
77 |
|
} |