001/* An interface for DDP pattern actors.
002 * 
003 * Copyright (c) 2011-2012 The Regents of the University of California.
004 * All rights reserved.
005 *
006 * '$Author: crawl $'
007 * '$Date: 2014-05-09 21:10:24 +0000 (Fri, 09 May 2014) $' 
008 * '$Revision: 32714 $'
009 * 
010 * Permission is hereby granted, without written agreement and without
011 * license or royalty fees, to use, copy, modify, and distribute this
012 * software and its documentation for any purpose, provided that the above
013 * copyright notice and the following two paragraphs appear in all copies
014 * of this software.
015 *
016 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
017 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
018 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
019 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
020 * SUCH DAMAGE.
021 *
022 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
023 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
024 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
025 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
026 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
027 * ENHANCEMENTS, OR MODIFICATIONS.
028 *
029 */
030package org.kepler.ddp.actor.pattern;
031
032import java.io.IOException;
033import java.io.Writer;
034import java.util.List;
035
036import ptolemy.actor.Actor;
037import ptolemy.kernel.Port;
038import ptolemy.kernel.util.Attribute;
039import ptolemy.kernel.util.IllegalActionException;
040import ptolemy.kernel.util.Workspace;
041
042/** An interface for all DDP pattern actors.
043 * 
044 *  @author Daniel Crawl
045 *  @version $Id: DDPPatternActor.java 32714 2014-05-09 21:10:24Z crawl $
046 */
047public interface DDPPatternActor extends Actor {
048
049    /** Get a list of ports. */
050    public List portList();
051
052    /** Returns true if the actor is atomic, or is composite and contains a director. */
053    public boolean isOpaque();
054
055    /** Get the port with the given name. */
056    public Port getPort(String string);
057
058    /** Write a MoML description of this object using the specified Writer. */
059    public void exportMoML(Writer writer) throws IOException;
060
061    /** Clone the actor into a workspace. */
062    public Object clone(Workspace workspace) throws CloneNotSupportedException;
063
064    /** Get the attribute with the given name. */
065    public Attribute getAttribute(String string);
066
067    /** Get the number of parallel instances to execute. */
068    public int getDegreeOfParallelism() throws IllegalActionException;
069    
070    /** Get the dir to redirect display related actors. */
071    public String getDisplayRedirectDir() throws IllegalActionException;
072    
073    /** Get a set of name-value pairs of input/output format parameters for the execution engine. */
074    public java.util.Map<String,String> getParameters() throws IllegalActionException;
075    
076    /** Get a set of (kepler name, implementation name) pairs of input/output format parameters for the execution engine. */
077    public java.util.Map<String,String> getParaImplNames(String engineName) throws IllegalActionException;
078    
079    /** Get the name of the execution class. If no execution class is set,
080     *  e.g., for composite pattern actors this means the sub-workflow is
081     *  to be executed, returns the empty string.
082     */
083    public String getExecutionClassName() throws IllegalActionException;
084
085    /** Get a comma-separated list of jars to use with this actor. */
086    public String getJars() throws IllegalActionException;
087    
088    /** Get whether print execution summary when running workflow inside of Hadoop/Stratosphere job. */
089    public boolean getPrintExeInfo() throws IllegalActionException;
090    
091    /** Get the execution code type. Returns null if not set. */
092    public String getExecutionCodeType() throws IllegalActionException;
093    
094    /** Get the execution code. Returns null if not set. */
095    public String getExecutionCode() throws IllegalActionException;
096    
097    /** Some common key value types for inputs and outputs. */
098    public final static String[] _commonKeyValueTypes = 
099        { "int string", "long string", "string string", "string int" };
100    
101}