Package tigase.stats

Class StatisticsCollector

All Implemented Interfaces:
ClusteredComponentIfc, Configurable, XMPPService, ConfigurationChangedAware, Initializable, RegistrarBean, ComponentRegistrator, ServerComponent, ShutdownHook, VHostListener

Class StatisticsCollector
Created: Tue Nov 22 07:07:11 2005
Author:
Artur Hefczyc
  • Field Details

  • Constructor Details

    • StatisticsCollector

      public StatisticsCollector()
  • Method Details

    • componentAdded

      public void componentAdded(StatisticsContainer component)
      Description copied from class: AbstractComponentRegistrator
      Method provides a callback mechanism signaling that a new component implementing special interface has been added to the internal components collection.
      Specified by:
      componentAdded in class AbstractComponentRegistrator<StatisticsContainer>
      Parameters:
      component - is a reference to the component just added to the collection.
    • componentRemoved

      public void componentRemoved(StatisticsContainer component)
      Description copied from class: AbstractComponentRegistrator
      Method provides a callback mechanism signaling that a component implementing special interface has been removed from the internal components collection.
      Specified by:
      componentRemoved in class AbstractComponentRegistrator<StatisticsContainer>
      Parameters:
      component - is a reference to the component removed from the collection.
    • initializationCompleted

      public void initializationCompleted()
      Description copied from interface: ServerComponent
      Method is called by MessageRouter when all the startup components of the server have been loaded and configured through setProperties(...) call. At this point the whole server should be loaded and functional, except initializations taking place in this routine.
      Specified by:
      initializationCompleted in interface ServerComponent
      Overrides:
      initializationCompleted in class BasicComponent
    • processPacket

      public void processPacket(Packet packet, Queue<Packet> results)
      Description copied from interface: ServerComponent
      processPacket is a blocking processing method implemented by all components. This method processes packet and returns results instantly without waiting for any resources.
      Specified by:
      processPacket in interface ServerComponent
      Overrides:
      processPacket in class BasicComponent
      Parameters:
      packet - a Packet value
    • release

      public void release()
      Description copied from interface: ServerComponent
      Method called when component is being stopped and unloaded.
      Specified by:
      release in interface ServerComponent
      Overrides:
      release in class AbstractComponentRegistrator<StatisticsContainer>
    • shutdown

      public String shutdown()
      Specified by:
      shutdown in interface ShutdownHook
    • getAllStats

      public StatisticsList getAllStats()
    • getAllStats

      public void getAllStats(StatisticsList list)
    • getComponentsNames

      public List<String> getComponentsNames()
    • getComponentStats

      public void getComponentStats(String name, StatisticsList list)
    • getDiscoFeatures

      public List<Element> getDiscoFeatures(JID from)
      Description copied from class: BasicComponent
      Method returns list of features provided by this component for provided JID.
      Specified by:
      getDiscoFeatures in interface XMPPService
      Overrides:
      getDiscoFeatures in class BasicComponent
      Parameters:
      from - a request sender address. Some service disco elements are meant to be available only to system administrarors. The component is responsible to check whether the sender is the component administrator and return results appropriate.
      Returns:
      list of features
    • getDiscoInfo

      public Element getDiscoInfo(String node, JID jid, JID from)
      Description copied from interface: XMPPService
      Returns service discovery info for the component. If the jid is null then this is info for the top level request. SM may return disco info on the top level. Other components should not.
      Specified by:
      getDiscoInfo in interface XMPPService
      Overrides:
      getDiscoInfo in class BasicComponent
      Parameters:
      node - is service discovery node for which the request is made. Is normally null for the component top level request.
      jid - is the jid to which the request has been made.
      from - is the request sender address. Some service discovery information is only meant for administrators.
      Returns:
      returns an XML Element with service discovery data.
    • getDiscoItems

      public List<Element> getDiscoItems(String node, JID jid, JID from)
      Description copied from interface: XMPPService
      Returns service discovery items for the component. If the JID is null then this is request for the top level request. SM may return disco items on the top level, other components should just return it's top level service discovery item for null node.
      Specified by:
      getDiscoItems in interface XMPPService
      Overrides:
      getDiscoItems in class BasicComponent
      Parameters:
      node - is a service discovery node for which the request has been made.
      jid - is the jid to which the request has been made.
      from - is the request sender address. Some service discovery information is only meant for administrators.
      Returns:
      a list of service discovery items for this component or the component itself disco item for the top level request.
    • getName

      public String getName()
      Description copied from interface: ServerComponent
      Method returns name of the component.
      Specified by:
      getName in interface ServerComponent
      Specified by:
      getName in interface ShutdownHook
      Overrides:
      getName in class BasicComponent
      Returns:
      name of the component
    • setName

      public void setName(String name)
      Description copied from interface: ServerComponent
      Method used to assign component name (localpart of the component)
      Specified by:
      setName in interface ServerComponent
      Overrides:
      setName in class BasicComponent
      Parameters:
      name - to be assigned
    • isCorrectType

      public boolean isCorrectType(ServerComponent component)
      Description copied from class: AbstractComponentRegistrator
      Method checks whether the component provides as method parameter is correct type that is implements special interface or extends special class. Result of the method determines whether the component can be added to the internal components collection.
      Specified by:
      isCorrectType in class AbstractComponentRegistrator<StatisticsContainer>
      Parameters:
      component - is a reference to the component being checked.
      Returns:
      a boolean value of true if the component is of a correct type and false otherwise.
    • register

      public void register(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called when bean is being registered allowing developer to programatically register other beans.
      Specified by:
      register in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope
    • unregister

      public void unregister(Kernel kernel)
      Description copied from interface: RegistrarBean
      Method called while bean is being unregistered.
      Specified by:
      unregister in interface RegistrarBean
      Parameters:
      kernel - - instance from local scope
    • setArchivizers

      public void setArchivizers(StatisticsArchivizerIfc[] archivizers)
    • statsUpdated

      protected void statsUpdated()