1 /*
2 Copyright (C) 2007 Grid Systems, S.A. and University of Southampton IT Innovation Centre
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 package nextgrid.api.pom;
19
20 import java.io.Serializable;
21 import java.net.URI;
22 import java.util.Map;
23
24 import javax.xml.namespace.QName;
25
26 import nextgrid.api.env.ProcessEnvironment;
27
28 /**
29 * Implementation of the service logic.
30 *
31 * @author Rodrigo Ruiz, Nikolaos Matskanis
32 */
33 public interface Grounding extends Serializable {
34 /**
35 * Name space for grounding attributes.
36 */
37 String NS_GROUNDING = "urn:grounding";
38
39 /**
40 * Attribute key for the service grounding type URI.
41 */
42 QName ATTR_GROUNDING_TYPE = new QName(NS_GROUNDING, "type");
43
44 /**
45 * Attribute key for service groundings accepting operation names.
46 * <p>
47 * It is expected that standard groundings will be able to execute different
48 * actions depending on the service configuration. This attribute will be
49 * the basic configuration field for such groundings.
50 */
51 QName ATTR_OPERATION = new QName(NS_GROUNDING, "operation");
52
53 /**
54 * Gets a URI for the type of this grounding. This URI can be used for
55 * looking up grounding implementations.
56 *
57 * @return The Grounding type as a URI
58 */
59 URI getType();
60
61 /**
62 * Gets the names and descriptions of all supported attributes.
63 * <p>
64 * The returned map contains [name, description] pairs of attributes.
65 *
66 * @return A map containing attribute names and descriptions
67 */
68 Map<QName, String> getSupportedAttribs();
69
70 /**
71 * Invokes the logic of this grounding.
72 *
73 * @param env Process environment
74 * @param service The service instance on which this grounding must be executed
75 * @throws ProcessException If an error occurs
76 */
77 void invoke(ProcessEnvironment env, Service service) throws ProcessException;
78
79 /**
80 * Clean up.
81 */
82 void dispose();
83
84 /**
85 * Validates this grounding.
86 *
87 * @throws ProcessException If the validation fails
88 */
89 void validate() throws ProcessException;
90 }