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

File InstallRequest.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
56% of files have more coverage

Code metrics

2
8
5
1
101
33
6
0.75
1.6
5
1.2

Classes

Class Line # Actions
InstallRequest 33 8 0% 6 3
0.880%
 

Contributing tests

This file is covered by 114 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: 54b4fabd65e09527bc6a3c87e1a5022ccde9fdc9 $
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  229 toggle public InstallRequest()
49    {
50    }
51   
52    /**
53    * @param request the request to copy
54    */
 
55  145 toggle public InstallRequest(Request request)
56    {
57  145 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  26 toggle public Map<String, Object> getExtensionProperties()
66    {
67  26 Map<String, Object> extensionProperties = getProperty(PROPERTY_EXTENSION_PROPERTIES);
68  26 if (extensionProperties == null) {
69  26 extensionProperties = new HashMap<>();
70  26 setProperty(PROPERTY_EXTENSION_PROPERTIES, extensionProperties);
71    }
72  26 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  26 toggle public Object setExtensionProperty(String key, Object value)
85    {
86  26 return getExtensionProperties().put(key, value);
87    }
88   
89    /**
90    * Sets custom extension properties to be set on each of the extensions that are going to be installed from this
91    * request.
92    *
93    * @param properties the properties to add to custom extension properties
94    * @see #setExtensionProperty(String, Object)
95    * @since 9.5RC1
96    */
 
97  0 toggle public void addExtensionProperties(Map<String, Object> properties)
98    {
99  0 getExtensionProperties().putAll(properties);
100    }
101    }