1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.job.internal

File DefaultJobStatusStorage.java

 

Coverage histogram

../../../../img/srcFileCovDistChart0.png
86% of files have more coverage

Code metrics

4
9
6
1
88
50
8
0.89
1.5
6
1.33

Classes

Class Line # Actions
DefaultJobStatusStorage 42 9 0% 8 19
0.00%
 

Contributing tests

No tests hitting this source file were found.

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.job.internal;
21   
22    import java.util.Arrays;
23    import java.util.List;
24   
25    import javax.inject.Inject;
26    import javax.inject.Singleton;
27   
28    import org.xwiki.component.annotation.Component;
29    import org.xwiki.job.JobStatusStore;
30    import org.xwiki.job.event.status.JobStatus;
31   
32    /**
33    * Default implementation of {@link JobStatusStorage}.
34    *
35    * @version $Id: 1ddec4c7a2290ec1a06028888c31c8aa57bee750 $
36    * @since 4.0M1
37    * @deprecated since 6.1M2, use {@link org.xwiki.job.internal.DefaultJobStatusStore} instead
38    */
39    @Component
40    @Singleton
41    @Deprecated
 
42    public class DefaultJobStatusStorage implements JobStatusStorage
43    {
44    @Inject
45    private JobStatusStore store;
46   
 
47  0 toggle @Override
48    public JobStatus getJobStatus(String id)
49    {
50  0 return getJobStatus(id != null ? Arrays.asList(id) : (List<String>) null);
51    }
52   
 
53  0 toggle @Override
54    public JobStatus getJobStatus(List<String> id)
55    {
56  0 return this.store.getJobStatus(id);
57    }
58   
 
59  0 toggle @Override
60    public void store(JobStatus status)
61    {
62  0 this.store.store(status);
63    }
64   
 
65  0 toggle @Override
66    public void storeAsync(JobStatus status)
67    {
68  0 this.store.storeAsync(status);
69    }
70   
 
71  0 toggle @Override
72    public JobStatus remove(String id)
73    {
74  0 return remove(Arrays.asList(id));
75    }
76   
 
77  0 toggle @Override
78    public JobStatus remove(List<String> id)
79    {
80  0 JobStatus status = this.store.getJobStatus(id);
81   
82  0 if (status != null) {
83  0 this.store.remove(id);
84    }
85   
86  0 return status;
87    }
88    }