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.service.ApplicationService;
37 import fr.paris.lutece.portal.service.rbac.RBACResource;
38 import fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource;
39
40 public class Application implements AdminWorkgroupResource, RBACResource
41 {
42 public static final String RESOURCE_TYPE = "DEPLOYMENT_APPLICATION";
43 private int _nIdApplication;
44 private String _strCode;
45 private String _strName;
46 private String _strWebappName;
47 private String _strArtifactId;
48 private String _strUrlRepo;
49 private String _strRepoType;
50 private String _strWorkgroup;
51
52 public void setIdApplication( int _nIdApplication )
53 {
54 this._nIdApplication = _nIdApplication;
55 }
56
57 public int getIdApplication( )
58 {
59 return _nIdApplication;
60 }
61
62 public String getCode( )
63 {
64 return _strCode;
65 }
66
67 public void setCode( String strCode )
68 {
69 _strCode = strCode;
70 }
71
72 public String getName( )
73 {
74 return _strName;
75 }
76
77 public void setName( String strName )
78 {
79 _strName = strName;
80 }
81
82 public String getWebAppName( )
83 {
84 return _strWebappName;
85 }
86
87 public void setWebAppName( String strName )
88 {
89 _strWebappName = strName;
90 }
91
92 public String getWorkgroup( )
93 {
94 return _strWorkgroup;
95 }
96
97 public void setWorkgroup( String workGroup )
98 {
99 _strWorkgroup = workGroup;
100 }
101
102 @Override
103 public String getResourceTypeCode( )
104 {
105 // TODO Auto-generated method stub
106 return RESOURCE_TYPE;
107 }
108
109 @Override
110 public String getResourceId( )
111 {
112
113 return Integer.toString( getIdApplication( ) );
114 }
115
116 /**
117 * Get the URL of the repo
118 *
119 * @return the URL of the repo
120 */
121 public String getUrlRepo( )
122 {
123 return _strUrlRepo;
124 }
125
126 /**
127 * Set the URL of the repo
128 *
129 * @param strUrlRepo
130 * the Url of the Repo
131 */
132 public void setUrlRepo( String strUrlRepo )
133 {
134 _strUrlRepo = strUrlRepo;
135 }
136
137 /**
138 * Get the repo type of the application
139 *
140 * @return the repo type
141 */
142 public String getRepoType( )
143 {
144 return _strRepoType;
145 }
146
147 /**
148 * Set the repo type of the application
149 *
150 * @param strRepoType
151 * the repo type
152 */
153 public void setRepoType( String strRepoType )
154 {
155 _strRepoType = strRepoType;
156 }
157
158 /**
159 * Get the artifact id of the application
160 *
161 * @return the artifact id of the application
162 */
163 public String getArtifactId( )
164 {
165 return _strArtifactId;
166 }
167
168 /**
169 * Set the artifact if of the application
170 *
171 * @param strArtifactId
172 * the artifact id of the application
173 */
174 public void setArtifactId( String strArtifactId )
175 {
176 this._strArtifactId = strArtifactId;
177 }
178
179 /**
180 * Check if the application has a private repo
181 *
182 * @return true if the application has a private repo, false otherwise
183 */
184 public boolean hasPrivateRepo( )
185 {
186 return ApplicationService.isPrivateRepo( this );
187 }
188
189 }