Class AbstractServiceCollector

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEffectiveLocation​(java.lang.String location)
      Allows the collector to override the location at which it should be run.
      java.util.Map<java.lang.String,​java.lang.Object> getRuntimeAttributes​(CollectionAgent agent, java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Invoked before every call to #collect(CollectionAgent, EventProxy, Map) in order to retrieve state/runtime information required for perform the collection.
      void initialize()
      Initialize the collector.
      java.util.Map<java.lang.String,​java.lang.String> marshalParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call.
      java.util.Map<java.lang.String,​java.lang.Object> unmarshalParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
      Unmarshal the parameter values from strings.
      void validateAgent​(CollectionAgent agent, java.util.Map<java.lang.String,​java.lang.Object> parameters)
      Validate whether or not this collector should be scheduled to run against the given agent.
      • Methods inherited from class java.lang.Object

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

      • AbstractServiceCollector

        public AbstractServiceCollector()
    • Method Detail

      • getRuntimeAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getRuntimeAttributes​(CollectionAgent agent,
                                                                                           java.util.Map<java.lang.String,​java.lang.Object> parameters)
        Description copied from interface: ServiceCollector
        Invoked before every call to #collect(CollectionAgent, EventProxy, Map) in order to retrieve state/runtime information required for perform the collection. This call will always be performed in OpenNMS.
        Specified by:
        getRuntimeAttributes in interface ServiceCollector
        Parameters:
        agent - Includes details about to the agent from which we wish to collect.
        parameters - Includes the service parameters defined in collectd-configuration.xml.
        Returns:
        Additional attributes, which should be added to the parameter map before calling #collect(CollectionAgent, EventProxy, Map).
      • getEffectiveLocation

        public java.lang.String getEffectiveLocation​(java.lang.String location)
        Description copied from interface: ServiceCollector
        Allows the collector to override the location at which it should be run. This call will always be performed in OpenNMS.
        Specified by:
        getEffectiveLocation in interface ServiceCollector
        Parameters:
        location - location associated with the service to be monitored
        Returns:
        a possibly updated location
      • marshalParameters

        public java.util.Map<java.lang.String,​java.lang.String> marshalParameters​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
        Description copied from interface: ServiceCollector
        Marshal the parameter values to strings, which is necessary for passing the parameters over the wire for the RPC call. We delegate this task to the ServiceCollector instead of handling it elsewhere since the API, and RPC module do not have access to the model objects used by the collector. This will only be called in OpenNMS when the collector is to be executed remotely.
        Specified by:
        marshalParameters in interface ServiceCollector
        Returns:
      • unmarshalParameters

        public java.util.Map<java.lang.String,​java.lang.Object> unmarshalParameters​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Description copied from interface: ServiceCollector
        Unmarshal the parameter values from strings. This call will always be performed in Minion.
        Specified by:
        unmarshalParameters in interface ServiceCollector
        Returns: