public class TransformationWorkspace extends Object
WorkspaceService
and
EnvironmentService
.Modifier | Constructor and Description |
---|---|
|
TransformationWorkspace()
Create a new transformation workspace with a lease duration of one day.
|
|
TransformationWorkspace(org.joda.time.ReadableDuration leaseDuration)
Create a new transformation workspace with a custom lease duration.
|
|
TransformationWorkspace(String workspaceId)
Create a representation of an existing transformation workspace.
|
protected |
TransformationWorkspace(String workspaceId,
org.joda.time.ReadableDuration leaseDuration)
Create a new workspace or use an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Delete the workspace
|
String |
getId() |
File |
getReportFile()
Get the report file.
|
File |
getSourceFolder()
Get the source folder.
|
File |
getTargetFolder()
Get the target folder.
|
File |
getWorkspace() |
boolean |
isTransformationFinished()
Determines if a previously with
transform(String, List, IOConfiguration) started transformation
process is finished. |
boolean |
isTransformationSuccessful()
Determines if a previously with
transform(String, List, IOConfiguration) started transformation
process was complete successfully. |
protected void |
setTransformationSuccess(boolean success)
Set if the transformation was successfully completed.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
transform(String envId,
List<InstanceReader> sources,
IOConfiguration target)
Transform the instances provided through the given instance readers and
store the result in the
getTargetFolder() . |
public TransformationWorkspace()
IllegalStateException
- if the WorkspaceService
is not
availablepublic TransformationWorkspace(org.joda.time.ReadableDuration leaseDuration)
leaseDuration
- the lease duration of the workspaceIllegalStateException
- if the WorkspaceService
is not
availablepublic TransformationWorkspace(String workspaceId)
workspaceId
- the workspace identifierIllegalStateException
- if the WorkspaceService
is not
available or the workspace with the given identifier does not
existprotected TransformationWorkspace(String workspaceId, org.joda.time.ReadableDuration leaseDuration)
workspaceId
- the workspace identifier if this object should
represent an existing workspace, may be null
if
leaseDuration is set.leaseDuration
- the lease duration of a new workspace to create, may
be null
if workspaceId is setIllegalStateException
- if the WorkspaceService
is not
available or the workspace with the given identifier does not
existpublic com.google.common.util.concurrent.ListenableFuture<Boolean> transform(String envId, List<InstanceReader> sources, IOConfiguration target) throws Exception
getTargetFolder()
.envId
- the environment IDsources
- the instance readerstarget
- the configuration of the target instance writerException
- if launching the transformation failspublic boolean isTransformationFinished()
transform(String, List, IOConfiguration)
started transformation
process is finished. Regardless of the success or failure.true
if the transformation is finished,
false
if the transformation is still running, no
transformation was started or the workspace no longer existspublic boolean isTransformationSuccessful() throws IllegalStateException
transform(String, List, IOConfiguration)
started transformation
process was complete successfully. Note that a successful completion
doesn't necessary mean there weren't any internal transformation errors.
The getReportFile()
holds more detailed information.IllegalStateException
will be thrown.IllegalStateException
- if the transformation is not finishedisTransformationFinished()
protected void setTransformationSuccess(boolean success) throws FileNotFoundException, IOException
success
- if the transformation was completed successfullyFileNotFoundException
- if the workspace does not existIOException
- if the workspace configuration file cannot be read or
writtenpublic String getId()
public File getWorkspace()
public File getTargetFolder()
isTransformationFinished()
,
isTransformationSuccessful()
public File getSourceFolder()
public File getReportFile()
isTransformationFinished()
public void delete()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a