public class XmlResponseQueueTransformer extends AbstractXmlTransformer implements QueryResponseTransformer
SourceResponse
object into Metacard Element XML text, which is GML 3.1.1.
compliant XML.Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE |
MIME_TYPE
Constructor and Description |
---|
XmlResponseQueueTransformer(Parser parser,
ForkJoinPool fjp,
PrintWriterProvider pwp,
MetacardMarshaller mcm,
MimeType mimeType)
Constructs a transformer that will convert query responses to XML.
|
Modifier and Type | Method and Description |
---|---|
void |
setThreshold(int threshold) |
BinaryContent |
transform(SourceResponse response,
Map<String,Serializable> args)
Transforms the list of results into the
BinaryContent . |
getParser, getParserConfigurator
public static final int BUFFER_SIZE
public XmlResponseQueueTransformer(Parser parser, ForkJoinPool fjp, PrintWriterProvider pwp, MetacardMarshaller mcm, MimeType mimeType)
ForkJoinPool
is
used for splitting large collections of Metacard
s into smaller collections for
concurrent processing. Currently injected through Blueprint, if we choose to use fork-join for
other tasks in the application, we should move the construction of the pool from its current
location. Conversely, if we move to Java 8 we can simply use the new commonPool
static
method provided on ForkJoinPool
.fjp
- the ForkJoinPool
to injectpublic void setThreshold(int threshold)
threshold
- the fork threshold: result lists smaller than this size will be processed
serially; larger than this size will be processed in threshold-sized chunks in parallelpublic BinaryContent transform(SourceResponse response, Map<String,Serializable> args) throws CatalogTransformerException
QueryResponseTransformer
BinaryContent
.transform
in interface QueryResponseTransformer
args
- the arguments that may be used to execute the transformCatalogTransformerException
- if the response cannot be transformedThis work is licensed under a Creative Commons Attribution 4.0 International License.