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 java.util.HashMap;
37  import java.util.List;
38  
39  import org.apache.commons.lang.StringUtils;
40  
41  import fr.paris.lutece.plugins.deployment.service.MavenService;
42  
43  public class ServerApplicationInstance
44  {
45      private String _strCode;
46      private String _strCodeEnvironment;
47      private String _strName;
48      private String _strI18nKeyName;
49  
50      // private String _strServerName;
51      private String _strFtpDirectoryTarget;
52      private String _strFtpDirectoryDump;
53      private FtpInfo _ftpInfo;
54      private String _strType;
55      private HashMap<String, String> _hashMavenProfile;
56      private String _strBeanName;
57      private Integer _nStatus;
58      private List<IAction> _listServerApplicationAction;
59  
60      public String getName( )
61      {
62          return _strName;
63      }
64  
65      public void setName( String strName )
66      {
67          _strName = strName;
68      }
69  
70      public String getI18nKeyName( )
71      {
72          return _strI18nKeyName;
73      }
74  
75      public void setI18nKeyName( String strName )
76      {
77          _strI18nKeyName = strName;
78      }
79  
80      public String getFtpDirectoryTarget( )
81      {
82          return _strFtpDirectoryTarget;
83      }
84  
85      public void setFtpDirectoryTarget( String strFtpDeployDirectoryTarget )
86      {
87          _strFtpDirectoryTarget = strFtpDeployDirectoryTarget;
88      }
89  
90      public void setCode( String _strCode )
91      {
92          this._strCode = _strCode;
93      }
94  
95      public String getCode( )
96      {
97          return _strCode;
98      }
99  
100     public void setCodeEnvironment( String _strCodeEnvironment )
101     {
102         this._strCodeEnvironment = _strCodeEnvironment;
103     }
104 
105     public String getCodeEnvironment( )
106     {
107         return _strCodeEnvironment;
108     }
109 
110     public void setFtpInfo( FtpInfo _ftpInfo )
111     {
112         this._ftpInfo = _ftpInfo;
113     }
114 
115     public FtpInfo getFtpInfo( )
116     {
117         return _ftpInfo;
118     }
119 
120     public String getMavenProfile( int nIdApplication )
121     {
122         String strMavenProfile = MavenService.getService( ).getMvnProfilSaved( Integer.toString( nIdApplication ), _strCodeEnvironment, _strCode );
123         if ( StringUtils.isEmpty( strMavenProfile ) )
124         {
125             if ( ( _strCodeEnvironment != null ) && ( _hashMavenProfile != null ) && _hashMavenProfile.containsKey( _strCodeEnvironment ) )
126             {
127                 return _hashMavenProfile.get( _strCodeEnvironment );
128             }
129         }
130 
131         return strMavenProfile;
132     }
133 
134     public void setType( String _strType )
135     {
136         this._strType = _strType;
137     }
138 
139     public String getType( )
140     {
141         return _strType;
142     }
143 
144     public void setHashMavenProfile( HashMap<String, String> _hashMavenProfile )
145     {
146         this._hashMavenProfile = _hashMavenProfile;
147     }
148 
149     public HashMap<String, String> getHashMavenProfile( )
150     {
151         return _hashMavenProfile;
152     }
153 
154     public String getBeanName( )
155     {
156         return _strBeanName;
157     }
158 
159     public void setBeanName( String strBeanName )
160     {
161         _strBeanName = strBeanName;
162     }
163 
164     public void setStatus( Integer _nStatus )
165     {
166         this._nStatus = _nStatus;
167     }
168 
169     public Integer getStatus( )
170     {
171         return _nStatus;
172     }
173 
174     public void setListServerApplicationAction( List<IAction> _listServerApplicationAction )
175     {
176         this._listServerApplicationAction = _listServerApplicationAction;
177     }
178 
179     public List<IAction> getListServerApplicationAction( )
180     {
181         return _listServerApplicationAction;
182     }
183 
184     public String getFtpDirectoryDump( )
185     {
186         return _strFtpDirectoryDump;
187     }
188 
189     public void setFtpDirectoryDump( String _strFtpDirectoryDumpFile )
190     {
191         this._strFtpDirectoryDump = _strFtpDirectoryDumpFile;
192     }
193 }