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 voidcancel()Cancels the task.StringgetBaseUrl()Getter forbaseUrl: Base URL.StringgetCollectionName()Getter forcollectionName: Collection NamebooleangetIncludeRequiredLayers()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.StringgetMimeType()Getter forsMimeType: MIME type for exportIntegergetPercentComplete()Determines how far through the task is is.booleangetPrefixNames()Getter forprefixNames: Whether to prefix fragment names with a numeric serial number or not.StringgetResultBaseUrl()ResultBaseUrl accessorFilegetResultDirectory()ResultDirectory accessorlonggetSearchId()Getter forsearchId: The search results ID, if all matches are for export - i.e.SqlGraphStoreAdministrationgetStore()Getter forstore: Graph store.booleangetTagTarget()Getter fortagTarget: Whether to add an tag identifying the target annotation or not.List<String>getUtterances()Getter forutterances: Collection of utterances to convert.voidrun()Run the exportSerializeFragmentsTasksetBaseUrl(String newBaseUrl)Setter forbaseUrl: Base URL.SerializeFragmentsTasksetCollectionName(String newCollectionName)Setter forcollectionName: Collection NameSerializeFragmentsTasksetIncludeRequiredLayers(boolean newIncludeRequiredLayers)Setter forincludeRequiredLayers: Whether to include the layers required by the serializer, or only the selected layers.SerializeFragmentsTasksetLayers(Collection<String> newLayers)Setter forlayers: Layers selected for serialization.SerializeFragmentsTasksetMimeType(String sNewMimeType)Setter forsMimeType: MIME type for exportSerializeFragmentsTasksetPrefixNames(boolean newPrefixNames)Setter forprefixNames: Whether to prefix fragment names with a numeric serial number or not.SerializeFragmentsTasksetResultBaseUrl(String sNewResultBaseUrl)ResultBaseUrl mutatorSerializeFragmentsTasksetResultDirectory(File fNewResultDirectory)ResultDirectory mutatorSerializeFragmentsTasksetSearchId(long newSearchId)Setter forsearchId: The search results ID, if all matches are for export - i.e.SerializeFragmentsTasksetStore(SqlGraphStoreAdministration newStore)Setter forstore: Graph store.SerializeFragmentsTasksetTagTarget(boolean newTagTarget)Setter fortagTarget: Whether to add an tag identifying the target annotation or not.SerializeFragmentsTasksetUtterances(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:TaskCancels the task.
-
getPercentComplete
public Integer getPercentComplete()
Description copied from class:TaskDetermines how far through the task is is.- Specified by:
getPercentCompletein interfacenzilbb.util.MonitorableTask- Overrides:
getPercentCompletein classTask- Returns:
- An integer between 0 and 100 (inclusive), or null if progress can not be calculated.
-
-