1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.extension.job

File InstallRequest.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
7
4
1
88
29
5
0.71
1.75
4
1.25

Classes

Class Line # Actions
InstallRequest 33 7 0% 5 1
0.923076992.3%
 

Contributing tests

This file is covered by 104 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.extension.job;
21   
22    import java.util.HashMap;
23    import java.util.Map;
24   
25    import org.xwiki.job.Request;
26   
27    /**
28    * Request used in {@link org.xwiki.extension.job.internal.InstallJob}.
29    *
30    * @version $Id: aacd2b1e10d111feb7155da86ba9d9ca61550e1c $
31    * @since 4.0M1
32    */
 
33    public class InstallRequest extends AbstractExtensionRequest
34    {
35    /**
36    * @see #getExtensionProperties()
37    */
38    public static final String PROPERTY_EXTENSION_PROPERTIES = "extension.properties";
39   
40    /**
41    * Serialization identifier.
42    */
43    private static final long serialVersionUID = 1L;
44   
45    /**
46    * Default constructor.
47    */
 
48  200 toggle public InstallRequest()
49    {
50    }
51   
52    /**
53    * @param request the request to copy
54    */
 
55  134 toggle public InstallRequest(Request request)
56    {
57  134 super(request);
58    }
59   
60    /**
61    * @return the custom extension properties to be set on each of the extensions that are going to be installed from
62    * this request
63    * @since 7.0M2
64    */
 
65  24 toggle public Map<String, Object> getExtensionProperties()
66    {
67  24 Map<String, Object> extensionProperties = getProperty(PROPERTY_EXTENSION_PROPERTIES);
68  24 if (extensionProperties == null) {
69  24 extensionProperties = new HashMap<>();
70  24 setProperty(PROPERTY_EXTENSION_PROPERTIES, extensionProperties);
71    }
72  24 return extensionProperties;
73    }
74   
75    /**
76    * Sets a custom extension property to be set on each of the extensions that are going to be installed from this
77    * request.
78    *
79    * @param key the property name
80    * @param value the new property value
81    * @return the previous property value
82    * @since 7.0M2
83    */
 
84  24 toggle public Object setExtensionProperty(String key, Object value)
85    {
86  24 return getExtensionProperties().put(key, value);
87    }
88    }