Class CatalogOutputAdapter
java.lang.Object
org.codice.alliance.imaging.chip.transformer.CatalogOutputAdapter
Performs various conversion functions required to wire the CatalogFramework interface to the
MetacardTransformer interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.codice.ddf.platform.util.TemporaryFileBackedOutputStreamThis method exists so unit tests can override and create a different TFBOS for testing exceptions.ddf.catalog.data.BinaryContentgetBinaryContent(BufferedImage image) getImage(ddf.catalog.operation.ResourceResponse resourceResponse) ddf.catalog.data.BinaryContentgetNitfBinaryContent(BufferedImage chip, org.codice.imaging.nitf.fluent.NitfSegmentsFlow nitfSegmentsFlow, int sourceX, int sourceY) Create a NITF of a chip that extracted from another NITF.org.codice.imaging.nitf.fluent.NitfSegmentsFlowgetNitfSegmentsFlow(ddf.catalog.operation.ResourceResponse resourceResponse) voidwrapException(Exception exception)
-
Constructor Details
-
CatalogOutputAdapter
-
-
Method Details
-
getImage
public BufferedImage getImage(ddf.catalog.operation.ResourceResponse resourceResponse) throws IOException - Parameters:
resourceResponse- a ResourceResponse object returned by CatalogFramework.- Returns:
- the requested BufferedImage.
- Throws:
IOException- when there's a problem reading the image from the ResourceResponse InputStream.
-
getBinaryContent
public ddf.catalog.data.BinaryContent getBinaryContent(BufferedImage image) throws IOException, javax.activation.MimeTypeParseException - Parameters:
image- the BufferedImage to be converted.- Returns:
- a BinaryContent object containing the image data.
- Throws:
IOException- when the BufferedImage can't be written to temporary in-memory space.javax.activation.MimeTypeParseException- thrown if the mime type is invalid
-
getNitfSegmentsFlow
public org.codice.imaging.nitf.fluent.NitfSegmentsFlow getNitfSegmentsFlow(ddf.catalog.operation.ResourceResponse resourceResponse) throws org.codice.imaging.nitf.core.common.NitfFormatException, IOException - Parameters:
resourceResponse- resource response from the catalog framework- Returns:
- the nitf segments
- Throws:
org.codice.imaging.nitf.core.common.NitfFormatExceptionIOException
-
createTemporaryFileBackedOutputStream
protected org.codice.ddf.platform.util.TemporaryFileBackedOutputStream createTemporaryFileBackedOutputStream()This method exists so unit tests can override and create a different TFBOS for testing exceptions. -
getNitfBinaryContent
public ddf.catalog.data.BinaryContent getNitfBinaryContent(BufferedImage chip, org.codice.imaging.nitf.fluent.NitfSegmentsFlow nitfSegmentsFlow, int sourceX, int sourceY) throws IOException, javax.activation.MimeTypeParseException, org.codice.imaging.nitf.core.common.NitfFormatException Create a NITF of a chip that extracted from another NITF.- Parameters:
chip- the image data for the chipped areanitfSegmentsFlow- the segments from the original nitfsourceX- the x pixel coordinates of the original nitf where the chip was extractedsourceY- the y pixel coordinates of the original nitf where the chip was extracted- Returns:
- a nitf file containing the chip
- Throws:
IOExceptionjavax.activation.MimeTypeParseExceptionorg.codice.imaging.nitf.core.common.NitfFormatException
-
wrapException
public void wrapException(Exception exception) throws ddf.catalog.transform.CatalogTransformerException - Parameters:
exception- the exception to be wrapped.- Throws:
ddf.catalog.transform.CatalogTransformerException- in every case.
-