Package nzilbb.labbcat.server.task
Class SerializeFragmentsTask
- java.lang.Object
-
- java.lang.Thread
-
- nzilbb.labbcat.server.task.Task
-
- nzilbb.labbcat.server.task.SerializeFragmentsTask
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description SerializeFragmentsTask(String name, long searchId, Collection<String> layers, String mimeType, SqlGraphStoreAdministration store)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancels the task.String
getBaseUrl()
Getter forbaseUrl
: Base URL.String
getCollectionName()
Getter forcollectionName
: Collection Nameboolean
getIncludeRequiredLayers()
Getter forincludeRequiredLayers
: Whether to include the layers required by the serializer, or only the selected layers.Collection<String>
getLayers()
Getter forlayers
: Layers selected for serialization.String
getMimeType()
Getter forsMimeType
: MIME type for exportInteger
getPercentComplete()
Determines how far through the task is is.boolean
getPrefixNames()
Getter forprefixNames
: Whether to prefix fragment names with a numeric serial number or not.String
getResultBaseUrl()
ResultBaseUrl accessorFile
getResultDirectory()
ResultDirectory accessorlong
getSearchId()
Getter forsearchId
: The search results ID, if all matches are for export - i.e.SqlGraphStoreAdministration
getStore()
Getter forstore
: Graph store.boolean
getTagTarget()
Getter fortagTarget
: Whether to add an tag identifying the target annotation or not.List<String>
getUtterances()
Getter forutterances
: Collection of utterances to convert.void
run()
Run the exportSerializeFragmentsTask
setBaseUrl(String newBaseUrl)
Setter forbaseUrl
: Base URL.SerializeFragmentsTask
setCollectionName(String newCollectionName)
Setter forcollectionName
: Collection NameSerializeFragmentsTask
setIncludeRequiredLayers(boolean newIncludeRequiredLayers)
Setter forincludeRequiredLayers
: Whether to include the layers required by the serializer, or only the selected layers.SerializeFragmentsTask
setLayers(Collection<String> newLayers)
Setter forlayers
: Layers selected for serialization.SerializeFragmentsTask
setMimeType(String sNewMimeType)
Setter forsMimeType
: MIME type for exportSerializeFragmentsTask
setPrefixNames(boolean newPrefixNames)
Setter forprefixNames
: Whether to prefix fragment names with a numeric serial number or not.SerializeFragmentsTask
setResultBaseUrl(String sNewResultBaseUrl)
ResultBaseUrl mutatorSerializeFragmentsTask
setResultDirectory(File fNewResultDirectory)
ResultDirectory mutatorSerializeFragmentsTask
setSearchId(long newSearchId)
Setter forsearchId
: The search results ID, if all matches are for export - i.e.SerializeFragmentsTask
setStore(SqlGraphStoreAdministration newStore)
Setter forstore
: Graph store.SerializeFragmentsTask
setTagTarget(boolean newTagTarget)
Setter fortagTarget
: Whether to add an tag identifying the target annotation or not.SerializeFragmentsTask
setUtterances(List<String> vNewUtterances)
Setter forutterances
: Collection of utterances to convert.-
Methods inherited from class nzilbb.labbcat.server.task.Task
defaultThreadName, findTask, findTask, getCreationTime, getDuration, getLastException, getLastKeepAlive, getLog, getMaxLogSize, getResources, getResultTarget, getResultText, getResultUrl, getRunning, getStatus, getStoreCache, getTaskThreadGroup, getWaitToDieMilliseconds, getWho, keepAlive, release, setLastException, setLastKeepAlive, setMaxLogSize, setResources, setResultTarget, setResultText, setResultUrl, setStatus, setStore, setStoreCache, setWaitToDieMilliseconds, setWho, waitToDie, waitToDie
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
SerializeFragmentsTask
public SerializeFragmentsTask(String name, long searchId, Collection<String> layers, String mimeType, SqlGraphStoreAdministration store) throws SQLException
Constructor- Throws:
SQLException
-
-
Method Detail
-
getUtterances
public List<String> getUtterances()
Getter forutterances
: Collection of utterances to convert.- Returns:
- Collection of utterances to convert.
-
setUtterances
public SerializeFragmentsTask setUtterances(List<String> vNewUtterances)
Setter forutterances
: Collection of utterances to convert.- Parameters:
vNewUtterances
- Collection of utterances to convert.
-
getLayers
public Collection<String> getLayers()
Getter forlayers
: Layers selected for serialization.- Returns:
- Layers selected for serialization.
-
setLayers
public SerializeFragmentsTask setLayers(Collection<String> newLayers)
Setter forlayers
: Layers selected for serialization.- Parameters:
newLayers
- Layers selected for serialization.
-
getResultDirectory
public File getResultDirectory()
ResultDirectory accessor- Returns:
- Directory into which the resulting zip file should be copied.
-
setResultDirectory
public SerializeFragmentsTask setResultDirectory(File fNewResultDirectory)
ResultDirectory mutator- Parameters:
fNewResultDirectory
- Directory into which the resulting zip file should be copied.
-
getResultBaseUrl
public String getResultBaseUrl()
ResultBaseUrl accessor- Returns:
- Full base URL for the result - i.e. http://server.name/path/to/result/directory/ - this must not contain the file name and must have a trailing slash.
-
setResultBaseUrl
public SerializeFragmentsTask setResultBaseUrl(String sNewResultBaseUrl)
ResultBaseUrl mutator- Parameters:
sNewResultBaseUrl
- Full base URL for the result - i.e. http://server.name/path/to/result/directory/ - this must not contain the file name and must have a trailing slash.
-
getMimeType
public String getMimeType()
Getter forsMimeType
: MIME type for export- Returns:
- MIME type for export
-
setMimeType
public SerializeFragmentsTask setMimeType(String sNewMimeType)
Setter forsMimeType
: MIME type for export- Parameters:
sNewMimeType
- MIME type for export
-
getBaseUrl
public String getBaseUrl()
Getter forbaseUrl
: Base URL.- Returns:
- Base URL.
-
setBaseUrl
public SerializeFragmentsTask setBaseUrl(String newBaseUrl)
Setter forbaseUrl
: Base URL.- Parameters:
newBaseUrl
- Base URL.
-
getIncludeRequiredLayers
public boolean getIncludeRequiredLayers()
Getter forincludeRequiredLayers
: Whether to include the layers required by the serializer, or only the selected layers.- Returns:
- Whether to include the layers required by the serializer, or only the selected layers.
-
setIncludeRequiredLayers
public SerializeFragmentsTask setIncludeRequiredLayers(boolean newIncludeRequiredLayers)
Setter forincludeRequiredLayers
: Whether to include the layers required by the serializer, or only the selected layers.- Parameters:
newIncludeRequiredLayers
- Whether to include the layers required by the serializer, or only the selected layers.
-
getSearchId
public long getSearchId()
Getter forsearchId
: The search results ID, if all matches are for export - i.e. result.search_id.- Returns:
- The search results ID, if all matches are for export - i.e. result.search_id.
-
setSearchId
public SerializeFragmentsTask setSearchId(long newSearchId)
Setter forsearchId
: The search results ID, if all matches are for export - i.e. result.search_id.- Parameters:
newSearchId
- The search results ID, if all matches are for export - i.e. result.search_id.
-
getCollectionName
public String getCollectionName()
Getter forcollectionName
: Collection Name- Returns:
- Collection Name
-
setCollectionName
public SerializeFragmentsTask setCollectionName(String newCollectionName)
Setter forcollectionName
: Collection Name- Parameters:
newCollectionName
- Collection Name
-
getPrefixNames
public boolean getPrefixNames()
Getter forprefixNames
: Whether to prefix fragment names with a numeric serial number or not.- Returns:
- Whether to prefix fragment names with a numeric serial number or not.
-
setPrefixNames
public SerializeFragmentsTask setPrefixNames(boolean newPrefixNames)
Setter forprefixNames
: Whether to prefix fragment names with a numeric serial number or not.- Parameters:
newPrefixNames
- Whether to prefix fragment names with a numeric serial number or not.
-
getTagTarget
public boolean getTagTarget()
Getter fortagTarget
: Whether to add an tag identifying the target annotation or not.- Returns:
- Whether to add an tag identifying the target annotation or not.
-
setTagTarget
public SerializeFragmentsTask setTagTarget(boolean newTagTarget)
Setter fortagTarget
: Whether to add an tag identifying the target annotation or not.- Parameters:
newTagTarget
- Whether to add an tag identifying the target annotation or not.
-
getStore
public SqlGraphStoreAdministration getStore()
Getter forstore
: Graph store.
-
setStore
public SerializeFragmentsTask setStore(SqlGraphStoreAdministration newStore)
Setter forstore
: Graph store.- Parameters:
newStore
- Graph store.
-
run
public void run()
Run the export
-
cancel
public void cancel()
Description copied from class:Task
Cancels the task.
-
getPercentComplete
public Integer getPercentComplete()
Description copied from class:Task
Determines how far through the task is is.- Specified by:
getPercentComplete
in interfacenzilbb.util.MonitorableTask
- Overrides:
getPercentComplete
in classTask
- Returns:
- An integer between 0 and 100 (inclusive), or null if progress can not be calculated.
-
-