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

File DistributionManager.java

 

Code metrics

0
0
0
2
168
37
0
-
-
0
-

Classes

Class Line # Actions
DistributionManager 36 0 - 0 0
-1.0 -
DistributionManager.DistributionState 41 0 - 0 0
-1.0 -
 

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.extension.distribution.internal;
21   
22    import org.xwiki.component.annotation.Role;
23    import org.xwiki.extension.CoreExtension;
24    import org.xwiki.extension.ExtensionId;
25    import org.xwiki.extension.distribution.internal.job.DistributionJob;
26    import org.xwiki.extension.distribution.internal.job.FarmDistributionJob;
27    import org.xwiki.extension.distribution.internal.job.FarmDistributionJobStatus;
28    import org.xwiki.extension.distribution.internal.job.WikiDistributionJob;
29    import org.xwiki.extension.distribution.internal.job.WikiDistributionJobStatus;
30   
31    /**
32    * @version $Id: ab1caed96bb756bbc781bcde56294053a35bb5f6 $
33    * @since 4.2M3
34    */
35    @Role
 
36    public interface DistributionManager
37    {
38    /**
39    * The possible distribution states.
40    */
 
41    enum DistributionState
42    {
43    /** The distribution did not changed. */
44    SAME,
45   
46    /** No distribution information can be found. */
47    NONE,
48   
49    /**
50    * No previous state.
51    */
52    NEW,
53   
54    /**
55    * Previous state is an older version of the same distribution.
56    */
57    UPGRADE,
58   
59    /**
60    * Previous state is a newer version of the same distribution.
61    */
62    DOWNGRADE,
63   
64    /**
65    * Previous state is a different distribution.
66    */
67    DIFFERENT
68    }
69   
70    /**
71    * @return the current distribution state for the farm
72    * @since 5.0RC1
73    */
74    DistributionState getFarmDistributionState();
75   
76    /**
77    * @param wiki the wiki for which to get the distribution state
78    * @return the current distribution state for the passed wiki
79    * @since 5.0RC1
80    */
81    DistributionState getWikiDistributionState(String wiki);
82   
83    /**
84    * @return the extension that defines the current distribution
85    */
86    CoreExtension getDistributionExtension();
87   
88    /**
89    * @return the recommended user interface for main wikis
90    * @since 5.0RC1
91    */
92    ExtensionId getMainUIExtensionId();
93   
94    /**
95    * @return the recommended user interface for sub wikis
96    * @since 5.0RC1
97    */
98    ExtensionId getWikiUIExtensionId();
99   
100    /**
101    * @return the previous status of the distribution job (e.g. from last time the distribution was upgraded)
102    * @since 5.0RC1
103    */
104    FarmDistributionJobStatus getPreviousFarmJobStatus();
105   
106    /**
107    * @param wiki the wiki form which to get the distribution status
108    * @return the previous status of the distribution job (e.g. from last time the distribution was upgraded)
109    * @since 5.0RC1
110    */
111    WikiDistributionJobStatus getPreviousWikiJobStatus(String wiki);
112   
113    /**
114    * @param wiki the wiki for which to delete the status
115    * @since 5.1
116    */
117    void deletePreviousWikiJobStatus(String wiki);
118   
119    /**
120    * Copy the wiki distribution status from one wiki to another.
121    *
122    * @param sourceWiki the source wiki
123    * @param targetWiki the target wiki
124    * @since 5.1
125    */
126    void copyPreviousWikiJobStatus(String sourceWiki, String targetWiki);
127   
128    /**
129    * Starts the distribution job.
130    *
131    * @return the distribution job object that can be used to get information like the job status
132    * @since 5.0RC1
133    */
134    FarmDistributionJob startFarmJob();
135   
136    /**
137    * Starts the distribution job.
138    *
139    * @param wiki the wiki associated to the distribution wyzard
140    * @return the distribution job object that can be used to get information like the job status
141    * @since 5.0RC1
142    */
143    WikiDistributionJob startWikiJob(String wiki);
144   
145    /**
146    * @return the distribution job object that can be used to get information like the job status
147    * @since 5.0RC1
148    */
149    FarmDistributionJob getFarmJob();
150   
151    /**
152    * @param wiki the wiki for which to get the job
153    * @return the distribution job object that can be used to get information like the job status
154    * @since 5.0RC1
155    */
156    WikiDistributionJob getWikiJob(String wiki);
157   
158    /**
159    * @return the current distribution job
160    * @since 5.0RC1
161    */
162    DistributionJob getCurrentDistributionJob();
163   
164    /**
165    * @return true if it's allowed to display the Distribution Wizard in the current context
166    */
167    boolean canDisplayDistributionWizard();
168    }