Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / org.gvsig.installer / org.gvsig.installer.lib / org.gvsig.installer.lib.api / src / main / java / org / gvsig / installer / lib / api / PackageInfo.java @ 37822

History | View | Annotate | Download (8.33 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2010 {Prodevelop}   {Task}
26
 */
27

    
28
package org.gvsig.installer.lib.api;
29

    
30
import java.io.File;
31
import java.net.URL;
32
import java.util.List;
33

    
34
import org.gvsig.installer.lib.api.InstallerManager.ARCH;
35
import org.gvsig.installer.lib.api.InstallerManager.JVM;
36
import org.gvsig.installer.lib.api.InstallerManager.OS;
37
import org.gvsig.installer.lib.api.InstallerManager.STATE;
38
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException;
39
import org.gvsig.tools.lang.Cloneable;
40
import org.gvsig.tools.task.SimpleTaskStatus;
41

    
42
/**
43
 * Information of a package that is used on the installation process. This
44
 * information is composed by next fields: </br> <li>
45
 * <lu><b>Code</b>: unique identifier for the package.</lu> <lu><b>Name</b>:
46
 * name of the package.</lu> <lu><b>Description</b>: brief description of the
47
 * package functionality</lu> * <lu><b>Version</b>: number of version.</lu>
48
 * <lu><b>Build</b>: build number.</lu> <lu><b>State</b>: the state of the
49
 * package (testing, RC1...).</lu> <lu><b>Operating system</b>: the operating
50
 * system supported (lin, win, mac_10_6, ...).</lu> <lu><b>Architecture</b>: the
51
 * state of the package (testing, RC1, ...).</lu> <lu><b>JavaVM</b>: the minimum
52
 * java version supported (1.5, 1.6, ...).</lu> <lu><b>Is Official</b>: if the
53
 * package is official or if is a not official package.</lu> <lu><b>Type</b>:
54
 * package type (plugin, theme, translation...). Depending of this value a
55
 * different installation provider is selected to control the installation
56
 * process.</lu> <li>
57
 * 
58
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
59
 */
60
public interface PackageInfo extends Cloneable {
61

    
62
        /**
63
         * @return Gets the code of the package.
64
         */
65
        public String getCode();
66

    
67
        public void setCode(String code);
68

    
69
        public String getID();
70

    
71
        /**
72
         * @return Gets the name of the package.
73
         */
74
        public String getName();
75

    
76
        public void setName(String name);
77

    
78
        /**
79
         * @return Gets the description of the package.
80
         */
81
        public String getDescription();
82

    
83
        public void setDescription(String description);
84

    
85
        /**
86
         * @return Gets the version of the package.
87
         */
88
        public Version getVersion();
89

    
90
        public void setVersion(String version);
91

    
92
        public void setVersion(Version version);
93

    
94
        /**
95
         * @return Gets the build number of the package.
96
         */
97
        public int getBuild();
98

    
99
        public void setBuild(int build);
100

    
101
        /**
102
         * @return Gets the state of the package.
103
         * @see STATE
104
         */
105
        public String getState();
106

    
107
        /**
108
         * Sets the state of the package
109
         * 
110
         * @param state
111
         * @see STATE
112
         */
113
        public void setState(String state);
114

    
115
        /**
116
         * @return Gets if the package is official.
117
         */
118
        public boolean isOfficial();
119

    
120
        public void setOfficial(boolean official);
121

    
122
        /**
123
         * @return Gets the type of the package.
124
         */
125
        public String getType();
126

    
127
        public void setType(String type);
128

    
129
        /**
130
         * Returns the supported operating system.
131
         * 
132
         * @return the supported operating system
133
         * @see OS
134
         */
135
        public String getOperatingSystem();
136

    
137
        /**
138
         * Sets the supported operating system.
139
         * 
140
         * @param operatingSystem
141
         *            the supported operating system
142
         * @see OS
143
         */
144
        public void setOperatingSystem(String operatingSystem);
145

    
146
        /**
147
         * Returns the supported hardware architecture.
148
         * 
149
         * @return the supported hardware architecture
150
         * @see ARCH
151
         */
152
        public String getArchitecture();
153

    
154
        /**
155
         * Sets the supported hardware architecture.
156
         * 
157
         * @param architecture
158
         *            the supported hardware architecture
159
         * @see ARCH
160
         */
161
        public void setArchitecture(String architecture);
162

    
163
        /**
164
         * Returns the supported java vm version.
165
         * 
166
         * @return the supported java vm version
167
         * @see JVM
168
         */
169
        public String getJavaVM();
170

    
171
        /**
172
         * Sets the supported java vm version.
173
         * 
174
         * @param javaVM
175
         *            the supported java vm version
176
         * @see JVM
177
         */
178
        public void setJavaVM(String javaVM);
179

    
180
        /**
181
         * Returns the supported gvSIG version.
182
         * 
183
         * @return the supported gvSIG version
184
         */
185
        public String getGvSIGVersion();
186

    
187
        /**
188
         * Sets the supported gvSIG version.
189
         * 
190
         * @param gvSIGVersion
191
         *            the supported gvSIG version
192
         */
193
        public void setGvSIGVersion(String gvSIGVersion);
194

    
195
        /**
196
         * Returns the package bundle download {@link URL}.
197
         * 
198
         * May be null if there is no remote URL to download the bundle.
199
         * 
200
         * @return the package bundle download {@link URL}
201
         */
202
        public URL getDownloadURL();
203

    
204
        public String getDownloadURLAsString();
205

    
206
        // /**
207
        // * Returns the package bundle download {@link URL}.
208
        // *
209
        // * May be null if there is no remote URL to download the bundle.
210
        // *
211
        // * @return the package bundle download {@link URL}
212
        // */
213
        public URL getDownloadURL(URL baseURL);
214

    
215
        /**
216
         * Sets the package bundle download {@link URL}. Optional.
217
         * 
218
         * @param defaultURL
219
         *            the package bundle download {@link URL}
220
         */
221
        public void setDownloadURL(URL defaultURL);
222

    
223
        public void setDownloadURL(String defaultDownloadURL);
224

    
225
        /**
226
         * Returns the package info model version.
227
         * 
228
         * @return the package info model version
229
         */
230
        public String getModelVersion();
231

    
232
        /**
233
         * Sets the package info model version.
234
         * 
235
         * @param modelVersion
236
         *            the package info model version
237
         */
238
        public void setModelVersion(String modelVersion);
239

    
240
        public String getOwner();
241

    
242
        /**
243
         * Sets the package owner.
244
         * 
245
         * @param owner
246
         *            the package owner
247
         */
248
        public void setOwner(String owner);
249

    
250
        /**
251
         * Returns the owner's url {@link URL}.
252
         * 
253
         * @return the owner's url {@link URL}
254
         */
255
        public URL getOwnerURL();
256

    
257
        /**
258
         * Sets the package owner's url.
259
         * 
260
         * @param sources
261
         *            the package owner's url
262
         */
263
        public void setOwnerURL(URL sources);
264

    
265
        /**
266
         * Returns the package source files url {@link URL}.
267
         * 
268
         * @return the package source files url {@link URL}
269
         */
270
        public URL getSourcesURL();
271

    
272
        /**
273
         * Sets the package sources.
274
         * 
275
         * @param sources
276
         *            the package sources
277
         */
278
        public void setSourcesURL(URL sources);
279

    
280
        /**
281
         * Returns the package web url {@link URL}.
282
         * 
283
         * @return the package web url {@link URL}
284
         */
285
        public URL getWebURL();
286

    
287
        /**
288
         * Sets the package web url {@link URL}.
289
         * 
290
         * @param webURL
291
         *            the package web url {@link URL}
292
         */
293
        public void setWebURL(URL webURL);
294

    
295
        /**
296
         * Gets the ant script that has to be executed in the installation process.
297
         * 
298
         * @return the script.
299
         */
300
        public String getAntScript();
301

    
302
        /**
303
         * Sets the ant script that can be executed in the installation process.
304
         * 
305
         * @param antScript
306
         *            The ant script to copy.
307
         */
308
        public void setAntScript(String antScript);
309

    
310
        public File downloadFile() throws InstallPackageServiceException;
311

    
312
        public File downloadFile(SimpleTaskStatus taskStatus)
313
                        throws InstallPackageServiceException;
314

    
315
        /**
316
         * @return
317
         */
318
        public void addFileToCopy(File file);
319

    
320
        public File getFileToCopy(int i);
321

    
322
        public void removeFileToCopy(File file);
323

    
324
        public void clearFilesToCopy();
325

    
326
        public List<File> getFilesToCopy();
327

    
328
        /**
329
         * @param folder
330
         * @return
331
         */
332
        public boolean removeInstallFolder(File folder);
333

    
334
        public boolean removeFilesFolder(File folder);
335

    
336
        /**
337
         * @param string
338
         * @return
339
         */
340
        public boolean matchID(String string);
341

    
342
        public Dependencies getDependencies();
343

    
344
        public void setDependencies(String dependencies);
345

    
346
        public void setDependencies(Dependencies dependencies);
347

    
348
        public String toStringCompact();
349

    
350
        public List<String> getCategories();
351

    
352
        public void setCategories(List<String> categoriesList);
353

    
354
        public String getCategoriesAsString();
355

    
356
        public void addCategoriesAsString(String categoriesString);
357

    
358
}