Interface InventoryPrinter


  • @ConsumerType
    public interface InventoryPrinter
    The InventoryPrinter is a service interface to be implemented by providers which want to hook into the display of the current configuration and state of the OSGi framework and application.

    The following service registration properties further declare the InventoryPrinter service:

    • FORMAT - the supported formats
    • TITLE - the printer title
    • NAME - the printer name
    • WEBCONSOLE - whether to confine the printer to the Web Console
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FORMAT
      The property defining one or more supported formats.
      static java.lang.String NAME
      The unique name (or label) of the printer.
      static java.lang.String SERVICE
      The service name under which services of this class must be registered to be picked for inclusion in the configuration report.
      static java.lang.String TITLE
      The title displayed by tools when this printer is used.
      static java.lang.String WEBCONSOLE
      The inventory printer feature has first class integration with the Apache Felix Web Console.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void print​(java.io.PrintWriter printWriter, Format format, boolean isZip)
      Prints the configuration report to the given printWriter.
    • Field Detail

      • SERVICE

        static final java.lang.String SERVICE
        The service name under which services of this class must be registered to be picked for inclusion in the configuration report.
        See Also:
        Constant Field Values
      • FORMAT

        static final java.lang.String FORMAT
        The property defining one or more supported formats. The value of this property is either a string, a string array or a Collection containing valid names of the constants defined in the Format class.

        Any unknown formats are ignored. If this property is not declared or does not declare any known formats, the Format.TEXT format is assumed as the printer's supported format.

        See Also:
        Constant Field Values
      • NAME

        static final java.lang.String NAME
        The unique name (or label) of the printer.

        If this property is missing or an empty string, the name is constructed from the string InventoryPrinter and the service's service.id property.

        See Also:
        Constant Field Values
      • TITLE

        static final java.lang.String TITLE
        The title displayed by tools when this printer is used. It should be descriptive but short.

        If this property is missing or an empty string, the NAME value is used as the title.

        See Also:
        Constant Field Values
      • WEBCONSOLE

        static final java.lang.String WEBCONSOLE
        The inventory printer feature has first class integration with the Apache Felix Web Console. This service registration property can be used to hide an inventory printer service from the Web Console. The service will still be called to generate the single file or ZIP file output of inventory printers.

        By default, a printer is displayed in the web console, unless this property is set to false. The property value can either be a boolean or a string.

        See Also:
        Constant Field Values
    • Method Detail

      • print

        void print​(java.io.PrintWriter printWriter,
                   Format format,
                   boolean isZip)
        Prints the configuration report to the given printWriter. Implementations are free to print whatever information they deem useful.

        If a printer is invoked with a format it doesn't support ( FORMAT) the printer should just do/print nothing and directly return.

        A printer might be used in one of two different situations: either for directly displaying the information to a user (like in the web console) or the output is included in a ZIP. The printer might want to return different output depending on the usage situation.

        Parameters:
        printWriter - where to write the data. Implementations may flush the writer but must not close it.
        format - The render format.
        isZip - whether this is included in a ZIP file or used directly