View Javadoc
1   /*
2    * Copyright (c) 2002-2017, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.deployment.business;
35  
36  import fr.paris.lutece.plugins.deployment.business.vcs.AbstractVCSUser;
37  import java.io.InputStream;
38  import java.io.Serializable;
39  import java.util.HashMap;
40  
41  public class WorkflowDeploySiteContext implements Serializable
42  {
43      /**
44       *
45       */
46      private static final long serialVersionUID = 1L;
47      public static final String WORKFLOW_RESOURCE_TYPE = "WORKFLOW_DEPLOY_SITE_CONTEXT";
48      private int _nId;
49      private int _nIdApplication;
50      private String _strSvnBaseSiteUrl;
51      private HashMap<String, String> _hashServerApplicationInstance;
52      private String _strCodeEnvironement;
53      private boolean _bDeployDevSite;
54      private String _strTagToDeploy;
55      private String _strTagName;
56      private String _strNextVersion;
57      private String _strTagVersion;
58      private CommandResult _commandResult;
59      private AbstractVCSUser _vcsUser;
60      private boolean _bDeployWar;
61      private boolean _bDeploySql;
62      private String _strDatabaseName;
63      private InputStream _scriptFileItem;
64      private String _scriptFileItemName;
65      private String _scriptFileSelected;
66      private boolean _bInitBdd;
67      private boolean _bInitAppContext;
68  
69      public int getId( )
70      {
71          return _nId;
72      }
73  
74      public void setId( int nId )
75      {
76          _nId = nId;
77      }
78  
79      public int getIdApplication( )
80      {
81          return _nIdApplication;
82      }
83  
84      public void setIdApplication( int nIdApplication )
85      {
86          this._nIdApplication = nIdApplication;
87      }
88  
89      public String getSvnBaseSiteUrl( )
90      {
91          return _strSvnBaseSiteUrl;
92      }
93  
94      public void setSvnBaseSiteUrl( String strSvnUrl )
95      {
96          _strSvnBaseSiteUrl = strSvnUrl;
97      }
98  
99      public void setCommandResult( CommandResult _commandResult )
100     {
101         this._commandResult = _commandResult;
102     }
103 
104     public CommandResult getCommandResult( )
105     {
106         return _commandResult;
107     }
108 
109     public void setNextVersion( String _strNextVersion )
110     {
111         this._strNextVersion = _strNextVersion;
112     }
113 
114     public String getNextVersion( )
115     {
116         return _strNextVersion;
117     }
118 
119     public void setTagVersion( String _strTagVersion )
120     {
121         this._strTagVersion = _strTagVersion;
122     }
123 
124     public String getTagVersion( )
125     {
126         return _strTagVersion;
127     }
128 
129     public String getCodeEnvironement( )
130     {
131         return _strCodeEnvironement;
132     }
133 
134     public void setCodeEnvironement( String strCodeEnvironement )
135     {
136         _strCodeEnvironement = strCodeEnvironement;
137     }
138 
139     public String getCodeServerInstance( String strType )
140     {
141         if ( _hashServerApplicationInstance != null )
142         {
143             return _hashServerApplicationInstance.get( strType );
144         }
145 
146         return null;
147     }
148 
149     public void setCodeServerInstance( String strCodeServerAppplicationInstance, String strType )
150     {
151         if ( _hashServerApplicationInstance == null )
152         {
153             _hashServerApplicationInstance = new HashMap<String, String>( );
154         }
155 
156         _hashServerApplicationInstance.put( strType, strCodeServerAppplicationInstance );
157     }
158 
159     /**
160      * Check if the dev version of the site should be deployed.
161      * 
162      * @return true if the dev version of the site should be deployed
163      */
164     public boolean isDeployDevSite( )
165     {
166         return _bDeployDevSite;
167     }
168 
169     /**
170      * Set the deploy dev site boolean
171      * 
172      * @param bDeployDevSite
173      *            the deploy dev site boolean
174      */
175     public void setDeployDevSite( boolean bDeployDevSite )
176     {
177         _bDeployDevSite = bDeployDevSite;
178     }
179 
180     public String getTagToDeploy( )
181     {
182         return _strTagToDeploy;
183     }
184 
185     public void setTagToDeploy( String strTagToDeploy )
186     {
187         _strTagToDeploy = strTagToDeploy;
188     }
189 
190     public String getTagName( )
191     {
192         return _strTagName;
193     }
194 
195     public void setTagName( String strTagName )
196     {
197         this._strTagName = strTagName;
198     }
199 
200     public void setDeployWar( boolean _bDeployWar )
201     {
202         this._bDeployWar = _bDeployWar;
203     }
204 
205     public boolean isDeployWar( )
206     {
207         return _bDeployWar;
208     }
209 
210     public boolean isDeploySql( )
211     {
212         return _bDeploySql;
213     }
214 
215     public void setDeploySql( boolean bDeploySql )
216     {
217         _bDeploySql = bDeploySql;
218     }
219 
220     public String getDatabaseName( )
221     {
222         return _strDatabaseName;
223     }
224 
225     public void setDatabaseName( String _strDatabaseName )
226     {
227         this._strDatabaseName = _strDatabaseName;
228     }
229 
230     public String getScriptFileItemName( )
231     {
232         return _scriptFileItemName;
233     }
234 
235     public void setScriptFileItemName( String _scriptFileItemName )
236     {
237         this._scriptFileItemName = _scriptFileItemName;
238     }
239 
240     public InputStream getScriptFileItem( )
241     {
242         return _scriptFileItem;
243     }
244 
245     public void setScriptFileItem( InputStream _scriptFileItem )
246     {
247         this._scriptFileItem = _scriptFileItem;
248     }
249 
250     public String getScriptFileSelected( )
251     {
252         return _scriptFileSelected;
253     }
254 
255     public void setScriptFileSelected( String _scriptFileSelected )
256     {
257         this._scriptFileSelected = _scriptFileSelected;
258     }
259 
260     public boolean isInitBdd( )
261     {
262         return _bInitBdd;
263     }
264 
265     public void setInitBdd( boolean _bInitBdd )
266     {
267         this._bInitBdd = _bInitBdd;
268     }
269 
270     public boolean isInitAppContext( )
271     {
272         return _bInitAppContext;
273     }
274 
275     public void setInitAppContext( boolean _bInitAppContext )
276     {
277         this._bInitAppContext = _bInitAppContext;
278     }
279 
280     /**
281      * Get the VCS user who is logged into the current workflow context
282      * 
283      * @return the VCS user
284      */
285     public AbstractVCSUser getVcsUser( )
286     {
287         return _vcsUser;
288     }
289 
290     /**
291      * Set the VCS user who is logged into the current workflow context
292      * 
293      * @param vcsUser
294      *            the VCSUser
295      */
296     public void setVcsUser( AbstractVCSUser vcsUser )
297     {
298         this._vcsUser = vcsUser;
299     }
300 
301 }