org.knime.core.node.workflow
Class MetaNodeTemplateInformation

java.lang.Object
  extended by org.knime.core.node.workflow.MetaNodeTemplateInformation
All Implemented Interfaces:
Cloneable

public final class MetaNodeTemplateInformation
extends Object
implements Cloneable

Additional information that is associated with a meta node that are used as templates. This includes their source URI and versioning information.

Author:
Bernd Wiswedel, KNIME.com, Zurich, Switzerland

Nested Class Summary
static class MetaNodeTemplateInformation.Role
          The template's role.
static class MetaNodeTemplateInformation.UpdateStatus
           
 
Field Summary
static MetaNodeTemplateInformation NONE
          Default info object (no template).
 
Method Summary
protected  MetaNodeTemplateInformation clone()
          
 MetaNodeTemplateInformation createLink(URI sourceURI)
          Create a new link template info based on this template, which is supposed to be accessible under the argument URI.
static MetaNodeTemplateInformation createNewTemplate()
           
 MetaNodeTemplateInformation.Role getRole()
           
 URI getSourceURI()
           
 Date getTimestamp()
           
 String getTimeStampString()
          The timestamp formatted as string or null if this is not a link.
 MetaNodeTemplateInformation.UpdateStatus getUpdateStatus()
          Transient field that is set by the update checker.
static MetaNodeTemplateInformation load(NodeSettingsRO settings, WorkflowPersistorVersion200.LoadVersion version)
          Load information from argument, throw InvalidSettingsException if that fails.
 void save(NodeSettingsWO settings)
          Saves this object to the argument settings.
(package private)  boolean setUpdateStatusInternal(MetaNodeTemplateInformation.UpdateStatus updateStatus)
          Set update status field, only to be called via checkUpdateMetaNodeLink(NodeID, WorkflowLoadHelper).
 String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final MetaNodeTemplateInformation NONE
Default info object (no template).

Method Detail

getTimestamp

public Date getTimestamp()
Returns:
the timestamp date or null if this is not a link.

getTimeStampString

public String getTimeStampString()
The timestamp formatted as string or null if this is not a link.

Returns:
This string or null.

getSourceURI

public URI getSourceURI()
Returns:
the sourceURI

getRole

public MetaNodeTemplateInformation.Role getRole()
Returns:
the role

getUpdateStatus

public MetaNodeTemplateInformation.UpdateStatus getUpdateStatus()
Transient field that is set by the update checker. It will be valid if this template info represents a valid link to a template.

Returns:
status of a potential update to the latest template.

setUpdateStatusInternal

boolean setUpdateStatusInternal(MetaNodeTemplateInformation.UpdateStatus updateStatus)
Set update status field, only to be called via checkUpdateMetaNodeLink(NodeID, WorkflowLoadHelper).

Parameters:
updateStatus - The field
Returns:
Whether the field has changed (caller needs notifying listeners).

createLink

public MetaNodeTemplateInformation createLink(URI sourceURI)
                                       throws InvalidSettingsException
Create a new link template info based on this template, which is supposed to be accessible under the argument URI.

Parameters:
sourceURI - The sourceURI, must not be null.
Returns:
a new template linking to the argument URI, using the timestamp of this object.
Throws:
InvalidSettingsException - If this object is not a template.

save

public void save(NodeSettingsWO settings)
Saves this object to the argument settings.

Parameters:
settings - To save to.

clone

protected MetaNodeTemplateInformation clone()

Overrides:
clone in class Object

toString

public String toString()

Overrides:
toString in class Object

createNewTemplate

public static MetaNodeTemplateInformation createNewTemplate()
Returns:
A new template info representing the template itself. The time stamp is set to the current time.

load

public static MetaNodeTemplateInformation load(NodeSettingsRO settings,
                                               WorkflowPersistorVersion200.LoadVersion version)
                                        throws InvalidSettingsException
Load information from argument, throw InvalidSettingsException if that fails.

Parameters:
settings - To load from.
version - The version this workflow is loading from
Returns:
a new template loading from the argument settings.
Throws:
InvalidSettingsException - If that fails.


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.