Class OSGiBasedTicketerPlugin

  • All Implemented Interfaces:
    Plugin

    public class OSGiBasedTicketerPlugin
    extends java.lang.Object
    implements Plugin
    Ticketer plugin that reference an implementation pulled from the OSGi Service Registry. The first plugin to be registered is used until it is unregistered.
    Author:
    jwhite
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Ticket get​(java.lang.String ticketId)
      DAO like get method to be implemented by HelpDesk specific plugin.
      Plugin getTicketerPlugin()
      Retrieves the plugin that is currently registered.
      void registerTicketerPlugin​(Plugin plugin, java.util.Map<java.lang.String,​java.lang.String> attributes)
      Registers the Plugin use.
      void saveOrUpdate​(Ticket ticket)
      DAO like saveOrUpdate method to be implemented by HelpDesk specific plugin.
      boolean unregisterTicketerPlugin​(Plugin plugin, java.util.Map<java.lang.String,​java.lang.String> attributes)
      Unregisters a previously registered Plugin use.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OSGiBasedTicketerPlugin

        public OSGiBasedTicketerPlugin()
    • Method Detail

      • get

        public Ticket get​(java.lang.String ticketId)
                   throws PluginException
        Description copied from interface: Plugin
        DAO like get method to be implemented by HelpDesk specific plugin.
        Specified by:
        get in interface Plugin
        Parameters:
        ticketId - a String object.
        Returns:
        a Ticket object.
        Throws:
        PluginException - if any.
      • registerTicketerPlugin

        public void registerTicketerPlugin​(Plugin plugin,
                                           java.util.Map<java.lang.String,​java.lang.String> attributes)
        Registers the Plugin use. Only the first registered plugin will be used. This method is called by the OSGi Service Registry when a service implementing the Plugin interface is registered.
        Parameters:
        plugin - the plugin
        attributes - service-level attributes for the plugin
      • unregisterTicketerPlugin

        public boolean unregisterTicketerPlugin​(Plugin plugin,
                                                java.util.Map<java.lang.String,​java.lang.String> attributes)
                                         throws java.lang.Exception
        Unregisters a previously registered Plugin use. This method is called by the OSGi Service Registry when a service implementing the Plugin interface is unregistered.
        Parameters:
        plugin - the plugin
        attributes - service-level attributes for the plugin
        Returns:
        true if the plugin was previously in use, false otherwise
        Throws:
        java.lang.Exception
      • getTicketerPlugin

        public Plugin getTicketerPlugin()
                                 throws PluginException
        Retrieves the plugin that is currently registered. If no plugin is currently registered, this full will throw a PluginException instead of returning null.
        Returns:
        the currently registered plugin
        Throws:
        PluginException - when no plugin is currently registered