1 /*
2 * Copyright 2003 - 2013 The eFaps Team
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Revision: $Rev$
17 * Last Changed: $Date$
18 * Last Changed By: $Author$
19 */
20
21 package org.efaps.update;
22
23 import java.net.URL;
24 import java.util.List;
25 import java.util.Map;
26 import java.util.Set;
27
28 import org.apache.commons.jexl2.JexlContext;
29 import org.efaps.update.util.InstallationException;
30 import org.efaps.util.EFapsException;
31 import org.xml.sax.SAXException;
32
33 /**
34 * TODO comment!
35 *
36 * @author The eFaps Team
37 * @version $Id$
38 */
39 public interface IUpdate
40 {
41 /**
42 * Runs the update for given eFaps configuration item.
43 *
44 * @param _jexlContext context used to evaluate JEXL expressions
45 * @param _step current step of the update life cycle
46 * @param _profiles the Profiles that will be executed
47 * @throws InstallationException from called update methods
48 */
49 void updateInDB(final JexlContext _jexlContext,
50 final UpdateLifecycle _step,
51 final Set<Profile> _profiles)
52 throws InstallationException;
53
54 /**
55 * Name of the file application for which this XML file is defined.
56 * @return String containing the name of the application
57 */
58 String getFileApplication();
59
60 /**
61 * Read event for given tags path with attributes and text.
62 *
63 * @param _tags tags path as list
64 * @param _attributes map of attributes for current tag
65 * @param _text content text of this tags path
66 * @throws SAXException on error
67 * @throws EFapsException on error
68 */
69 void readXML(final List<String> _tags,
70 final Map<String, String> _attributes,
71 final String _text)
72 throws SAXException, EFapsException;
73
74 /**
75 * @return the URL of the CI.
76 */
77 URL getURL();
78
79 }