org.knime.core.node.workflow
Class CopyWorkflowPersistor

java.lang.Object
  extended by org.knime.core.node.workflow.CopyWorkflowPersistor
All Implemented Interfaces:
NodeContainerPersistor, WorkflowPersistor

 class CopyWorkflowPersistor
extends Object
implements WorkflowPersistor

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.knime.core.node.workflow.WorkflowPersistor
WorkflowPersistor.ConnectionContainerTemplate, WorkflowPersistor.LoadResult, WorkflowPersistor.LoadResultEntry, WorkflowPersistor.MetaNodeLinkUpdateResult, WorkflowPersistor.WorkflowLoadResult, WorkflowPersistor.WorkflowPortTemplate
 
Field Summary
 
Fields inherited from interface org.knime.core.node.workflow.WorkflowPersistor
KEY_CONNECTIONS, KEY_ID, KEY_NODES, KEY_UI_INFORMATION, METAINFO_FILE, SAVED_WITH_DATA_FILE, TEMPLATE_FILE, WORKFLOW_FILE
 
Constructor Summary
CopyWorkflowPersistor(WorkflowManager original, HashMap<Integer,ContainerTable> tableRep, boolean preserveDeletableFlags, boolean isUndoableDeleteCommand)
          Create copy persistor.
 
Method Summary
 InputStream decipherInput(InputStream input)
          Open decryption stream for locked meta nodes.
 Set<WorkflowPersistor.ConnectionContainerTemplate> getAdditionalConnectionSet()
          Get additional connections.
 Set<WorkflowPersistor.ConnectionContainerTemplate> getConnectionSet()
          The connections between the nodes that are loaded.
 List<Credentials> getCredentials()
          Get (non-null) map of credentials.
 HashMap<Integer,ContainerTable> getGlobalTableRepository()
          
 UIInformation getInPortsBarUIInfo()
          Get UI information for workflow input ports.
 WorkflowPersistor.WorkflowPortTemplate[] getInPortTemplates()
          
 WorkflowPersistorVersion200.LoadVersion getLoadVersion()
          
 NodeContainerMetaPersistor getMetaPersistor()
          
 String getName()
          
 NodeContainer getNodeContainer(WorkflowManager parent, NodeID id)
          
 Map<Integer,NodeContainerPersistor> getNodeLoaderMap()
          The map of node ID suffix to persistor.
 List<ReferencedFile> getObsoleteNodeDirectories()
          List of node directories, whose corresponding nodes failed to load.
 UIInformation getOutPortsBarUIInfo()
          Get UI information for workflow output ports.
 WorkflowPersistor.WorkflowPortTemplate[] getOutPortTemplates()
          
 MetaNodeTemplateInformation getTemplateInformation()
          template information associated with the workflow, e.g.
 List<WorkflowAnnotation> getWorkflowAnnotations()
          
 WorkflowCipher getWorkflowCipher()
          
 List<FlowVariable> getWorkflowVariables()
          Get the workflow variables associated with this meta node/workflow.
 boolean isDirtyAfterLoad()
          
 void loadNodeContainer(Map<Integer,BufferedDataTable> tblRep, ExecutionMonitor exec, WorkflowPersistor.LoadResult loadResult)
          
 boolean mustComplainIfStateDoesNotMatch()
          Does this persistor complain if its persisted state state does not match the state after loading (typically all non-executed nodes are configured after load).
 boolean mustWarnOnDataLoadError()
          
 boolean needsResetAfterLoad()
          
 void preLoadNodeContainer(WorkflowPersistor parentPersistor, NodeSettingsRO parentSettings, WorkflowPersistor.LoadResult loadResult)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyWorkflowPersistor

CopyWorkflowPersistor(WorkflowManager original,
                      HashMap<Integer,ContainerTable> tableRep,
                      boolean preserveDeletableFlags,
                      boolean isUndoableDeleteCommand)
Create copy persistor.

Parameters:
original - To copy from
tableRep - The table map in the target
preserveDeletableFlags - Whether to keep the "is-deletable" flags in the target.
isUndoableDeleteCommand - If to keep the location of the node directories (important for undo of delete commands, see WorkflowManager.copy(boolean, WorkflowCopyContent) for details.)
Method Detail

getConnectionSet

public Set<WorkflowPersistor.ConnectionContainerTemplate> getConnectionSet()
The connections between the nodes that are loaded. The set only contains connections between nodes of the loader map, it does not contain any other connection (see WorkflowPersistor.getAdditionalConnectionSet()).

Specified by:
getConnectionSet in interface WorkflowPersistor
Returns:
The connections

getAdditionalConnectionSet

public Set<WorkflowPersistor.ConnectionContainerTemplate> getAdditionalConnectionSet()
Get additional connections. These are connections that connect nodes that were loaded to nodes that are already in the workflow. In most cases this list is empty except for undo commands that restore deleted nodes (and their connections to other nodes in the workflow).

Specified by:
getAdditionalConnectionSet in interface WorkflowPersistor
Returns:
Such a set (often empty but never null).

getGlobalTableRepository

public HashMap<Integer,ContainerTable> getGlobalTableRepository()

