Class NullRrdStrategy

    • Constructor Detail

      • NullRrdStrategy

        public NullRrdStrategy()
    • Method Detail

      • closeFile

        public void closeFile​(Object rrd)
        Description copied from interface: RrdStrategy
        This closes the supplied round robin database
        Specified by:
        closeFile in interface RrdStrategy<Object,​Object>
        Parameters:
        rrd - an rrd object created using openFile
      • createDefinition

        public Object createDefinition​(String creator,
                                       String directory,
                                       String rrdName,
                                       int step,
                                       List<RrdDataSource> dataSources,
                                       List<String> rraList)
        Description copied from interface: RrdStrategy
        Create a round robin database definition from the supplied parameters. This definition is used in the createFile call to create the actual file.
        Specified by:
        createDefinition in interface RrdStrategy<Object,​Object>
        Parameters:
        creator - - A string representing who is creating this file for use in log msgs
        directory - - The directory to create the file in
        rrdName - - The name to use for the round robin database
        step - - the step for the database
        dataSources - - the data sources to use for round robin database
        rraList - - a List of the round robin archives to create in the database. defines after which time the data is condensed to a defined lower step
        Returns:
        an object representing the definition of an round robin database. Can be null if the database exists already.
      • createFile

        public void createFile​(Object rrdDef)
        Description copied from interface: RrdStrategy
        Creates the round robin database defined by the supplied definition. Should be able to handle rrdDef being null.
        Specified by:
        createFile in interface RrdStrategy<Object,​Object>
        Parameters:
        rrdDef - an round robin database definition created using the createDefinition call.
      • createGraph

        public InputStream createGraph​(String command,
                                       File workDir)
        Description copied from interface: RrdStrategy
        Creates an InputStream representing the bytes of a graph created from round robin data. It accepts an rrdtool graph command. The underlying implementation converts this command to a format appropriate for it .
        Specified by:
        createGraph in interface RrdStrategy<Object,​Object>
        Parameters:
        command - the command needed to create the graph
        workDir - the directory that all referenced files are relative to
        Returns:
        an input stream representing the bytes of a graph image as a PNG file
      • createGraphReturnDetails

        public RrdGraphDetails createGraphReturnDetails​(String command,
                                                        File workDir)
        Description copied from interface: RrdStrategy
        Creates an RrdGraphDetails object representing the graph created from round robin data. It accepts an rrdtool graph command. The underlying implementation converts this command to a format appropriate for it .
        Specified by:
        createGraphReturnDetails in interface RrdStrategy<Object,​Object>
        Parameters:
        command - the command needed to create the graph
        workDir - the directory that all referenced files are relative to
        Returns:
        details for the graph including an InputStream, any PRINTed lines, and graph dimensions.
      • fetchLastValue

        public Double fetchLastValue​(String rrdFile,
                                     String ds,
                                     int interval)
        Description copied from interface: RrdStrategy
        Fetches the last value from the round robin database with the given name. The interval passed in should be the interval associated with the round robin database.
        Specified by:
        fetchLastValue in interface RrdStrategy<Object,​Object>
        Parameters:
        rrdFile - a name the represents a round robin database
        ds - a name the represents a data source to be used
        interval - a step interval of the round robin database
        Returns:
        The last value as a Double (if the last value didn't exist returns a Double.NaN)
      • fetchLastValueInRange

        public Double fetchLastValueInRange​(String rrdFile,
                                            String ds,
                                            int interval,
                                            int range)
        Description copied from interface: RrdStrategy
        Fetches the last value from the round robin database with the given name within a time range. The interval passed in should be the interval associated with the round robin database. The range should be the amount of "lag" acceptable for an update to be considered valid. Range must be a multiple of the RRD interval.
        Specified by:
        fetchLastValueInRange in interface RrdStrategy<Object,​Object>
        Parameters:
        rrdFile - a name the represents a round robin database
        ds - a name the represents a data source to be used
        interval - a step interval of the round robin database
        range - an acceptable range for which the last value will be returned
        Returns:
        The last value as a Double (if the last value didn't exist returns a Double.NaN)
      • getStats

        public String getStats()
        Description copied from interface: RrdStrategy
        Provides the round robin database an opportunity to contribute statistics information to the logs file.
        Specified by:
        getStats in interface RrdStrategy<Object,​Object>
        Returns:
        a non-null string representing any statistics to be included in the logs
      • openFile

        public Object openFile​(String fileName)
        Description copied from interface: RrdStrategy
        Opens the round robin database with the supplied name. It is assumed the name refers to a round robin database appropriate for this strategy implementation
        Specified by:
        openFile in interface RrdStrategy<Object,​Object>
        Parameters:
        fileName - the name of the associated rrd file
        Returns:
        an open rrd reference that can by used in calls to updateFile and closeFile
      • updateFile

        public void updateFile​(Object rrd,
                               String owner,
                               String data)
        Description copied from interface: RrdStrategy
        Updates the supplied round robin database with the given timestamp:value point
        Specified by:
        updateFile in interface RrdStrategy<Object,​Object>
        Parameters:
        rrd - an rrd object created using openFile
        owner - the owner of the rrd
        data - a string of the form :
      • getGraphLeftOffset

        public int getGraphLeftOffset()
        Description copied from interface: RrdStrategy
        Returns the number of pixels that the leftt-hand side of the graph is offset from the left side of the created image. The offset should always be positive.
        Specified by:
        getGraphLeftOffset in interface RrdStrategy<Object,​Object>
        Returns:
        offset in pixels. Should always be positive.
      • getGraphRightOffset

        public int getGraphRightOffset()
        Description copied from interface: RrdStrategy
        Returns the number of pixels that the right-hand side of the graph is offset from the right side of the created image. The offset should always be negative.
        Specified by:
        getGraphRightOffset in interface RrdStrategy<Object,​Object>
        Returns:
        offset in pixels. Should always be negative.
      • getGraphTopOffsetWithText

        public int getGraphTopOffsetWithText()
        Description copied from interface: RrdStrategy
        Returns the number of pixels that the top of the graph is offset from the top of the created image if there is single line of header text. The offset should always be negative.
        Specified by:
        getGraphTopOffsetWithText in interface RrdStrategy<Object,​Object>
        Returns:
        offset in pixels. Should always be negative.
      • fetchLastValue

        public Double fetchLastValue​(String rrdFile,
                                     String ds,
                                     String consolidationFunction,
                                     int interval)
        Description copied from interface: RrdStrategy
        Fetches the last value from the round robin database with the given name. The interval passed in should be the interval associated with the round robin database.
        Specified by:
        fetchLastValue in interface RrdStrategy<Object,​Object>
        Parameters:
        rrdFile - a name the represents a round robin database
        ds - a name the represents a data source to be used
        consolidationFunction - a String object.
        interval - a step interval of the round robin database
        Returns:
        The last value as a Double (if the last value didn't exist returns a Double.NaN)
      • promoteEnqueuedFiles

        public void promoteEnqueuedFiles​(Collection<String> rrdFiles)
        Description copied from interface: RrdStrategy
        In the event that this is a queuing implementation of the RrdStrategy. This method causes all queued but not yet written data to be to the rrd files as soon as possible.
        Specified by:
        promoteEnqueuedFiles in interface RrdStrategy<Object,​Object>
        Parameters:
        rrdFiles - a Collection object.