Revision 37599 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/InstallerManager.java

View differences:

InstallerManager.java
83 83
 * </p>
84 84
 * The services that offers this managers are basically two: the creation of
85 85
 * bundles for just one package of plugin type and a service for the
86
 * installation of packages from a bundle.
87
 * </p>
86
 * installation of packages from a bundle. </p>
88 87
 * 
89 88
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
90 89
 */
91 90
public interface InstallerManager extends Manager {
92 91

  
93
    /**
94
     * Package state default values.
95
     */
96
    public static interface STATE {
92
	/**
93
	 * Package state default values.
94
	 */
95
	public static interface STATE {
97 96

  
98
        static final String DEVEL = "devel";
99
        static final String TESTING = "testing";
100
        static final String PILOT = "pilot";
101
        static final String PROTOTYPE = "prototype";
102
        static final String ALPHA = "alpha";
103
        static final String BETA = "beta";
104
        static final String RC = "RC";
105
        static final String FINAL = "final";
106
    }
97
		static final String DEVEL = "devel";
98
		static final String TESTING = "testing";
99
		static final String PILOT = "pilot";
100
		static final String PROTOTYPE = "prototype";
101
		static final String ALPHA = "alpha";
102
		static final String BETA = "beta";
103
		static final String RC = "RC";
104
		static final String FINAL = "final";
105
	}
107 106

  
108
    /**
109
     * Supported operating system default values.
110
     */
111
    public static interface OS {
107
	/**
108
	 * Supported operating system default values.
109
	 */
110
	public static interface OS {
112 111

  
113
        static final String ALL = "all";
114
        static final String LINUX = "lin";
115
        static final String WINDOWS = "win";
116
        static final String OSX_10_4 = "osx_10_4";
117
        static final String OSX_10_5 = "osx_10_5";
118
        static final String OSX_10_6 = "osx_10_6";
119
    }
112
		static final String ALL = "all";
113
		static final String LINUX = "lin";
114
		static final String WINDOWS = "win";
115
		static final String OSX_10_4 = "osx_10_4";
116
		static final String OSX_10_5 = "osx_10_5";
117
		static final String OSX_10_6 = "osx_10_6";
118
	}
120 119

  
121
    /**
122
     * Supported architecture default values.
123
     */
124
    public static interface ARCH {
120
	/**
121
	 * Supported architecture default values.
122
	 */
123
	public static interface ARCH {
125 124

  
126
        static final String ALL = "all";
127
        static final String X86 = "x86";
128
        static final String X86_64 = "x86_64";
129
    }
125
		static final String ALL = "all";
126
		static final String X86 = "x86";
127
		static final String X86_64 = "x86_64";
128
	}
130 129

  
131
    /**
132
     * Supported Java virtual machine version default values.
133
     */
134
    public static interface JVM {
130
	/**
131
	 * Supported Java virtual machine version default values.
132
	 */
133
	public static interface JVM {
135 134

  
136
        static final String J1_5 = "j1_5";
137
        static final String J1_6 = "j1_6";
138
    }
135
		static final String J1_5 = "j1_5";
136
		static final String J1_6 = "j1_6";
137
	}
139 138

  
140
    /**
141
     * Fields into the bundle file name message format.
142
     * 
143
     * @see InstallerManager#getPackageSetNameFormat()
144
     * @see InstallerManager#setPackageSetNameFormat(String)
145
     */
146
    public static interface PACKAGE_FILE_NAME_FIELDS {
139
	/**
140
	 * Fields into the bundle file name message format.
141
	 * 
142
	 * @see InstallerManager#getPackageSetNameFormat()
143
	 * @see InstallerManager#setPackageSetNameFormat(String)
144
	 */
145
	public static interface PACKAGE_FILE_NAME_FIELDS {
147 146

  
148
        static final int GVSIG_VERSION = 0;
149
        static final int NAME = 1;
150
        static final int VERSION = 2;
151
        static final int BUILD = 3;
152
        static final int STATE = 4;
153
        static final int OS = 5;
154
        static final int ARCH = 6;
155
        static final int JVM = 7;
156
    }
147
		static final int GVSIG_VERSION = 0;
148
		static final int NAME = 1;
149
		static final int VERSION = 2;
150
		static final int BUILD = 3;
151
		static final int STATE = 4;
152
		static final int OS = 5;
153
		static final int ARCH = 6;
154
		static final int JVM = 7;
155
	}
157 156

  
158
    /**
159
     * It registers a class that implements the service for the creation of
160
     * bundle that contains inside a package of type plugin. The registered
161
     * class
162
     * have to implement the {@link MakePluginPackageService} interface.
163
     * 
164
     * @param clazz
165
     *            class that implements the {@link MakePluginPackageService}
166
     *            interface.
167
     */
168
    public void registerMakePluginPackageService(
169
        Class<? extends MakePluginPackageService> clazz);
157
	/**
158
	 * It registers a class that implements the service for the creation of
159
	 * bundle that contains inside a package of type plugin. The registered
160
	 * class have to implement the {@link MakePluginPackageService} interface.
161
	 * 
162
	 * @param clazz
163
	 *            class that implements the {@link MakePluginPackageService}
164
	 *            interface.
165
	 */
166
	public void registerMakePluginPackageService(
167
			Class<? extends MakePluginPackageService> clazz);
170 168

  
171
    /**
172
     * It creates and returns an object that is used to create a bundle
173
     * that contains inside a package of type plugin. All the parameters
174
     * are set using the {@link MakePluginPackageService} interface. *
175
     * 
176
     * @return
177
     *         an object that is used to create a plugin installer
178
     * @throws MakePluginPackageServiceException
179
     *             when there is a problem creating the service
180
     */
181
    public MakePluginPackageService getMakePluginPackageService(
182
        File pluginsDirectory) throws MakePluginPackageServiceException;
169
	/**
170
	 * It creates and returns an object that is used to create a bundle that
171
	 * contains inside a package of type plugin. All the parameters are set
172
	 * using the {@link MakePluginPackageService} interface. *
173
	 * 
174
	 * @return an object that is used to create a plugin installer
175
	 * @throws MakePluginPackageServiceException
176
	 *             when there is a problem creating the service
177
	 */
178
	public MakePluginPackageService getMakePluginPackageService(
179
			File pluginsDirectory) throws MakePluginPackageServiceException;
183 180

  
184
    /**
185
     * Returns a list of package infos for the already installed plugins.
186
     * 
187
     * @param pluginsDirectory
188
     *            where to look for the installed plugins
189
     * @return the list of package infos for the already installed plugins
190
     * @throws MakePluginPackageServiceException
191
     *             if there is an error loading
192
     *             the information of the installed plugins
193
     */
194
    public PackageInfo[] getInstalledPackages(File pluginsDirectory)
195
        throws MakePluginPackageServiceException;
181
	/**
182
	 * Returns a list of package infos for the already installed plugins.
183
	 * 
184
	 * @param pluginsDirectory
185
	 *            where to look for the installed plugins
186
	 * @return the list of package infos for the already installed plugins
187
	 * @throws MakePluginPackageServiceException
188
	 *             if there is an error loading the information of the installed
189
	 *             plugins
190
	 */
191
	public PackageInfo[] getInstalledPackages(File pluginsDirectory)
192
			throws MakePluginPackageServiceException;
196 193

  
197
    /**
198
     * Returns the package bundle file name format.
199
     * <p>
200
     * The string has to use a suitable {@link MessageFormat} format, and the
201
     * available field numbers are the ones defined in the
202
     * BUNDLE_FILE_NAME_FIELDS interface.
203
     * </p>
204
     * 
205
     * @return the package bundle file name format.
206
     */
207
    public String getPackageSetNameFormat();
194
	/**
195
	 * Returns the package bundle file name format.
196
	 * <p>
197
	 * The string has to use a suitable {@link MessageFormat} format, and the
198
	 * available field numbers are the ones defined in the
199
	 * BUNDLE_FILE_NAME_FIELDS interface.
200
	 * </p>
201
	 * 
202
	 * @return the package bundle file name format.
203
	 */
204
	public String getPackageSetNameFormat();
208 205

  
209
    /**
210
     * Sets the package bundle file name format.
211
     * 
212
     * @see InstallerManager#getPackageSetNameFormat()
213
     * @param packageBundleNameFormat
214
     *            the package bundle file name format.
215
     */
216
    public void setPackageSetNameFormat(String packageBundleNameFormat);
206
	/**
207
	 * Sets the package bundle file name format.
208
	 * 
209
	 * @see InstallerManager#getPackageSetNameFormat()
210
	 * @param packageBundleNameFormat
211
	 *            the package bundle file name format.
212
	 */
213
	public void setPackageSetNameFormat(String packageBundleNameFormat);
217 214

  
218
    /**
219
     * Returns the name of the package set file for a given package info.
220
     * 
221
     * @param info
222
     *            of the plugin
223
     * @return the name of the package set file
224
     */
225
    public String getPackageSetFileName(PackageInfo info);
215
	/**
216
	 * Returns the name of the package set file for a given package info.
217
	 * 
218
	 * @param info
219
	 *            of the plugin
220
	 * @return the name of the package set file
221
	 */
222
	public String getPackageSetFileName(PackageInfo info);
226 223

  
227
    /**
228
     * Returns the name of the package file for a given package info.
229
     * 
230
     * @param info
231
     *            of the plugin
232
     * @return the name of the package file
233
     */
234
    public String getPackageFileName(PackageInfo info);
224
	/**
225
	 * Returns the name of the package file for a given package info.
226
	 * 
227
	 * @param info
228
	 *            of the plugin
229
	 * @return the name of the package file
230
	 */
231
	public String getPackageFileName(PackageInfo info);
235 232

  
236
    /**
237
     * Returns the name of the package index file for a given package info.
238
     * 
239
     * @param info
240
     *            of the plugin
241
     * @return the name of the package index file
242
     */
243
    public String getPackageIndexFileName(PackageInfo info);
233
	/**
234
	 * Returns the name of the package index file for a given package info.
235
	 * 
236
	 * @param info
237
	 *            of the plugin
238
	 * @return the name of the package index file
239
	 */
240
	public String getPackageIndexFileName(PackageInfo info);
244 241

  
245
    /**
246
     * It registers a class that implements the service for the installation
247
     * of a package that is inside a bundle. This class has to implement
248
     * the {@link InstallPackageService} interface.
249
     * 
250
     * @param clazz
251
     *            class that implements the {@link InstallPackageService}
252
     *            interface.
253
     */
254
    public void registerInstallPackageService(
255
        Class<? extends InstallPackageService> clazz);
242
	/**
243
	 * It registers a class that implements the service for the installation of
244
	 * a package that is inside a bundle. This class has to implement the
245
	 * {@link InstallPackageService} interface.
246
	 * 
247
	 * @param clazz
248
	 *            class that implements the {@link InstallPackageService}
249
	 *            interface.
250
	 */
251
	public void registerInstallPackageService(
252
			Class<? extends InstallPackageService> clazz);
256 253

  
257
    /**
258
     * It creates and returns an object that is used to install a package
259
     * in gvSIG. All the parameters are set using the
260
     * {@link InstallPackageService} interface.
261
     * 
262
     * @return
263
     *         an object that is used to install the package.
264
     * @throws InstallPackageServiceException
265
     *             when there is a problem creating the service.
266
     */
267
    public InstallPackageService getInstallPackageService()
268
        throws InstallPackageServiceException;
254
	/**
255
	 * It creates and returns an object that is used to install a package in
256
	 * gvSIG. All the parameters are set using the {@link InstallPackageService}
257
	 * interface.
258
	 * 
259
	 * @return an object that is used to install the package.
260
	 * @throws InstallPackageServiceException
261
	 *             when there is a problem creating the service.
262
	 */
263
	public InstallPackageService getInstallPackageService()
264
			throws InstallPackageServiceException;
269 265

  
270
    /**
271
     * Returns the default extensions of the package files.
272
     * 
273
     * @return the default extensions of the package files
274
     */
275
    public String getDefaultPackageFileExtension();
266
	/**
267
	 * Returns the default extensions of the package files.
268
	 * 
269
	 * @return the default extensions of the package files
270
	 */
271
	public String getDefaultPackageFileExtension();
276 272

  
277
    /**
278
     * Returns the default extensions of the package set files.
279
     * 
280
     * @return the default extensions of the package set files
281
     */
282
    public String getDefaultPackageSetFileExtension();
283
    
284
    /**
285
     * Returns the default extensions of the index set files.
286
     * 
287
     * @return the default extensions of the index set files
288
     */
289
    public String getDefaultIndexSetFileExtension();
290
    
291
    /**
292
     * Return the OS code of the system
293
     *   
294
     * @return os code of the system
295
     */
273
	/**
274
	 * Returns the default extensions of the package set files.
275
	 * 
276
	 * @return the default extensions of the package set files
277
	 */
278
	public String getDefaultPackageSetFileExtension();
279

  
280
	/**
281
	 * Returns the default extensions of the index set files.
282
	 * 
283
	 * @return the default extensions of the index set files
284
	 */
285
	public String getDefaultIndexSetFileExtension();
286

  
287
	/**
288
	 * Return the OS code of the system
289
	 * 
290
	 * @return os code of the system
291
	 */
296 292
	public String getOperatingSystem();
297
	
298
    /**
299
     * Returns the Architecture code of the system
300
     *   
301
     * @return architecture code of the system
302
     */
303
    public String getArchitecture();
304
	
293

  
305 294
	/**
295
	 * Returns the Architecture code of the system
296
	 * 
297
	 * @return architecture code of the system
298
	 */
299
	public String getArchitecture();
300

  
301
	/**
306 302
	 * Create a empty dependency object.
307 303
	 * 
308 304
	 * @return the dependency
309 305
	 */
310 306
	public Dependency createDependency();
311
	
307

  
312 308
	/**
313
	 * Create a dependency instance with the data of the
314
	 * package.
309
	 * Create a dependency instance with the data of the package.
315 310
	 * 
316 311
	 * @param packageInfo
317 312
	 * @return a dependency of the package
318 313
	 */
319 314
	public Dependency createDependency(PackageInfo packageInfo);
320
	
315

  
321 316
	/**
322 317
	 * Create a dependencies calculator.
323 318
	 * 
324 319
	 * @return the dependencias calculator
325 320
	 */
326
	public DependenciesCalculator createDependenciesCalculator(InstallPackageService installService);
327
	
321
	public DependenciesCalculator createDependenciesCalculator(
322
			InstallPackageService installService);
323

  
328 324
	/**
329 325
	 * Create a version instance
330 326
	 * 
331 327
	 * @return the version
332 328
	 */
333 329
	public Version createVersion();
334
	
330

  
335 331
	public PackageInfo createPackageInfo();
336
	
337
    public PackageInfoWriter getDefaultPackageInfoWriter();
338 332

  
339
    public PackageInfoReader getDefaultPackageInfoReader();
340
    
341
    public MakePackageService createMakePackage(File packageFolder, PackageInfo packageInfo);
342
    
343
    public void setDownloadBaseURL(URL url);
344
    
345
    public URL getDownloadBaseURL();
346
    
347
    public void setVersion(String version);
348
    
349
    public String getVersion();
350
	
333
	public PackageInfoWriter getDefaultPackageInfoWriter();
334

  
335
	public PackageInfoReader getDefaultPackageInfoReader();
336

  
337
	public MakePackageService createMakePackage(File packageFolder,
338
			PackageInfo packageInfo);
339

  
340
	public void setDownloadBaseURL(URL url);
341

  
342
	public URL getDownloadBaseURL();
343

  
344
	public void setVersion(String version);
345

  
346
	public String getVersion();
347

  
351 348
}

Also available in: Unified diff