Package com.redwood.scheduler.api.rtx
Interface RTXConsumer
- 
- All Superinterfaces:
- AutoCloseable,- Closeable
 - All Known Implementing Classes:
- RTXWriter
 
 public interface RTXConsumer extends Closeable 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddColumn(RTXColumn column)Add a new column with the name and type of an existing column, the column will be added to the end of this metadata (i.e.voidaddColumn(String columnName, RTXType columnType)Add a new column with the specified name and type, the column will be added to the end of this metadata.voidaddColumn(String columnName, String columnType)Add a new column with the specified name and type, the column will be added to the end of this metadata.voidaddColumns(Collection<RTXColumn> newColumns)Add new columns based on the input columns, the columns will be added in the order that they occur in the list, to the end of this metadata (i.e.voidaddRow(RTXRow row)Adds arowdefault voidaddRow(Object[] data)Adds arowwith the supplied data, where the row will not have a key.default voidaddRow(Object[] data, String key)Adds arowwith the supplied data and key.voidaddSource(RTXSource source)Add a source to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)default voidaddSources(Collection<RTXSource> sources)Add multiple sources to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)voidaddSources(Collection<RTXSource> sources, String prefix)Convenience method to add multiple sources, with a prefix, to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)default voidaddSources(Map<?,RTXSource> sources)Convenience method to add multiple sources to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)default voidaddSources(Map<?,RTXSource> sources, String prefix)Convenience method to add multiple sources, with a prefix, to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)voidclose()default voidcopyColumns(RTXMetadata templateMetadata)Add all columns that are defined in the metadata passed in to the output writer.voidflush()Write any cached data to the underlying output mechanism.RTXMetadatagetMetadata()intgetRowNumber()default RTXRownewRow()Create an empty row (you will need to add it later).voidsetLogger(Logger log)Replace the default logger with anotherLogger.voidsetMetadata(RTXMetadata newMetadata)Sets theRTXMetadata.
 
- 
- 
- 
Method Detail- 
addColumnvoid addColumn(RTXColumn column) Add a new column with the name and type of an existing column, the column will be added to the end of this metadata (i.e. the index of the input column is ignored).- Parameters:
- column- the column to get the name and type from.
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- columnto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
 
 - 
addColumnvoid addColumn(String columnName, RTXType columnType) Add a new column with the specified name and type, the column will be added to the end of this metadata.- Parameters:
- columnName- the column name.
- columnType- the column type.
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- columnto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
 
 - 
addColumnvoid addColumn(String columnName, String columnType) Add a new column with the specified name and type, the column will be added to the end of this metadata.- Parameters:
- columnName- the column name.
- columnType- the column type.
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- columnto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
 
 - 
addColumnsvoid addColumns(Collection<RTXColumn> newColumns) Add new columns based on the input columns, the columns will be added in the order that they occur in the list, to the end of this metadata (i.e. the index of on each input column is ignored).- Parameters:
- newColumns- the columns to get the name and type from.
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- columnto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
 
 - 
addRowdefault void addRow(Object[] data) throws RTXWriterException Adds arowwith the supplied data, where the row will not have a key.- Parameters:
- data- the values for the different cells in the new row. When the row has more columns than supplied in- data, then the rest of the cells will be empty.
- Throws:
- RTXWriterException
- RTXColumnRuntimeException
 
 - 
addRowdefault void addRow(Object[] data, String key) throws RTXWriterException Adds arowwith the supplied data and key.- Parameters:
- data- the values for the different cells in the new row. When the row has more columns than supplied in- data, then the rest of the cells will be empty.
- key- the optional key of this row, which is only a label and can be used as reference to other data structures. No uniqueness is provided and keys cannot be used to access rows directly.
- Throws:
- RTXWriterException
- RTXColumnRuntimeException
 
 - 
addRowvoid addRow(RTXRow row) throws RTXWriterException Adds arow- Parameters:
- row-
- Throws:
- RTXWriterException
- RTXColumnRuntimeException
 
 - 
addSourcevoid addSource(RTXSource source) Add a source to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)- Parameters:
- source-
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- sourceto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
- See Also:
- setMetadata(RTXMetadata)
 
 - 
addSourcesdefault void addSources(Collection<RTXSource> sources) Add multiple sources to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)- Parameters:
- sources-
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- sourceto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
- See Also:
- addSource(RTXSource),- setMetadata(RTXMetadata)
 
 - 
addSourcesvoid addSources(Collection<RTXSource> sources, String prefix) Convenience method to add multiple sources, with a prefix, to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)- Parameters:
- sources-
- prefix-
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- sourceto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
- See Also:
- addSource(RTXSource),- setMetadata(RTXMetadata)
 
 - 
addSourcesdefault void addSources(Map<?,RTXSource> sources) Convenience method to add multiple sources to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)- Parameters:
- sources- a- Mapwith- RTXSourcesas values. The keys of the map are ignored and irrelevant for this method.
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- sourceto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
- See Also:
- addSource(RTXSource),- setMetadata(RTXMetadata)
 
 - 
addSourcesdefault void addSources(Map<?,RTXSource> sources, String prefix) Convenience method to add multiple sources, with a prefix, to theRTXMetadata, which is set previously withsetMetadata(RTXMetadata)- Parameters:
- sources- a- Mapwith- RTXSourcesas values. The keys of the map are ignored and irrelevant for this method.
- prefix-
- Throws:
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- sourceto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
- See Also:
- addSource(RTXSource),- setMetadata(RTXMetadata)
 
 - 
closevoid close() - Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 - 
copyColumnsdefault void copyColumns(RTXMetadata templateMetadata) throws RTXWriterException Add all columns that are defined in the metadata passed in to the output writer.- Parameters:
- templateMetadata-
- Throws:
- RTXWriterException- if an error occurs.
- RTXColumnRuntimeException- if an error occurs.
- RTXMetadataRuntimeException- if an error occurs.
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to add a new- columnto the- RTXMetadata, when already- RTXRowshave been added.
- RTXMetadataReadOnlyRuntimeException- if the metadata is read-only.
 
 - 
flushvoid flush() throws XMLStreamExceptionWrite any cached data to the underlying output mechanism.- Throws:
- XMLStreamException
 
 - 
getMetadataRTXMetadata getMetadata() - Returns:
- the RTXMetadata
- See Also:
- setMetadata(RTXMetadata)
 
 - 
getRowNumberint getRowNumber() - Returns:
- the current row number, i.e. the row number of added rows. Initially it returns 0, meaning no row has been added.
 
 - 
newRowdefault RTXRow newRow() Create an empty row (you will need to add it later).- Returns:
- a new row with the metadata set.
 
 - 
setLoggervoid setLogger(Logger log) Replace the default logger with anotherLogger.- Parameters:
- log-
 
 - 
setMetadatavoid setMetadata(RTXMetadata newMetadata) Sets theRTXMetadata. This is not allowed anymore, when data was already added, but needs to be set before any data is added.- Parameters:
- newMetadata-
- Throws:
- RTXColumnRuntimeException
- RTXInRowDataRuntimeException- when already data have been added. It is not allowed to set new- RTXMetadata, when already- RTXRowshave been added.
- See Also:
- getMetadata()
 
 
- 
 
-