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/execution/InstallPackageService.java

View differences:

InstallPackageService.java
54 54
 */
55 55
public interface InstallPackageService extends Service {
56 56

  
57
    public void reset();
57
	public void reset();
58 58

  
59
    /**
60
     * Adds a the URI of a bundle that contains some packages to install. A
61
     * bundle
62
     * is a compressed zip file with a structure defined in the
63
     * {@link InstallerManager} class.
64
     * 
65
     * @param bundleURI
66
     *            the URI of a bundle.
67
     * @throws InstallPackageServiceException
68
     *             it is thrown if there is an exception reading the URI.
69
     */
70
    public void addBundle(File bundleFile)
71
        throws InstallPackageServiceException;
59
	/**
60
	 * Adds a the URI of a bundle that contains some packages to install. A
61
	 * bundle is a compressed zip file with a structure defined in the
62
	 * {@link InstallerManager} class.
63
	 * 
64
	 * @param bundleURI
65
	 *            the URI of a bundle.
66
	 * @throws InstallPackageServiceException
67
	 *             it is thrown if there is an exception reading the URI.
68
	 */
69
	public void addBundle(File bundleFile)
70
			throws InstallPackageServiceException;
72 71

  
73
    /**
74
     * Adds a URL of a bundle that contains some packages to install. A
75
     * bundle is a compressed zip file with a structure defined in the
76
     * {@link InstallerManager} class.
77
     * 
78
     * @param bundleURL
79
     *            the {@link URL} of a bundle.
80
     * @throws InstallPackageServiceException
81
     *             it is thrown if there is an exception reading the {@link URL}
82
     *             .
83
     */
84
    public void addBundle(URL bundleURL) throws InstallPackageServiceException;
72
	/**
73
	 * Adds a URL of a bundle that contains some packages to install. A bundle
74
	 * is a compressed zip file with a structure defined in the
75
	 * {@link InstallerManager} class.
76
	 * 
77
	 * @param bundleURL
78
	 *            the {@link URL} of a bundle.
79
	 * @throws InstallPackageServiceException
80
	 *             it is thrown if there is an exception reading the {@link URL}
81
	 *             .
82
	 */
83
	public void addBundle(URL bundleURL) throws InstallPackageServiceException;
85 84

  
86
    /**
87
     * In reads a directory and reads all the bundles. This method retrieve
88
     * all the information of the packages located in the bundles and allows to
89
     * the
90
     * user to show this information.
91
     * 
92
     * @param bundlesDirectory
93
     *            a directory that contains bundles.
94
     * @throws InstallPackageServiceException
95
     *             If there is any problem reading the directory of bundles.
96
     */
97
    public void addBundlesFromDirectory(File bundlesDirectory)
98
        throws InstallPackageServiceException;
85
	/**
86
	 * In reads a directory and reads all the bundles. This method retrieve all
87
	 * the information of the packages located in the bundles and allows to the
88
	 * user to show this information.
89
	 * 
90
	 * @param bundlesDirectory
91
	 *            a directory that contains bundles.
92
	 * @throws InstallPackageServiceException
93
	 *             If there is any problem reading the directory of bundles.
94
	 */
95
	public void addBundlesFromDirectory(File bundlesDirectory)
96
			throws InstallPackageServiceException;
99 97

  
100
    /**
101
     * Install a package in a concrete gvSIG installation directory. The
102
     * selected
103
     * package has to be contained in one of the bundles that has been
104
     * previously
105
     * added using the {@link #addBundle(File)} or the
106
     * {@link #addBundlesFromDirectory(File)} method.
107
     * 
108
     * @param applicationDirectory
109
     *            a valid root directory where an instance og gvSIG is
110
     *            installed.
111
     * @param packageInfo
112
     *            the package to install.
113
     * @throws InstallPackageServiceException
114
     *             If there is an error installing the package.
115
     */
116
    public void installPackage(File applicationDirectory,
117
        PackageInfo packageInfo) throws InstallPackageServiceException;
98
	/**
99
	 * Install a package in a concrete gvSIG installation directory. The
100
	 * selected package has to be contained in one of the bundles that has been
101
	 * previously added using the {@link #addBundle(File)} or the
102
	 * {@link #addBundlesFromDirectory(File)} method.
103
	 * 
104
	 * @param applicationDirectory
105
	 *            a valid root directory where an instance og gvSIG is
106
	 *            installed.
107
	 * @param packageInfo
108
	 *            the package to install.
109
	 * @throws InstallPackageServiceException
110
	 *             If there is an error installing the package.
111
	 */
112
	public void installPackage(File applicationDirectory,
113
			PackageInfo packageInfo) throws InstallPackageServiceException;
118 114

  
119
    /**
120
     * Install a package in a concrete gvSIG installation directory. The
121
     * selected
122
     * package has to be contained in one of the bundles that has been
123
     * previously
124
     * added using the {@link #addBundle(File)} or the
125
     * {@link #addBundlesFromDirectory(File)} method.
126
     * 
127
     * @param applicationDirectory
128
     *            a valid root directory where an instance og gvSIG is
129
     *            installed.
130
     * @param packageCode
131
     *            the code of the package.
132
     * @throws InstallPackageServiceException
133
     *             if there is an error installing the {@link PackageInfo#}
134
     */
135
    public void installPackage(File applicationDirectory, String packageCode)
136
        throws InstallPackageServiceException;
115
	/**
116
	 * Install a package in a concrete gvSIG installation directory. The
117
	 * selected package has to be contained in one of the bundles that has been
118
	 * previously added using the {@link #addBundle(File)} or the
119
	 * {@link #addBundlesFromDirectory(File)} method.
120
	 * 
121
	 * @param applicationDirectory
122
	 *            a valid root directory where an instance og gvSIG is
123
	 *            installed.
124
	 * @param packageCode
125
	 *            the code of the package.
126
	 * @throws InstallPackageServiceException
127
	 *             if there is an error installing the {@link PackageInfo#}
128
	 */
129
	public void installPackage(File applicationDirectory, String packageCode)
130
			throws InstallPackageServiceException;
137 131

  
138
    /**
139
     * @return
140
     *         the number of packages that has been loaded form one or more
141
     *         bundles
142
     *         using the {@link #addBundle(File)} or the
143
     *         {@link #addBundlesFromDirectory(File)} method.
144
     */
145
    public int getPackageCount();
132
	/**
133
	 * @return the number of packages that has been loaded form one or more
134
	 *         bundles using the {@link #addBundle(File)} or the
135
	 *         {@link #addBundlesFromDirectory(File)} method.
136
	 */
137
	public int getPackageCount();
146 138

  
147
    /**
148
     * Return the package information for a concrete position. All
149
     * the packages has been loaded form one or more bundles
150
     * using the {@link #addBundle(File)} or the
151
     * {@link #addBundlesFromDirectory(File)} method.
152
     * 
153
     * @param index
154
     *            the position of the package.
155
     * @return
156
     *         the information of a package.
157
     *         returns <code>null</code> if the package doesn't exist.
158
     */
159
    public PackageInfo getPackageInfo(int index);
139
	/**
140
	 * Return the package information for a concrete position. All the packages
141
	 * has been loaded form one or more bundles using the
142
	 * {@link #addBundle(File)} or the {@link #addBundlesFromDirectory(File)}
143
	 * method.
144
	 * 
145
	 * @param index
146
	 *            the position of the package.
147
	 * @return the information of a package. returns <code>null</code> if the
148
	 *         package doesn't exist.
149
	 */
150
	public PackageInfo getPackageInfo(int index);
160 151

  
161
    /**
162
     * Return the package information for a concrete position. All
163
     * the packages has been loaded form one or more bundles
164
     * using the {@link #addBundle(File)} or the
165
     * {@link #addBundlesFromDirectory(File)} method.
166
     * 
167
     * @param packageCode
168
     *            the code of the package.
169
     * @return
170
     *         the information of a package.
171
     *         returns <code>null</code> if the package doesn't exist.
172
     */
173
    public PackageInfo getPackageInfo(String packageCode);
152
	/**
153
	 * Return the package information for a concrete position. All the packages
154
	 * has been loaded form one or more bundles using the
155
	 * {@link #addBundle(File)} or the {@link #addBundlesFromDirectory(File)}
156
	 * method.
157
	 * 
158
	 * @param packageCode
159
	 *            the code of the package.
160
	 * @return the information of a package. returns <code>null</code> if the
161
	 *         package doesn't exist.
162
	 */
163
	public PackageInfo getPackageInfo(String packageCode);
174 164

  
175
    /**
176
     * Download the package and register it in the manager.
177
     * 
178
     * @param packageInfo
179
     */
180
    public void downloadPackage(PackageInfo packageInfo,
181
        SimpleTaskStatus taskStatus) throws InstallPackageServiceException;
165
	/**
166
	 * Download the package and register it in the manager.
167
	 * 
168
	 * @param packageInfo
169
	 */
170
	public void downloadPackage(PackageInfo packageInfo,
171
			SimpleTaskStatus taskStatus) throws InstallPackageServiceException;
182 172

  
183
    /**
173
	/**
184 174
     * 
185 175
     */
186
    // public void resetPackages();
176
	// public void resetPackages();
187 177

  
188
    /**
189
     * @return
190
     */
191
    public List<String> getDefaultSelectedPackagesIDs();
178
	/**
179
	 * @return
180
	 */
181
	public List<String> getDefaultSelectedPackagesIDs();
192 182

  
193
    /**
194
     * Gets the list of all the categories of *all* the packages.
195
     * 
196
     * @return
197
     *         a list with the categories of all the packages.
198
     */
199
    public List<String> getCategories();
200
    
201
    /**
202
     * Gets the list of different the types of *all* the packages.
203
     * 
204
     * @return
205
     *         a list with the types of packages.
206
     */
207
    public List<String> getTypes();
183
	/**
184
	 * Gets the list of all the categories of *all* the packages.
185
	 * 
186
	 * @return a list with the categories of all the packages.
187
	 */
188
	public List<String> getCategories();
189

  
190
	/**
191
	 * Gets the list of different the types of *all* the packages.
192
	 * 
193
	 * @return a list with the types of packages.
194
	 */
195
	public List<String> getTypes();
208 196
}

Also available in: Unified diff