Specified by:
getGlobalTableRepository in interface WorkflowPersistor

getInPortsBarUIInfo

public UIInformation getInPortsBarUIInfo()
Get UI information for workflow input ports.

Specified by:
getInPortsBarUIInfo in interface WorkflowPersistor
Returns:
the ui info or null if not set.

getInPortTemplates

public WorkflowPersistor.WorkflowPortTemplate[] getInPortTemplates()

Specified by:
getInPortTemplates in interface WorkflowPersistor

getName

public String getName()

Specified by:
getName in interface WorkflowPersistor

getWorkflowCipher

public WorkflowCipher getWorkflowCipher()

Specified by:
getWorkflowCipher in interface WorkflowPersistor
Returns:
cipher associated with the metanode/workflow, often just WorkflowCipher.NULL_CIPHER, never null.

getTemplateInformation

public MetaNodeTemplateInformation getTemplateInformation()
template information associated with the workflow, e.g. whether it is linking to same central master meta node.

Specified by:
getTemplateInformation in interface WorkflowPersistor
Returns:
The template info

getWorkflowVariables

public List<FlowVariable> getWorkflowVariables()
Get the workflow variables associated with this meta node/workflow. This method must not return null (but possibly an empty list). The result may be unmodifiable.

Specified by:
getWorkflowVariables in interface WorkflowPersistor
Returns:
The workflow variables.

getCredentials

public List<Credentials> getCredentials()
Get (non-null) map of credentials.

Specified by:
getCredentials in interface WorkflowPersistor
Returns:
The credentials defined on this meta node.

getWorkflowAnnotations

public List<WorkflowAnnotation> getWorkflowAnnotations()

Specified by:
getWorkflowAnnotations in interface WorkflowPersistor
Returns:
(non-mull) map of annotations.

getObsoleteNodeDirectories

public List<ReferencedFile> getObsoleteNodeDirectories()
List of node directories, whose corresponding nodes failed to load. These directories will be deleted in the next save invocation.

Specified by:
getObsoleteNodeDirectories in interface WorkflowPersistor
Returns:
List of obsolete node directories

getOutPortsBarUIInfo

public UIInformation getOutPortsBarUIInfo()
Get UI information for workflow output ports.

Specified by:
getOutPortsBarUIInfo in interface WorkflowPersistor
Returns:
the ui info or null if not set.

getOutPortTemplates

public WorkflowPersistor.WorkflowPortTemplate[] getOutPortTemplates()

Specified by:
getOutPortTemplates in interface WorkflowPersistor

getMetaPersistor

public NodeContainerMetaPersistor getMetaPersistor()

Specified by:
getMetaPersistor in interface NodeContainerPersistor

getLoadVersion

public WorkflowPersistorVersion200.LoadVersion getLoadVersion()

Specified by:
getLoadVersion in interface WorkflowPersistor

getNodeLoaderMap

public Map<Integer,NodeContainerPersistor> getNodeLoaderMap()
The map of node ID suffix to persistor.

Specified by:
getNodeLoaderMap in interface WorkflowPersistor
Returns:
The persistor map.

getNodeContainer

public NodeContainer getNodeContainer(WorkflowManager parent,
                                      NodeID id)

Specified by:
getNodeContainer in interface NodeContainerPersistor

loadNodeContainer

public void loadNodeContainer(Map<Integer,BufferedDataTable> tblRep,
                              ExecutionMonitor exec,
                              WorkflowPersistor.LoadResult loadResult)

Specified by:
loadNodeContainer in interface NodeContainerPersistor

needsResetAfterLoad

public boolean needsResetAfterLoad()

Specified by:
needsResetAfterLoad in interface NodeContainerPersistor

isDirtyAfterLoad

public boolean isDirtyAfterLoad()

Specified by:
isDirtyAfterLoad in interface NodeContainerPersistor

mustComplainIfStateDoesNotMatch

public boolean mustComplainIfStateDoesNotMatch()
Does this persistor complain if its persisted state state does not match the state after loading (typically all non-executed nodes are configured after load). This is true for all SingleNodeContainer and newer meta nodes, but it will be false for meta nodes, which are loaded from 1.x workflow.

Specified by:
mustComplainIfStateDoesNotMatch in interface NodeContainerPersistor
Returns:
Such a property.

preLoadNodeContainer

public void preLoadNodeContainer(WorkflowPersistor parentPersistor,
                                 NodeSettingsRO parentSettings,
                                 WorkflowPersistor.LoadResult loadResult)

Specified by:
preLoadNodeContainer in interface NodeContainerPersistor

decipherInput

public InputStream decipherInput(InputStream input)
Open decryption stream for locked meta nodes. Implementations will also call the decipher method on their parent workflow persistors.

Specified by:
decipherInput in interface WorkflowPersistor
Parameters:
input - The input to decipher.
Returns:
The decipherd input, mostly just the input.

mustWarnOnDataLoadError

public boolean mustWarnOnDataLoadError()

Specified by:
mustWarnOnDataLoadError in interface WorkflowPersistor
Returns:
the shouldFailOnLoadDataError


Copyright, 2003 - 2012. 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.