Package gov.usgs.earthquake.product.io
Class FilterProductHandler
- java.lang.Object
-
- gov.usgs.earthquake.product.io.FilterProductHandler
-
- All Implemented Interfaces:
ProductHandler
public class FilterProductHandler extends java.lang.Object implements ProductHandler
Filter calls to another ProductHandler. By default, calls are passed directly on to the wrapped ProductOutput.
-
-
Constructor Summary
Constructors Constructor Description FilterProductHandler()
Create a new FilterProductHandler.FilterProductHandler(ProductHandler output)
Create a new FilterProductHandler using and existing ProductOutput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Free any resources associated with this source.void
onBeginProduct(ProductId id, java.lang.String status, java.net.URL trackerURL)
Calls the wrapped ProductOutput onBeginProduct method.void
onContent(ProductId id, java.lang.String path, Content content)
Calls the wrapped ProductOutput onContent method.void
onEndProduct(ProductId id)
Calls the wrapped ProductOutput onEndProduct method.void
onLink(ProductId id, java.lang.String relation, java.net.URI href)
Calls the wrapped ProductOutput onLink method.void
onProperty(ProductId id, java.lang.String name, java.lang.String value)
Calls the wrapped ProductOutput onProperty method.void
onSignature(ProductId id, java.lang.String signature)
Calls the wrapped ProductOutput onSignature method.void
onSignatureVersion(ProductId id, CryptoUtils.Version version)
Product signature version.void
setProductOutput(ProductHandler output)
Set the wrapped ProductOutput.
-
-
-
Constructor Detail
-
FilterProductHandler
public FilterProductHandler()
Create a new FilterProductHandler. A ProductOutput should be set using setProductOutput before any calls to other methods.
-
FilterProductHandler
public FilterProductHandler(ProductHandler output)
Create a new FilterProductHandler using and existing ProductOutput.- Parameters:
output
- the ProductOutput to wrap.
-
-
Method Detail
-
setProductOutput
public void setProductOutput(ProductHandler output)
Set the wrapped ProductOutput.- Parameters:
output
- the ProductOutput being wrapped.
-
onBeginProduct
public void onBeginProduct(ProductId id, java.lang.String status, java.net.URL trackerURL) throws java.lang.Exception
Calls the wrapped ProductOutput onBeginProduct method.- Specified by:
onBeginProduct
in interfaceProductHandler
- Parameters:
id
- which product.status
- the product's status.trackerURL
- a location to send status updates.- Throws:
java.lang.Exception
- if error occurs
-
onContent
public void onContent(ProductId id, java.lang.String path, Content content) throws java.lang.Exception
Calls the wrapped ProductOutput onContent method.- Specified by:
onContent
in interfaceProductHandler
- Parameters:
id
- which product.path
- path to content within product.content
- the product content.- Throws:
java.lang.Exception
- if error occurs
-
onEndProduct
public void onEndProduct(ProductId id) throws java.lang.Exception
Calls the wrapped ProductOutput onEndProduct method.- Specified by:
onEndProduct
in interfaceProductHandler
- Parameters:
id
- which product.- Throws:
java.lang.Exception
- if error occurs
-
onLink
public void onLink(ProductId id, java.lang.String relation, java.net.URI href) throws java.lang.Exception
Calls the wrapped ProductOutput onLink method.- Specified by:
onLink
in interfaceProductHandler
- Parameters:
id
- which product.relation
- how the URI is related to this product.href
- the URI that is related to this product.- Throws:
java.lang.Exception
- if error occurs
-
onProperty
public void onProperty(ProductId id, java.lang.String name, java.lang.String value) throws java.lang.Exception
Calls the wrapped ProductOutput onProperty method.- Specified by:
onProperty
in interfaceProductHandler
- Parameters:
id
- which product.name
- the property name.value
- the property value.- Throws:
java.lang.Exception
- if error occurs
-
onSignatureVersion
public void onSignatureVersion(ProductId id, CryptoUtils.Version version) throws java.lang.Exception
Description copied from interface:ProductHandler
Product signature version.- Specified by:
onSignatureVersion
in interfaceProductHandler
- Parameters:
id
- which product.version
- product version- Throws:
java.lang.Exception
- if error occurs
-
onSignature
public void onSignature(ProductId id, java.lang.String signature) throws java.lang.Exception
Calls the wrapped ProductOutput onSignature method.- Specified by:
onSignature
in interfaceProductHandler
- Parameters:
id
- which product.signature
- the product signature, which can be verified using the ProductSigner class.- Throws:
java.lang.Exception
- if error occurs
-
close
public void close()
Free any resources associated with this source.- Specified by:
close
in interfaceProductHandler
-
-