Class 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 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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler
        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 interface ProductHandler