public class ShiwaBundleHelper
extends java.lang.Object
Constructor and Description |
---|
ShiwaBundleHelper(org.shiwa.desktop.data.description.SHIWABundle shiwaBundle)
Instantiates a new shiwa bundle helper.
|
ShiwaBundleHelper(java.lang.String bundlePath)
Instantiates a new shiwa bundle helper.
|
Modifier and Type | Method and Description |
---|---|
void |
bundle(java.io.File temp)
Bundle.
|
java.io.File |
bytesToFile(byte[] bytes,
java.io.File file)
Bytes to file.
|
void |
clearConfigs()
Clear configs.
|
java.util.HashMap<Node,java.lang.Object> |
compileOutputs(java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.resource.ConfigurationResource> outputResources,
java.util.HashMap<java.lang.String,Node> outputNodeMap)
Compile outputs.
|
org.shiwa.desktop.data.description.core.Mapping |
createConfiguration(java.util.List list)
Creates the configuration.
|
org.shiwa.desktop.data.description.handler.TransferSignature |
createDefaultTransferSignature()
Creates the default transfer signature.
|
org.shiwa.desktop.data.description.handler.TransferSignature |
createTransferSignature(org.shiwa.desktop.data.description.core.ConcreteTask workflow,
org.shiwa.desktop.data.description.core.Mapping configuration)
Creates the transfer signature.
|
static java.io.File |
download(java.lang.String urlSource,
java.io.File downloadDir,
java.io.File localFile)
Download.
|
java.io.File |
extractToFile(java.lang.String relativePath,
java.io.File file)
Extract to file.
|
org.shiwa.desktop.data.description.resource.ConfigurationResource |
getConfigurationResourceForDependency(org.shiwa.desktop.data.description.workflow.Dependency dependency)
Gets the configuration resource for dependency.
|
java.util.ArrayList<org.shiwa.desktop.data.description.workflow.Dependency> |
getDependencyForType(java.lang.String type)
Gets the dependency for type.
|
static java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.resource.ConfigurationResource> |
getOutputs(java.io.File bundle)
Gets the outputs.
|
org.shiwa.desktop.data.description.workflow.SHIWAProperty |
getShiwaProperty(java.lang.String key)
Gets the shiwa property.
|
void |
getTaskSignature(java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.workflow.InputPort> inputPortMap,
java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.workflow.OutputPort> outputPortMap)
Gets the task signature.
|
java.io.File |
getTempEntry(java.lang.String relativePath)
Gets the temp entry.
|
org.shiwa.desktop.data.description.core.WorkflowImplementation |
getWorkflowImplementation()
Gets the workflow implementation.
|
boolean |
hasDataConfiguration()
Checks for data configuration.
|
void |
prepareEnvironmentDependencies()
Prepare environment dependencies.
|
void |
prepareLibraryDependencies()
Prepare library dependencies.
|
java.io.File |
saveBundle(java.io.File file)
Save bundle.
|
void |
setRuntimeOutputFolder(java.io.File outputFolder)
Sets the runtime output folder.
|
static void |
writeConfigResourcesToDisk(org.shiwa.desktop.data.description.workflow.Dependency dependency,
java.util.List<org.shiwa.desktop.data.description.resource.ConfigurationResource> config,
java.io.File outputLocation)
Write config resources to disk.
|
static java.io.File |
writeConfigurationResourceToFile(org.shiwa.desktop.data.description.resource.ConfigurationResource configurationResource,
java.io.File file,
java.io.File outputLocation)
Write configuration resource to file.
|
public ShiwaBundleHelper(org.shiwa.desktop.data.description.SHIWABundle shiwaBundle) throws org.shiwa.desktop.data.util.exception.SHIWADesktopIOException
shiwaBundle
- the shiwa bundleorg.shiwa.desktop.data.util.exception.SHIWADesktopIOException
- the sHIWA desktop io exceptionpublic ShiwaBundleHelper(java.lang.String bundlePath) throws org.shiwa.desktop.data.util.exception.SHIWADesktopIOException
bundlePath
- the bundle pathorg.shiwa.desktop.data.util.exception.SHIWADesktopIOException
- the sHIWA desktop io exceptionpublic org.shiwa.desktop.data.description.core.Mapping createConfiguration(java.util.List list)
list
- the listpublic org.shiwa.desktop.data.description.workflow.SHIWAProperty getShiwaProperty(java.lang.String key)
key
- the keypublic void prepareLibraryDependencies()
public java.util.ArrayList<org.shiwa.desktop.data.description.workflow.Dependency> getDependencyForType(java.lang.String type)
type
- the typepublic org.shiwa.desktop.data.description.resource.ConfigurationResource getConfigurationResourceForDependency(org.shiwa.desktop.data.description.workflow.Dependency dependency)
dependency
- the dependencypublic static java.io.File writeConfigurationResourceToFile(org.shiwa.desktop.data.description.resource.ConfigurationResource configurationResource, java.io.File file, java.io.File outputLocation) throws java.io.IOException
configurationResource
- the configuration resourcefile
- the fileoutputLocation
- the output locationjava.io.IOException
- Signals that an I/O exception has occurred.public java.io.File getTempEntry(java.lang.String relativePath) throws java.io.IOException
relativePath
- the relative pathjava.io.IOException
- Signals that an I/O exception has occurred.public java.io.File extractToFile(java.lang.String relativePath, java.io.File file) throws java.io.IOException
relativePath
- the relative pathfile
- the filejava.io.IOException
- Signals that an I/O exception has occurred.public java.io.File bytesToFile(byte[] bytes, java.io.File file) throws java.io.IOException
bytes
- the bytesfile
- the filejava.io.IOException
- Signals that an I/O exception has occurred.public void setRuntimeOutputFolder(java.io.File outputFolder)
outputFolder
- the new runtime output folderpublic org.shiwa.desktop.data.description.handler.TransferSignature createDefaultTransferSignature() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public boolean hasDataConfiguration()
public org.shiwa.desktop.data.description.handler.TransferSignature createTransferSignature(org.shiwa.desktop.data.description.core.ConcreteTask workflow, org.shiwa.desktop.data.description.core.Mapping configuration) throws java.io.IOException
workflow
- the workflowconfiguration
- the configurationjava.io.IOException
- Signals that an I/O exception has occurred.public java.io.File saveBundle(java.io.File file) throws org.shiwa.desktop.data.util.exception.SHIWADesktopIOException
file
- the fileorg.shiwa.desktop.data.util.exception.SHIWADesktopIOException
- the sHIWA desktop io exceptionpublic static java.io.File download(java.lang.String urlSource, java.io.File downloadDir, java.io.File localFile) throws java.io.IOException
urlSource
- the url sourcedownloadDir
- the download dirlocalFile
- the local filejava.io.IOException
- Signals that an I/O exception has occurred.public void prepareEnvironmentDependencies() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public static void writeConfigResourcesToDisk(org.shiwa.desktop.data.description.workflow.Dependency dependency, java.util.List<org.shiwa.desktop.data.description.resource.ConfigurationResource> config, java.io.File outputLocation) throws java.io.IOException
dependency
- the dependencyconfig
- the configoutputLocation
- the output locationjava.io.IOException
- Signals that an I/O exception has occurred.public org.shiwa.desktop.data.description.core.WorkflowImplementation getWorkflowImplementation()
public void bundle(java.io.File temp) throws org.shiwa.desktop.data.util.exception.SHIWADesktopIOException
temp
- the temporg.shiwa.desktop.data.util.exception.SHIWADesktopIOException
- the sHIWA desktop io exceptionpublic static java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.resource.ConfigurationResource> getOutputs(java.io.File bundle)
bundle
- the bundlepublic void clearConfigs()
public java.util.HashMap<Node,java.lang.Object> compileOutputs(java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.resource.ConfigurationResource> outputResources, java.util.HashMap<java.lang.String,Node> outputNodeMap)
outputResources
- the output resourcesoutputNodeMap
- the output node mappublic void getTaskSignature(java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.workflow.InputPort> inputPortMap, java.util.HashMap<java.lang.String,org.shiwa.desktop.data.description.workflow.OutputPort> outputPortMap)
inputPortMap
- the input port mapoutputPortMap
- the output port map