1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.mail.internal.factory.group; |
21 |
|
|
22 |
|
import java.util.Iterator; |
23 |
|
import java.util.Map; |
24 |
|
|
25 |
|
import javax.inject.Named; |
26 |
|
import javax.inject.Singleton; |
27 |
|
import javax.mail.MessagingException; |
28 |
|
import javax.mail.internet.MimeMessage; |
29 |
|
|
30 |
|
import org.xwiki.component.annotation.Component; |
31 |
|
import org.xwiki.mail.MimeMessageFactory; |
32 |
|
import org.xwiki.mail.internal.factory.AbstractIteratorMimeMessageFactory; |
33 |
|
import org.xwiki.model.reference.DocumentReference; |
34 |
|
|
35 |
|
|
36 |
|
@link |
37 |
|
@link |
38 |
|
|
39 |
|
@version |
40 |
|
@since |
41 |
|
@deprecated |
42 |
|
|
43 |
|
@Component |
44 |
|
@Named("group") |
45 |
|
@Singleton |
46 |
|
@Deprecated |
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 1 |
Complexity Density: 0.17 |
|
47 |
|
public class GroupMimeMessageFactory extends AbstractIteratorMimeMessageFactory |
48 |
|
{ |
49 |
|
private static final String HINT = "hint"; |
50 |
|
|
51 |
|
private static final String SOURCE = "source"; |
52 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
53 |
4 |
@Override... |
54 |
|
public Iterator<MimeMessage> createMessage(Object groupReferenceObject, Map<String, Object> parameters) |
55 |
|
throws MessagingException |
56 |
|
{ |
57 |
4 |
DocumentReference groupReference = getTypedSource(groupReferenceObject, DocumentReference.class); |
58 |
|
|
59 |
|
|
60 |
4 |
validateParameters(parameters, HINT, SOURCE); |
61 |
|
|
62 |
|
|
63 |
1 |
String factoryHint = (String) parameters.get(HINT); |
64 |
|
|
65 |
1 |
MimeMessageFactory factory = getInternalMimeMessageFactory(factoryHint); |
66 |
|
|
67 |
0 |
GroupMimeMessageIterator iterator = new GroupMimeMessageIterator(groupReference, factory, parameters, |
68 |
|
this.componentManagerProvider.get()); |
69 |
0 |
return iterator; |
70 |
|
} |
71 |
|
|
72 |
|
} |