001: /*
002: * Copyright 2006 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Jun 17, 2005
014: * @author James Dixon
015: *
016: */
017:
018: package org.pentaho.core.solution;
019:
020: import java.util.*;
021: import org.dom4j.Node;
022: import org.pentaho.core.component.IComponent;
023:
024: /**
025: * The ActionDefinition represents the definition and metadata for a single
026: * action execution, which is equivalent to one execution of any given
027: * Component.
028: * <p>
029: * The ActionDefinition is derived from the solution's action sequence document.
030: * One ActionDefinition is handed to the appropriate Component, and provides all
031: * the necessary inputs, outputs and resources for that Component to execute.
032: */
033: public interface IActionDefinition {
034:
035: /**
036: * Returns a Map of the input parameters that are defined to this
037: * ActionDefinition.
038: *
039: * @return Map of input parameters. Parameters take the name-value form.
040: */
041: public Map getActionInputDefinitions();
042:
043: /**
044: *
045: * Returns the name of the parameter that the passed in name is mapped to in
046: * the Action Sequence Document
047: *
048: * @param name
049: * String name of the parameter to get a mapping for
050: * @return String name of the parameter that 'name' is mapped to
051: */
052: public String getMappedInputName(String name);
053:
054: /**
055: * Returns a <tt>Map</tt> of the output parameters that are defined for this
056: * ActionDefinition.
057: *
058: * @return <tt>Map</tt> of output parameters. Parameters take the name-value
059: * form.
060: */
061: public Map getActionOutputDefinitions();
062:
063: /**
064: *
065: * Returns the name of the parameter that the passed in name is mapped to in
066: * the Action Sequence Document
067: *
068: * @param name
069: * String name of the parameter to get a mapping for
070: * @return String name of the parameter that 'name' is mapped to
071: */
072: public String getMappedOutputName(String name);
073:
074: /**
075: * Returns a <tt>List</tt> of the resource parameter names that are defined for this
076: * ActionDefinition.
077: *
078: * @return <tt>List</tt> of resource parameter names.
079: */
080: public List getActionResourceDefinitionNames();
081:
082: public boolean hasActionResources();
083:
084: /**
085: *
086: * Returns the name of the parameter that the passed in name is mapped to in
087: * the Action Sequence Document
088: *
089: * @param name
090: * String name of the parameter to get a mapping for
091: * @return String name of the parameter that 'name' is mapped to
092: */
093: public String getMappedResourceName(String name);
094:
095: /**
096: * Get the logging level for this ActionDefinition. The logging level may be
097: * set independently or may be inherited from a parent object's logging
098: * level.
099: *
100: * @return this ActionDefinition's logging level
101: * @see org.pentaho.util.logging.ILogger
102: */
103: public int getLoggingLevel();
104:
105: /**
106: * Returns the list of input and output parameters that will be audited
107: * before component execution. This list is handed off to the auditing
108: * subsystem as metadata.
109: *
110: * @return <tt>List</tt> of parameters defined for pre-execution auditing
111: */
112: public List getPreExecuteAuditList();
113:
114: /**
115: * Returns the list of input and output parameters that will be audited
116: * after component execution. This list is handed off to the auditing
117: * subsystem as metadata.
118: *
119: * @return <tt>List</tt> of parameters defined for post-execution auditing
120: */
121: public List getPostExecuteAuditList();
122:
123: /**
124: * Returns boolean value regarding whether this action is set to execute
125: * synchronous or asynchronously.
126: *
127: * @return true, if set to asynchronous, false if set to synchronous
128: */
129: public boolean getSyncPreference();
130:
131: /**
132: * Returns the Java class name of the Component that this ActionDefinition
133: * is created for.
134: *
135: * @return the Java class name of Component for this ActionDefinition
136: */
137: public String getComponentName();
138:
139: /**
140: * Returns the Component definition portion of this ActionDefinition. The
141: * Component section typically describes that data and metadata that is
142: * relevant only to that particular component.
143: *
144: * @return the Component definition section of the ActionDefinition
145: */
146: public Node getComponentSection();
147:
148: public Node getNode();
149:
150: /**
151: * Returns the Component object that this ActionDefinition belongs to.
152: *
153: * @return the definition's Component object
154: */
155: public IComponent getComponent();
156:
157: /**
158: * Returns the author of the ActionDefinition, if defined, or null
159: * otherwise.
160: *
161: * @return this definition's author, or null if not defined.
162: */
163: public String getAuthor();
164:
165: /**
166: * Returns the description of the ActionDefinition, if defined, or null
167: * otherwise.
168: *
169: * @return this definition's description, or null if not defined.
170: */
171: public String getDescription();
172:
173: /**
174: * Returns the URL to the Help page for this definition.
175: *
176: * @return the definition's Help URL
177: */
178: public String getHelp();
179:
180: /**
181: * Returns the URL to the icon for this definition.
182: *
183: * @return the definition's icon URL
184: */
185: public String getIconUrl();
186:
187: /**
188: * Sets the Component object that this definition will belong to. The
189: * component must be valid for this ActionDefinition, otherwise execution
190: * validation will fail.
191: *
192: * @param component
193: * the Component that is valid for this definiton.
194: */
195: public void setComponent(IComponent component);
196:
197: }
|