public abstract class AbstractExportWriter extends AbstractNurseryService implements ExportWriter
GenericService.StartCommand, GenericService.StopCommand
CLASS_VERSION
mLogger, state
Constructor and Description |
---|
AbstractExportWriter() |
Modifier and Type | Method and Description |
---|---|
protected nu.xom.Element |
build(IOObject pObject,
ExportConfiguration pConfiguration) |
protected void |
configure(ExportConfiguration pConfiguration,
nu.xom.Serializer pSerializer)
Configures the serializer.
|
protected nu.xom.Serializer |
createSerializer(OutputStream pOutputStream,
String pEncoding,
ExportConfiguration pConfiguration)
Creates the serializer that will be used when exporting.
|
protected List<neo.xredsys.content.type.Field> |
findBinaryFields(Article pObject) |
ExporterFactory |
getExporterFactory() |
protected URI |
getExportPath(Article pArticle,
ExportConfiguration pConfiguration) |
ObjectLoader |
getObjectLoader() |
protected abstract OutputStream |
getOutputStream(IOObject pObject,
URI pBaseURI)
Returns a outputstream for the given IOObject
|
com.escenic.storage.Storage |
getStorage() |
neo.xredsys.api.transformer.TransformerFactory |
getTransformerFactory() |
TypeManager |
getTypeManager() |
protected void |
postExport()
Post export callback.
|
void |
setExporterFactory(ExporterFactory pExporterFactory) |
void |
setObjectLoader(ObjectLoader pObjectLoader) |
void |
setStorage(com.escenic.storage.Storage pStorage) |
void |
setTransformerFactory(neo.xredsys.api.transformer.TransformerFactory pFactory) |
void |
setTypeManager(TypeManager pTypeManager) |
protected void |
startService()
Is called by
AbstractNurseryService.doStartService() when the NurseryService is being started. |
protected void |
startWriter() |
protected void |
stopService()
Is called by
AbstractNurseryService.doStopService() when the service is being shut down. |
protected void |
stopWriter() |
void |
writeObject(IOObject pObject,
ExportConfiguration pConfiguration)
Write the object using the given export configuration.
|
doStartService, doStopService, stopIdleService
assertServiceRunning, getServiceDescription, getServiceMessage, getServiceState, isServiceEnabled, isServiceFailed, isServiceIdle, isServiceRunning, isServiceShutdownFailed, isServiceStopped, setServiceDescription, setServiceEnabled, start, stop, validateIsTrue, validateNotNull
public void writeObject(IOObject pObject, ExportConfiguration pConfiguration)
ExportWriter
writeObject
in interface ExportWriter
pObject
- the object to exportpConfiguration
- the configuration to use.protected nu.xom.Element build(IOObject pObject, ExportConfiguration pConfiguration)
protected URI getExportPath(Article pArticle, ExportConfiguration pConfiguration) throws IOException
IOException
protected abstract OutputStream getOutputStream(IOObject pObject, URI pBaseURI) throws IOException
pObject
- the object to writepBaseURI
- the URI to export toIOException
- if an I/O exception occursExportException
- if a export exception occursprotected void postExport() throws IOException
IOException
- if an I/O exception occurspublic ObjectLoader getObjectLoader()
public TypeManager getTypeManager()
public void setObjectLoader(ObjectLoader pObjectLoader)
public void setTypeManager(TypeManager pTypeManager)
public com.escenic.storage.Storage getStorage()
public void setStorage(com.escenic.storage.Storage pStorage)
public void setTransformerFactory(neo.xredsys.api.transformer.TransformerFactory pFactory)
public neo.xredsys.api.transformer.TransformerFactory getTransformerFactory()
public ExporterFactory getExporterFactory()
public void setExporterFactory(ExporterFactory pExporterFactory)
protected nu.xom.Serializer createSerializer(OutputStream pOutputStream, String pEncoding, ExportConfiguration pConfiguration)
protected void configure(ExportConfiguration pConfiguration, nu.xom.Serializer pSerializer)
createSerializer(java.io.OutputStream, String, ExportConfiguration)
pConfiguration
- the current configurationpSerializer
- the serializer to configureprotected final void startService() throws IllegalStateException, IllegalArgumentException, Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStartService()
when the NurseryService
is being started. Exceptions thrown by this
method are logged by AbstractNurseryService.doStartService()
.
Subclasses must implement this method to bootstrap the service.
startService
in class AbstractNurseryService
IllegalStateException
- when this service is in the wrong state for startup. Used to signal to AbstractNurseryService.doStartService()
that it is OK to try to starting
this service
later. GenericService.isServiceRunning()
returns false
and GenericService.isServiceIdle()
returns true
.IllegalArgumentException
- when the configuration of the service
is invalid. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.Exception
- when something goes wrong during startup. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.AbstractNurseryService.doStartService()
protected void startWriter() throws IllegalStateException, IllegalArgumentException, Exception
protected void stopWriter() throws IllegalStateException, Exception
IllegalStateException
Exception
protected final void stopService() throws IllegalStateException, Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStopService()
when the service
is being shut down. Exceptions thrown by this
method are logged by AbstractNurseryService.doStopService()
.
Subclasses must implement this method to shut down the service.
stopService
in class AbstractNurseryService
IllegalStateException
- when this service is in the wrong state for shutdown. Used to signal to AbstractNurseryService.doStopService()
that
it is OK to try stopping this service
later. GenericService.isServiceRunning()
returns true
.Exception
- when something goes during shutdown. GenericService.isServiceRunning()
returns false
and
GenericService.isServiceShutdownFailed()
returns true
.AbstractNurseryService.doStopService()
© 1998- 2018 Stibo DX