Interface PaperCatalogService

  • All Known Implementing Classes:
    PaperCatalog

    public interface PaperCatalogService

    Provides an interface for a PaperCatalog service. The purpose of this interface is to expose an implementation of a PaperCatalog as an OSGi service.

    To comply with this interface, an implementation must be thread safe and address both the possibility that only a single instance is created and used throughout and that new instances are created as desired.

    • Method Detail

      • get

        Paper get​(String identifier)
        Gets a paper by identifier.
        Parameters:
        identifier - the identifier of the paper
        Returns:
        returns the paper
      • list

        Collection<Paper> list()
        Lists all available papers.
        Returns:
        returns a list of papers
      • list

        Collection<Paper> list​(PaperFilter filter)
        Lists available papers that the filter accepts.
        Parameters:
        filter - the filter
        Returns:
        returns a list of papers
      • addNewSheetPaper

        boolean addNewSheetPaper​(String name,
                                 String desc,
                                 Length width,
                                 Length height)
        Adds a new sheet paper to the collection.
        Parameters:
        name - the name
        desc - the description
        width - the width
        height - the height
        Returns:
        true if the paper was added successfully, false otherwise
      • addNewTractorPaper

        boolean addNewTractorPaper​(String name,
                                   String desc,
                                   Length across,
                                   Length along)
        Adds a new tractor paper to the collection.
        Parameters:
        name - the name
        desc - the description
        across - the length across the feed
        along - the length along the feed
        Returns:
        true if the paper was added successfully, false otherwise
      • addNewRollPaper

        boolean addNewRollPaper​(String name,
                                String desc,
                                Length across)
        Adds a new roll paper to the collection.
        Parameters:
        name - the name
        desc - the description
        across - the length across the feed
        Returns:
        true if the paper was added successfully, false otherwise
      • isRemovable

        boolean isRemovable​(Paper paper)
        Returns true if the paper can be removed, false otherwise.
        Parameters:
        paper - the paper
        Returns:
        true if the paper can be removed, false otherwise
      • remove

        boolean remove​(Paper p)
        Removes the specified paper from the collection.
        Parameters:
        p - the paper to remove
        Returns:
        true if the paper was successfully removed, false otherwise