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