public interface TaskFactory
TaskFactory is used to create instances of Task. A task
can be executed synchronously or asynchronously by the Session.
Session-owned objects that are passed to TaskFactory methods must be
executed by the session that owns them.| Modifier and Type | Method and Description |
|---|---|
Task |
createDeleteFileTask(java.lang.String filePath)
Create a task that delete the file using the specified file path.
|
Task |
createDownloadFileTask(java.lang.String path,
java.io.OutputStream outputStream)
Creates a task that copies the content of a file on server to the
specified output stream.
|
Task |
createDropTableTask(ServerDatabaseConnection conn,
java.lang.String tableName)
Create a task that drop the table using the specified table name.
|
Task |
createExportDocumentTask(DocumentOutput document,
java.io.OutputStream outputStream,
FileFormat fileFormat)
Creates a task that exports a
DocumentOutput object
to an output stream using the specified FileFormat name. |
Task |
createExportModelTask(ModelOutput model,
java.io.OutputStream outputStream,
FileFormat fileFormat)
Creates a task that exports a
ModelOutput object
to an output stream using the specified FileFormat name. |
Task |
createExportModelTask(Processor modelApplier,
java.io.OutputStream outputStream,
FileFormat fileFormat)
Creates a task that exports a
Processor node
to an output stream using the specified FileFormat name. |
Task |
createExportStreamTask(ProcessorStream stream,
java.io.OutputStream outputStream,
FileFormat fileFormat)
Creates a task that export a stream description to an output stream using specified file format.
|
Task |
createImportPMMLModelTask(java.io.InputStream inputStream)
Creates a task that imports a
ModelOutput object from an input stream. |
Task |
createOpenDocumentTask(java.io.InputStream inputStream)
Creates a task that reads a
DocumentOutput object from an input stream. |
Task |
createOpenDocumentTask(java.io.InputStream inputStream,
boolean autoManage)
Creates a task that reads a
DocumentOutput object from an input stream. |
Task |
createOpenModelTask(java.io.InputStream inputStream)
Creates a task that reads a
ModelOutput object from an input stream. |
Task |
createOpenModelTask(java.io.InputStream inputStream,
boolean autoManage)
Creates a task that reads a
ModelOutput object from an input stream. |
Task |
createOpenProcessorTask(java.io.InputStream inputStream,
ProcessorStream stream)
Creates a task that reads a
Processor object from an input stream
and inserts it into the supplied ProcessorStream. |
Task |
createOpenStreamTask(java.io.InputStream inputStream)
Creates a task that reads a
ProcessorStream object from an input stream. |
Task |
createOpenStreamTask(java.io.InputStream inputStream,
boolean autoManage)
Creates a task that reads a
ProcessorStream object from an input stream. |
Task |
createSaveDocumentTask(DocumentOutput document,
java.io.OutputStream outputStream)
Creates a task that saves a
DocumentOutput object to an output stream. |
Task |
createSaveModelTask(ModelOutput model,
java.io.OutputStream outputStream)
Creates a task that saves a
ModelOutput object to an output stream. |
Task |
createSaveProcessorTask(Processor node,
java.io.OutputStream outputStream)
Creates a task that saves a
Processor object to an output stream. |
Task |
createSaveStreamTask(ProcessorStream stream,
java.io.OutputStream outputStream)
Creates a task that saves a
ProcessorStream object to an output stream. |
Task |
createUpdatePMMLModelTask(ModelOutput modelOutput,
java.io.InputStream inputStream)
Creates a task that updates the
ModelOutput object with PMML read from an input stream. |
Task |
createUploadFileTask(java.lang.String path,
java.io.InputStream inputStream)
Creates a task that copies the content of the specified input stream
to a file on server, replacing any existing file content.
|
Task |
createValidateStreamTask(Processor node)
Creates a task that validate a stream and get required fields, the result of the task is
StreamValidationResult, which could be got from task.getResult(). |
Task createOpenStreamTask(java.io.InputStream inputStream)
ProcessorStream object from an input stream.
Calling getResult() on the completed task returns an
instance of ProcessorStream.inputStream - the input streamTaskcreateOpenStreamTask(InputStream, boolean)Task createOpenStreamTask(java.io.InputStream inputStream, boolean autoManage)
ProcessorStream object from an input stream.
Calling getResult() on the completed task returns an
instance of ProcessorStream. Code that needs to open streams
privately without having them made visible to the user should set the autoManage flag to false.inputStream - the input streamautoManage - whether the opened stream should be added to the stream managerTaskTask createOpenProcessorTask(java.io.InputStream inputStream, ProcessorStream stream) throws OwnerException
Processor object from an input stream
and inserts it into the supplied ProcessorStream.
Calling getResult() on the completed task returns an
instance of Processor.inputStream - the input streamstream - the ProcessorStreamTaskOwnerException - if the stream is not owned by the same session that
owns the task factoryTask createOpenModelTask(java.io.InputStream inputStream)
ModelOutput object from an input stream.
Calling getResult() on the completed task returns an
instance of ModelOutput. The model is not added to the model manager.inputStream - the input streamTaskcreateOpenModelTask(InputStream, boolean)Task createOpenModelTask(java.io.InputStream inputStream, boolean autoManage)
ModelOutput object from an input stream.
Calling getResult() on the completed task returns an
instance of ModelOutput. Code that needs to open models privately
without having them made visible to the user should set the autoManage flag to false.inputStream - the input streamautoManage - whether the model should be added to the model managerTaskTask createOpenDocumentTask(java.io.InputStream inputStream)
DocumentOutput object from an input stream.
Calling getResult() on the completed task returns an
instance of DocumentOutput. The document is not added to the output manager.inputStream - the input streamTaskcreateOpenDocumentTask(InputStream, boolean)Task createOpenDocumentTask(java.io.InputStream inputStream, boolean autoManage)
DocumentOutput object from an input stream.
Calling getResult() on the completed task returns an
instance of DocumentOutput. Code that needs to open documents privately
without having them made visible to the user should set the autoManage flag to false.inputStream - the input streamautoManage - whether the document should be added to the output managerTaskTask createSaveStreamTask(ProcessorStream stream, java.io.OutputStream outputStream) throws OwnerException
ProcessorStream object to an output stream.
Calling getResult() on the completed task returns null.stream - the ProcessorStream objectoutputStream - the output streamTaskOwnerException - if the stream is not owned by the same session that
owns the task factoryTask createSaveProcessorTask(Processor node, java.io.OutputStream outputStream) throws OwnerException
Processor object to an output stream.
Calling getResult() on the completed task returns null.node - the Processor objectoutputStream - the output streamTaskOwnerException - if the node is not owned by the same session that
owns the task factoryTask createSaveModelTask(ModelOutput model, java.io.OutputStream outputStream) throws OwnerException
ModelOutput object to an output stream.
Calling getResult() on the completed task returns null.model - the ModelOutput objectoutputStream - the output streamTaskOwnerException - if the model output is not owned by the same session that
owns the task factoryTask createSaveDocumentTask(DocumentOutput document, java.io.OutputStream outputStream) throws OwnerException
DocumentOutput object to an output stream.
Calling getResult() on the completed task returns null.document - the DocumentOutput objectoutputStream - the output streamTaskOwnerException - if the document output is not owned by the same session that
owns the task factoryTask createExportModelTask(ModelOutput model, java.io.OutputStream outputStream, FileFormat fileFormat) throws OwnerException, ExportFormatException
ModelOutput object
to an output stream using the specified FileFormat name.
Calling getResult() on the completed task returns null.model - the ModelOutput objectoutputStream - the output streamfileFormat - the FileFormat to be usedTaskOwnerException - if the output is not owned by the same session that
owns the task factoryExportFormatException - if the model does not support the export formatTask createExportModelTask(Processor modelApplier, java.io.OutputStream outputStream, FileFormat fileFormat) throws OwnerException, ExportFormatException
Processor node
to an output stream using the specified FileFormat name.
Calling getResult() on the completed task returns null.modelApplier - the Processor objectoutputStream - the output streamfileFormat - the FileFormat to be usedTaskOwnerException - if the output is not owned by the same session that
owns the task factoryExportFormatException - if the model does not support the export formatTask createExportDocumentTask(DocumentOutput document, java.io.OutputStream outputStream, FileFormat fileFormat) throws OwnerException, ExportFormatException
DocumentOutput object
to an output stream using the specified FileFormat name.
Calling getResult() on the completed task returns null.document - the DocumentOutput objectoutputStream - the output streamfileFormat - the FileFormat to be usedTaskOwnerException - if the output is not owned by the same session that
owns the task factoryExportFormatException - if the document does not support the export formatFileFormatTask createImportPMMLModelTask(java.io.InputStream inputStream)
ModelOutput object from an input stream.
Calling getResult() on the completed task returns an
instance of ModelOutput.inputStream - the input streamTaskTask createUpdatePMMLModelTask(ModelOutput modelOutput, java.io.InputStream inputStream) throws OwnerException
ModelOutput object with PMML read from an input stream.
The task will fail if the ModelOutput is not based on a PMML model or the
ModelOutput and the PMML algorithms are not the same.modelOutput - inputStream - TaskOwnerException - if the model output is not owned by the same session that
owns the task factoryTask createExportStreamTask(ProcessorStream stream, java.io.OutputStream outputStream, FileFormat fileFormat) throws OwnerException, ExportFormatException
stream - the stream to be exportedoutputStream - the output streamfileFormat - the export file formatTaskOwnerException - if the node is not owned by the same session that
owns the task factoryExportFormatException - if the stream does not support the export formatTask createValidateStreamTask(Processor node) throws OwnerException, SessionException, ObjectLockedException
StreamValidationResult, which could be got from task.getResult().node - the validate nodeTaskOwnerException - if the node is not owned by the same session that
owns the task factorySessionExceptionObjectLockedExceptionTask createDropTableTask(ServerDatabaseConnection conn, java.lang.String tableName)
conn - - The ServerDatabaseConnection used for connect to the database.tableName - - The name of the table which you want to delete.TaskTask createDeleteFileTask(java.lang.String filePath)
filePath - - The path of file on server.TaskTask createUploadFileTask(java.lang.String path, java.io.InputStream inputStream)
path - the path of the remote file on serverinputStream - the input streamTask createDownloadFileTask(java.lang.String path, java.io.OutputStream outputStream)
path - the path of the remote file on serveroutputStream - the output streamCopyright © 2014 Integral Solutions Ltd. All Rights Reserved.