Package org.knime.core.webui.data
Class ApplyDataService<D>
java.lang.Object
org.knime.core.webui.data.ApplyDataService<D>
- Type Parameters:
D-
- All Implemented Interfaces:
DataService
A data service that applies the data to the underlying model (usually the
NodeModel). Applying the data often
implies persisting it.- Since:
- 4.5
- Author:
- Martin Horn, KNIME GmbH, Konstanz, Germany
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classThe builder.static interfaceNested classes/interfaces inherited from interface org.knime.core.webui.data.DataService
DataService.DataServiceBuilder -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the data from a string.builder(ApplyDataService.Applier<String> dataApplier) voidCalled whenever the data service can free-up resources.voiddispose()Called whenever the data service won't be used anymore.voidRe-executes the underlying node in order to apply new data.booleanvalidateData(String data) Checks whether the data in the input stream is valid.
-
Method Details
-
validateData
Checks whether the data in the input stream is valid.- Parameters:
data- the data to validate- Returns:
- an empty optional if the validation was successful otherwise a validation error string
- Throws:
IOException
-
applyData
Applies the data from a string.- Parameters:
dataString- the data to apply- Throws:
IOException
-
dispose
public void dispose()Description copied from interface:DataServiceCalled whenever the data service won't be used anymore. I.e. resources can be freed-up such as clearing caches or shutting down external processes etc.- Specified by:
disposein interfaceDataService
-
deactivate
public void deactivate()Description copied from interface:DataServiceCalled whenever the data service can free-up resources. E.g. clearing caches or shutting down external processes etc. Though, it does not necessarily mean, that the data service instance is not used anymore some time later.- Specified by:
deactivatein interfaceDataService
-
shallReExecute
public boolean shallReExecute()- Returns:
- whether a re-execution of the respective node is required on apply
-
reExecute
Re-executes the underlying node in order to apply new data.- Parameters:
data- the data to execute the node with- Throws:
IOException
-
builder
public static ApplyDataService.ApplyDataServiceBuilder<String> builder(ApplyDataService.Applier<String> dataApplier) - Parameters:
dataApplier-- Returns:
- the builder for this data service
-
builder
public static ApplyDataService.ApplyDataServiceBuilder<String> builder(org.knime.core.node.interactive.ReExecutable<String> reExecutable) - Parameters:
reExecutable-- Returns:
- the builder for this data service
-