1 /**
2 * The MIT License
3 *
4 * Copyright 2006-2012 The Codehaus.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
7 * this software and associated documentation files (the "Software"), to deal in
8 * the Software without restriction, including without limitation the rights to
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is furnished to do
11 * so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24 package org.codehaus.mojo.appassembler.daemon;
25
26 import java.io.File;
27
28 import org.apache.maven.artifact.repository.ArtifactRepository;
29 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
30 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
31 import org.apache.maven.project.MavenProject;
32 import org.codehaus.mojo.appassembler.model.Daemon;
33
34 /**
35 * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
36 * @version $Id: DaemonGenerationRequest.java 16492 2012-04-29 18:26:21Z khmarbaise $
37 */
38 public class DaemonGenerationRequest
39 {
40 private String platform;
41
42 private File stubDescriptor;
43
44 // TODO: what is the difference?
45 private Daemon stubDaemon;
46
47 private Daemon daemon;
48
49 private File outputDirectory;
50
51 private String binFolder;
52
53 private MavenProject mavenProject;
54
55 private ArtifactRepository localRepository;
56
57 private ArtifactRepositoryLayout repositoryLayout = new DefaultRepositoryLayout ( );
58
59 /**
60 * The constructor for the request.
61 */
62 public DaemonGenerationRequest ( )
63 {
64 }
65
66 /**
67 * Request with the given parameters.
68 *
69 * @param daemon
70 * The Daemon to use.
71 * @param project
72 * The Maven Project
73 * @param localRepository
74 * The local repository.
75 * @param outputDir
76 * The output directory.
77 * @param binFolder
78 * The binary folder.
79 */
80 public DaemonGenerationRequest ( Daemon daemon, MavenProject project, ArtifactRepository localRepository,
81 File outputDir, String binFolder )
82 {
83 this.daemon = daemon;
84
85 this.mavenProject = project;
86
87 this.localRepository = localRepository;
88
89 this.outputDirectory = outputDir;
90
91 this.binFolder = binFolder;
92 }
93
94 /**
95 * Get the Plaform.
96 *
97 * @return the Platform.
98 */
99 public String getPlatform ()
100 {
101 return platform;
102 }
103
104 /**
105 * @param platform
106 * Set the platform.
107 */
108 public void setPlatform ( String platform )
109 {
110 this.platform = platform;
111 }
112
113 /**
114 * Get the StubDescriptor
115 * FIXME: What for is this needed?
116 *
117 * @return The Stub Descriptor file.
118 */
119 public File getStubDescriptor ()
120 {
121 return stubDescriptor;
122 }
123
124 /**
125 * Set the StubDescriptor.
126 * FIXME: What for is this needed?
127 *
128 * @param stubDescriptor The File instance for the descriptor.
129 */
130 public void setStubDescriptor ( File stubDescriptor )
131 {
132 this.stubDescriptor = stubDescriptor;
133 }
134
135 /**
136 * Get the StubDaemon
137 * FIXME: Is this needed?
138 *
139 * @return The set stub Daemon
140 */
141 public Daemon getStubDaemon ()
142 {
143 return stubDaemon;
144 }
145
146 /**
147 * Set the StubDaemon.
148 * FIXME: Is this needed?
149 *
150 * @param stubDaemon
151 * This will be set.
152 */
153 public void setStubDaemon ( Daemon stubDaemon )
154 {
155 this.stubDaemon = stubDaemon;
156 }
157
158 /**
159 * Get the Daemon of the current request.
160 *
161 * @return The Daemon instance.
162 */
163 public Daemon getDaemon ()
164 {
165 return daemon;
166 }
167
168 /**
169 * Set the daemon.
170 *
171 * @param daemon Instance of a Daemon.
172 */
173 public void setDaemon ( Daemon daemon )
174 {
175 this.daemon = daemon;
176 }
177
178 /**
179 * Get the current outputDirectory.
180 *
181 * @return File instance of the current outputDirectory.
182 */
183 public File getOutputDirectory ()
184 {
185 return outputDirectory;
186 }
187
188 /**
189 * Set the current output directory.
190 *
191 * @param outputDirectory The output directory as a File.
192 */
193 public void setOutputDirectory ( File outputDirectory )
194 {
195 this.outputDirectory = outputDirectory;
196 }
197
198 /**
199 * Get the use MavenProject.
200 *
201 * @return MavenProject instance.
202 */
203 public MavenProject getMavenProject ()
204 {
205 return mavenProject;
206 }
207
208 /**
209 * Set the Maven Project.
210 *
211 * @param mavenProject
212 * instance to be set.
213 */
214 public void setMavenProject ( MavenProject mavenProject )
215 {
216 this.mavenProject = mavenProject;
217 }
218
219 /**
220 * Get the local repository.
221 *
222 * @return Instance of the ArtifactRepository.
223 */
224 public ArtifactRepository getLocalRepository ()
225 {
226 return localRepository;
227 }
228
229 /**
230 * @param localRepository
231 * Set the local repositoy.
232 */
233 public void setLocalRepository ( ArtifactRepository localRepository )
234 {
235 this.localRepository = localRepository;
236 }
237
238 /**
239 * @return The current repository layout.
240 */
241 public ArtifactRepositoryLayout getRepositoryLayout ()
242 {
243 return repositoryLayout;
244 }
245
246 /**
247 * Set the current repository layout.
248 *
249 * @param repositoryLayout
250 * The repositoryLayout which will be set.
251 */
252 public void setRepositoryLayout ( ArtifactRepositoryLayout repositoryLayout )
253 {
254 this.repositoryLayout = repositoryLayout;
255 }
256
257 /**
258 * Get the current binary folder.
259 *
260 * @return the setting of the binary folder.
261 */
262 public String getBinFolder ()
263 {
264 return binFolder;
265 }
266
267 /**
268 * Set the binary folder.
269 *
270 * @param binFolder The folder.
271 */
272 public void setBinFolder ( String binFolder )
273 {
274 this.binFolder = binFolder;
275 }
276
277 }