org.knime.core.node
Class NodePersistorVersion1xx

java.lang.Object
  extended by org.knime.core.node.NodePersistorVersion1xx
All Implemented Interfaces:
NodeContentPersistor, NodePersistor
Direct Known Subclasses:
NodePersistorVersion200

public class NodePersistorVersion1xx
extends Object
implements NodePersistor


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.NodePersistor
NodePersistor.LoadNodeModelSettingsFailPolicy
 
Field Summary
static List<String> OLD_AUTOEXECUTABLE_NODEFACTORIES
          List of factories (only the simple class name), which were auto-executable in 1.3.x and need to be restored as configured only.
 
Fields inherited from interface org.knime.core.node.NodePersistor
CFG_DATA_FILE, CFG_DATA_FILE_DIR, CFG_HAS_SPEC_FILE, CFG_ISCONFIGURED, CFG_ISEXECUTED, CFG_MEMORY_POLICY, CFG_MODEL_FILES, CFG_NAME, CFG_NODE_MESSAGE, CFG_OUTPUT_PREFIX, CFG_SPEC_FILES, DATA_FILE_DIR, DATA_FILE_PREFIX, INTERN_FILE_DIR, MODEL_FILE_PREFIX, SETTINGS_FILE_NAME
 
Constructor Summary
NodePersistorVersion1xx(SingleNodeContainerPersistorVersion1xx sncPersistor)
          Constructor that should be used when node is saved.
 
Method Summary
(package private) static String createDataFileDirName(int index)
           
(package private) static String createModelFileName(int index)
           
 BufferedDataTable[] getInternalHeldTables()
          
protected  NodeLogger getLogger()
           
 NodePersistor.LoadNodeModelSettingsFailPolicy getModelSettingsFailPolicy()
          
 ReferencedFile getNodeDirectory()
           
 ReferencedFile getNodeInternDirectory()
          
(package private) static ReferencedFile getNodeInternDirectory(ReferencedFile nodeDir)
           
 PortObject getPortObject(int outportIndex)
          
 PortObjectSpec getPortObjectSpec(int outportIndex)
          
 String getPortObjectSummary(int outportIndex)
          
 NodeSettingsRO getSettings()
          
 SingleNodeContainerPersistorVersion1xx getSingleNodeContainerPersistor()
           
 String getWarningMessage()
          
 boolean hasContent()
          
 boolean isConfigured()
          Is configured according to the settings object.
 boolean isDirtyAfterLoad()
          Whether this node should be marked as dirty after load.
 boolean isExecuted()
          
 void load(Node node, ReferencedFile configFileRef, ExecutionMonitor exec, Map<Integer,BufferedDataTable> loadTblRep, HashMap<Integer,ContainerTable> tblRep, WorkflowPersistor.LoadResult loadResult)
          Loads content into node instance.
protected  boolean loadHasContent(NodeSettingsRO settings)
           
protected  void loadInternalHeldTables(Node node, ExecutionMonitor execMon, NodeSettingsRO settings, Map<Integer,BufferedDataTable> loadTblRep, HashMap<Integer,ContainerTable> tblRep)
           
protected  boolean loadIsConfigured(NodeSettingsRO settings)
           
protected  boolean loadIsExecuted(NodeSettingsRO settings)
           
protected  ReferencedFile loadNodeInternDirectory(NodeSettingsRO settings, ReferencedFile nodeDir)
           
protected  void loadPorts(Node node, ExecutionMonitor execMon, NodeSettingsRO settings, Map<Integer,BufferedDataTable> loadTblRep, HashMap<Integer,ContainerTable> tblRep)
           
protected  String loadWarningMessage(NodeSettingsRO settings)
           
 boolean mustWarnOnDataLoadError()
          
 boolean needsResetAfterLoad()
          
 void setDirtyAfterLoad()
          Sets the dirty flag on this node.
 void setInternalHeldTables(BufferedDataTable[] internalHeldTables)
           
 void setNeedsResetAfterLoad()
          Indicate an error and that this node should better be reset after load.
 void setPortObject(int idx, PortObject portObject)
           
 void setPortObjectSpec(int idx, PortObjectSpec portObjectSpec)
           
 void setPortObjectSummary(int idx, String portObjectSummary)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OLD_AUTOEXECUTABLE_NODEFACTORIES

public static final List<String> OLD_AUTOEXECUTABLE_NODEFACTORIES
List of factories (only the simple class name), which were auto-executable in 1.3.x and need to be restored as configured only.

Constructor Detail

NodePersistorVersion1xx

public NodePersistorVersion1xx(SingleNodeContainerPersistorVersion1xx sncPersistor)
Constructor that should be used when node is saved. It's not been used for loading, i.e. all getXXX() methods will return invalid values.

Method Detail

createDataFileDirName

static String createDataFileDirName(int index)

createModelFileName

static String createModelFileName(int index)

getLogger

protected NodeLogger getLogger()

loadIsExecuted

protected boolean loadIsExecuted(NodeSettingsRO settings)
                          throws InvalidSettingsException
Throws:
InvalidSettingsException

loadHasContent

protected boolean loadHasContent(NodeSettingsRO settings)
                          throws InvalidSettingsException
Throws:
InvalidSettingsException

loadWarningMessage

protected String loadWarningMessage(NodeSettingsRO settings)
                             throws InvalidSettingsException
Throws:
InvalidSettingsException

loadIsConfigured

protected boolean loadIsConfigured(NodeSettingsRO settings)
                            throws InvalidSettingsException
Throws:
InvalidSettingsException

