Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
WikiInitializerRequest | 34 | 6 | 0% | 4 | 2 |
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 com.xpn.xwiki.internal; | |
21 | ||
22 | import java.util.Arrays; | |
23 | import java.util.List; | |
24 | ||
25 | import org.xwiki.job.AbstractRequest; | |
26 | import org.xwiki.job.Request; | |
27 | ||
28 | /** | |
29 | * Request to use with {@link WikiInitializerJob}. | |
30 | * | |
31 | * @version $Id: de4d7e8fe06869f184d054a013fd99546a0e78ce $ | |
32 | * @since 8.4RC1 | |
33 | */ | |
34 | public class WikiInitializerRequest extends AbstractRequest | |
35 | { | |
36 | private String wikiId; | |
37 | ||
38 | /** | |
39 | * @param wikiId the identifier of the wiki to initialize | |
40 | */ | |
41 | 32 | public WikiInitializerRequest(String wikiId) |
42 | { | |
43 | 32 | setId(toJobId(wikiId)); |
44 | 32 | setInteractive(false); |
45 | ||
46 | 32 | this.wikiId = wikiId; |
47 | } | |
48 | ||
49 | /** | |
50 | * @param request the request to copy | |
51 | */ | |
52 | 0 | public WikiInitializerRequest(Request request) |
53 | { | |
54 | 0 | super(request); |
55 | } | |
56 | ||
57 | /** | |
58 | * @param wikiId the identifier of the wiki | |
59 | * @return the Job id corresponding to the passed wiki identifier | |
60 | */ | |
61 | 32 | public static List<String> toJobId(String wikiId) |
62 | { | |
63 | 32 | return Arrays.asList("initialization", "wiki", wikiId); |
64 | } | |
65 | ||
66 | /** | |
67 | * @return The identifier of the wiki to initialize | |
68 | */ | |
69 | 32 | public String getWikiId() |
70 | { | |
71 | 32 | return this.wikiId; |
72 | } | |
73 | } |