org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.task
Class AssignTaskType

java.lang.Object
  extended by org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.ExecutionEntity
      extended by org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.task.AssignTaskType
All Implemented Interfaces:
Cloneable, Evaluable

public class AssignTaskType
extends ExecutionEntity
implements Cloneable

Author:
Spyros Boutsis, NKUA

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.ExecutionEntity
ExecutionEntity.ExecutionState
 
Field Summary
protected static org.apache.log4j.Logger logger
          Logger
 
Fields inherited from class org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.ExecutionEntity
entityName, execState, isGoalFulfilled, parent, scope, UID
 
Constructor Summary
AssignTaskType()
          Class constructor
 
Method Summary
 void cancel()
          Cancels the execution of this execution entity.
 Object clone()
           
 void doAssignment()
          Performs the assignment that this task must execute
 EvaluationResult evaluate(String expression)
          Evaluates the given expression on the execution tree rooted at the current object and returns a Node representing the result
 String execute(EntityExecutionData eed)
          Executes the logic of this execution entity.
 String getAssignFrom()
           
 String getAssignTo()
           
 String getTypeName()
          Returns the name of this ExecutionEntity's type
 String getUIDescription()
          Returns a string which will be displayed in the user interface as a description for this entity.
 String getUserInputLabel()
           
 void initialize(Element xml)
          Initializes this object, passing the XML element that contains the assignment information
 void initializeWithDataInScope(org.gcube.common.core.scope.GCUBEScope scope)
          Finds the DataTypes that could be possibly used as inputs for this entity as well as each sub-entity contained in it.
 AssignTaskType newInstance(String name)
          Instantiates the execution entity type represented by this object.
 boolean requiresUserInput()
           
 void setAssignFrom(String assignFrom)
           
 void setAssignTo(String assignTo)
           
 void setUserInputLabel(String label)
           
 void toXML(StringBuilder output)
          Outputs an XML description of the ExecutionEntity to the given StringBuilder object.
 
Methods inherited from class org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.types.ExecutionEntity
assignRandomUID, createExecutionLog, getExecutionLogger, getExecutionState, getName, getParent, getScope, getUID, isFulfilled, setExecutionState, setIsFulfilled, setParent, setScope
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Logger

Constructor Detail

AssignTaskType

public AssignTaskType()
Class constructor

Method Detail

initialize

public void initialize(Element xml)
Initializes this object, passing the XML element that contains the assignment information

Parameters:
xml - the XML element describing this assignment

getAssignFrom

public String getAssignFrom()

setAssignFrom

public void setAssignFrom(String assignFrom)

getAssignTo

public String getAssignTo()

requiresUserInput

public boolean requiresUserInput()

setAssignTo

public void setAssignTo(String assignTo)

setUserInputLabel

public void setUserInputLabel(String label)

getUserInputLabel

public String getUserInputLabel()

doAssignment

public void doAssignment()
                  throws Exception
Performs the assignment that this task must execute

Throws:
Exception

execute

public String execute(EntityExecutionData eed)
Description copied from class: ExecutionEntity
Executes the logic of this execution entity. This method cannot throw an exception. In the case of errors, appropriate messages must be logged in the execution log.

Specified by:
execute in class ExecutionEntity
Parameters:
eed - object containing useful data for the execution of the entity

cancel

public void cancel()
Description copied from class: ExecutionEntity
Cancels the execution of this execution entity. If the entity is not currently executing, calling this method has no effect.

Specified by:
cancel in class ExecutionEntity

getTypeName

public String getTypeName()
Description copied from class: ExecutionEntity
Returns the name of this ExecutionEntity's type

Specified by:
getTypeName in class ExecutionEntity
Returns:
the type name

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class ExecutionEntity
Throws:
CloneNotSupportedException

newInstance

public AssignTaskType newInstance(String name)
Description copied from class: ExecutionEntity
Instantiates the execution entity type represented by this object. The instance will have the given name.

Specified by:
newInstance in class ExecutionEntity
Parameters:
name - the new instance name
Returns:
the new instance

evaluate

public EvaluationResult evaluate(String expression)
Description copied from class: ExecutionEntity
Evaluates the given expression on the execution tree rooted at the current object and returns a Node representing the result

Specified by:
evaluate in interface Evaluable
Specified by:
evaluate in class ExecutionEntity
Parameters:
expression - the expression to evaluate, in "a.b.c..." notation
Returns:
the Node object that represents the result

initializeWithDataInScope

public void initializeWithDataInScope(org.gcube.common.core.scope.GCUBEScope scope)
                               throws Exception
Description copied from class: ExecutionEntity
Finds the DataTypes that could be possibly used as inputs for this entity as well as each sub-entity contained in it. The possible inputs for each entity are stored in a list inside the entity itself, so this method does not need to return anything. Furthermore, this method checks if the desirable output of this entity already exists in the given scope, and if it does, the entity's goal is defined as being already 'fulfilled' (the entity does not need to be executed).

Specified by:
initializeWithDataInScope in class ExecutionEntity
Parameters:
scope - the scope in which the entity will be executed
Throws:
Exception

getUIDescription

public String getUIDescription()
Description copied from class: ExecutionEntity
Returns a string which will be displayed in the user interface as a description for this entity.

Specified by:
getUIDescription in class ExecutionEntity
Returns:
the entity description

toXML

public void toXML(StringBuilder output)
Description copied from class: ExecutionEntity
Outputs an XML description of the ExecutionEntity to the given StringBuilder object.

Specified by:
toXML in class ExecutionEntity
Parameters:
output - the StringBuilder to write to


Copyright © 2013. All Rights Reserved.