getNodeInternDirectory

static ReferencedFile getNodeInternDirectory(ReferencedFile nodeDir)

loadNodeInternDirectory

protected ReferencedFile loadNodeInternDirectory(NodeSettingsRO settings,
                                                 ReferencedFile nodeDir)
                                          throws InvalidSettingsException
Throws:
InvalidSettingsException

loadPorts

protected void loadPorts(Node node,
                         ExecutionMonitor execMon,
                         NodeSettingsRO settings,
                         Map<Integer,BufferedDataTable> loadTblRep,
                         HashMap<Integer,ContainerTable> tblRep)
                  throws IOException,
                         InvalidSettingsException,
                         CanceledExecutionException
Throws:
IOException
InvalidSettingsException
CanceledExecutionException

loadInternalHeldTables

protected void loadInternalHeldTables(Node node,
                                      ExecutionMonitor execMon,
                                      NodeSettingsRO settings,
                                      Map<Integer,BufferedDataTable> loadTblRep,
                                      HashMap<Integer,ContainerTable> tblRep)
                               throws IOException,
                                      InvalidSettingsException,
                                      CanceledExecutionException
Throws:
IOException
InvalidSettingsException
CanceledExecutionException

getSingleNodeContainerPersistor

public SingleNodeContainerPersistorVersion1xx getSingleNodeContainerPersistor()
Returns:
the singleNodeContainerPersistor

isConfigured

public boolean isConfigured()
Is configured according to the settings object.

Specified by:
isConfigured in interface NodePersistor
Returns:
If node is saved in configured state.

isExecuted

public boolean isExecuted()

Specified by:
isExecuted in interface NodePersistor

hasContent

public boolean hasContent()

Specified by:
hasContent in interface NodeContentPersistor

needsResetAfterLoad

public boolean needsResetAfterLoad()

Specified by:
needsResetAfterLoad in interface NodeContentPersistor

setNeedsResetAfterLoad

public void setNeedsResetAfterLoad()
Indicate an error and that this node should better be reset after load.

Specified by:
setNeedsResetAfterLoad in interface NodeContentPersistor

setDirtyAfterLoad

public void setDirtyAfterLoad()
Sets the dirty flag on this node. The node will also be dirty if the NodeContentPersistor.setNeedsResetAfterLoad() is called.

Specified by:
setDirtyAfterLoad in interface NodePersistor

isDirtyAfterLoad

public boolean isDirtyAfterLoad()
Whether this node should be marked as dirty after load. This is true if either the NodePersistor.setDirtyAfterLoad() has been set to true or NodeContentPersistor.needsResetAfterLoad() returns true.

Specified by:
isDirtyAfterLoad in interface NodePersistor
Returns:
This property.

mustWarnOnDataLoadError

public boolean mustWarnOnDataLoadError()

Specified by:
mustWarnOnDataLoadError in interface NodeContentPersistor

load

public void load(Node node,
                 ReferencedFile configFileRef,
                 ExecutionMonitor exec,
                 Map<Integer,BufferedDataTable> loadTblRep,
                 HashMap<Integer,ContainerTable> tblRep,
                 WorkflowPersistor.LoadResult loadResult)
          throws IOException,
                 CanceledExecutionException
Loads content into node instance.

Parameters:
node - The target node, used for meta info (#ports, e.g) and to invoke the Node#load(NodePersistor, ExecutionMonitor, LoadResult) on
configFileRef - The configuration file for the node.
exec - For progress/cancelation
loadTblRep - The table repository used during load
tblRep - The table repository for blob handling
loadResult - where to add errors to
Throws:
IOException - If files can't be read
CanceledExecutionException - If canceled

getModelSettingsFailPolicy

public NodePersistor.LoadNodeModelSettingsFailPolicy getModelSettingsFailPolicy()

Specified by:
getModelSettingsFailPolicy in interface NodePersistor

getNodeDirectory

public ReferencedFile getNodeDirectory()

getNodeInternDirectory

public ReferencedFile getNodeInternDirectory()

Specified by:
getNodeInternDirectory in interface NodeContentPersistor

getSettings

public NodeSettingsRO getSettings()

Specified by:
getSettings in interface NodePersistor

getWarningMessage

public String getWarningMessage()

Specified by:
getWarningMessage in interface NodeContentPersistor

getPortObject

public PortObject getPortObject(int outportIndex)

Specified by:
getPortObject in interface NodeContentPersistor

setPortObject

public void setPortObject(int idx,
                          PortObject portObject)
Parameters:
idx - The outport index.
portObject - the portObjects to set

getPortObjectSpec

public PortObjectSpec getPortObjectSpec(int outportIndex)

Specified by:
getPortObjectSpec in interface NodeContentPersistor

setPortObjectSpec

public void setPortObjectSpec(int idx,
                              PortObjectSpec portObjectSpec)
Parameters:
idx - The outport index.
portObjectSpec - the portObjects to set

getPortObjectSummary

public String getPortObjectSummary(int outportIndex)

Specified by:
getPortObjectSummary in interface NodeContentPersistor

setPortObjectSummary

public void setPortObjectSummary(int idx,
                                 String portObjectSummary)
Parameters:
idx - port for which to set summary
portObjectSummary - the portObjectSummary to set

getInternalHeldTables

public BufferedDataTable[] getInternalHeldTables()

Specified by:
getInternalHeldTables in interface NodeContentPersistor

setInternalHeldTables

public void setInternalHeldTables(BufferedDataTable[] internalHeldTables)
Parameters:
internalHeldTables - the internalHeldTables to set


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.