1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.mail.internal.thread

File AbstractMailQueueItem.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
10
6
1
85
43
6
0.6
1.67
6
1

Classes

Class Line # Actions
AbstractMailQueueItem 35 10 0% 6 2
0.87587.5%
 

Contributing tests

This file is covered by 12 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.mail.internal.thread;
21   
22    import javax.mail.Session;
23   
24    import org.apache.commons.lang3.builder.ToStringBuilder;
25    import org.xwiki.mail.MailListener;
26    import org.xwiki.text.XWikiToStringBuilder;
27   
28    /**
29    * Represents a Mail messages placed on the queue for processing. Extending classes define how to reference the mail
30    * message itself.
31    *
32    * @version $Id: 758946f2deb9c5991c0de7477e048290d71a2b44 $
33    * @since 6.4
34    */
 
35    public abstract class AbstractMailQueueItem implements MailQueueItem
36    {
37    private Session session;
38   
39    private MailListener listener;
40   
41    private String batchId;
42   
43    /**
44    * @param session see {@link #getSession()}
45    * @param listener see {@link #getListener()}
46    * @param batchId see {@link #getBatchId()}
47    */
 
48  69 toggle public AbstractMailQueueItem(Session session, MailListener listener, String batchId)
49    {
50  69 this.session = session;
51  69 this.listener = listener;
52  69 this.batchId = batchId;
53    }
54   
 
55  73 toggle @Override
56    public Session getSession()
57    {
58  73 return this.session;
59    }
60   
 
61  88 toggle @Override
62    public MailListener getListener()
63    {
64  88 return this.listener;
65    }
66   
 
67  0 toggle @Override
68    public String toString()
69    {
70  0 return prepareToString().toString();
71    }
72   
 
73  2 toggle protected ToStringBuilder prepareToString()
74    {
75  2 ToStringBuilder builder = new XWikiToStringBuilder(this);
76  2 builder.append("batchId", getBatchId());
77  2 return builder;
78    }
79   
 
80  105 toggle @Override
81    public String getBatchId()
82    {
83  105 return this.batchId;
84    }
85    }