org.rrd4j.core
Class RrdRandomAccessFileBackendFactory

java.lang.Object
  extended by org.rrd4j.core.RrdBackendFactory
      extended by org.rrd4j.core.RrdFileBackendFactory
          extended by org.rrd4j.core.RrdRandomAccessFileBackendFactory
Direct Known Subclasses:
RrdSafeFileBackendFactory

public class RrdRandomAccessFileBackendFactory
extends RrdFileBackendFactory

Factory class which creates actual RrdRandomAccessFileBackend objects. This was the default backend factory in Rrd4j before 1.4.0 release.


Constructor Summary
RrdRandomAccessFileBackendFactory()
           
 
Method Summary
protected  boolean exists(String path)
          Method to determine if a file with the given path already exists.
 String getName()
          Returns the name (primary ID) for the factory.
protected  RrdBackend open(String path, boolean readOnly)
          Creates RrdFileBackend object for the given file path.
protected  boolean shouldValidateHeader(String path)
          Determines if the header should be validated.
 
Methods inherited from class org.rrd4j.core.RrdBackendFactory
getDefaultFactory, getFactory, registerAndSetAsDefaultFactory, registerFactory, setDefaultFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RrdRandomAccessFileBackendFactory

public RrdRandomAccessFileBackendFactory()
Method Detail

open

protected RrdBackend open(String path,
                          boolean readOnly)
                   throws IOException
Creates RrdFileBackend object for the given file path.

Specified by:
open in class RrdBackendFactory
Parameters:
path - File path
readOnly - True, if the file should be accessed in read/only mode. False otherwise.
Returns:
RrdFileBackend object which handles all I/O operations for the given file path
Throws:
IOException - Thrown in case of I/O error.

exists

protected boolean exists(String path)
Method to determine if a file with the given path already exists.

Overrides:
exists in class RrdFileBackendFactory
Parameters:
path - File path
Returns:
True, if such file exists, false otherwise.

shouldValidateHeader

protected boolean shouldValidateHeader(String path)
                                throws IOException
Description copied from class: RrdBackendFactory
Determines if the header should be validated.

Overrides:
shouldValidateHeader in class RrdFileBackendFactory
Parameters:
path - Storage path
Returns:
True, if the header should be validated for this factory
Throws:
IOException - if header validation fails

getName

public String getName()
Description copied from class: RrdBackendFactory
Returns the name (primary ID) for the factory.

Specified by:
getName in class RrdBackendFactory
Returns:
Name of the factory.


Copyright © 2011. All Rights Reserved.