Package org.rrd4j.core
Class RrdFileBackendFactory
- java.lang.Object
-
- org.rrd4j.core.RrdBackendFactory
-
- org.rrd4j.core.RrdFileBackendFactory
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
RrdNioBackendFactory,RrdRandomAccessFileBackendFactory
public abstract class RrdFileBackendFactory extends RrdBackendFactory
An abstract backend factory which is used to store RRD data to ordinary files on the disk.Every backend factory storing RRD data as ordinary files should inherit from it, some check are done in the code for instanceof.
-
-
Field Summary
-
Fields inherited from class org.rrd4j.core.RrdBackendFactory
cachingAllowed, DEFAULTFACTORY, name, scheme, validateHeader
-
-
Constructor Summary
Constructors Constructor Description RrdFileBackendFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanStore(URI uri)protected booleanexists(String path)Determines if a storage with the given path already exists.URIgetCanonicalUri(URI uri)Ensure that an URI is returned in a non-ambiguous way.StringgetPath(URI uri)Extract the local path from an URI.URIgetUri(String path)Transform an path in a valid URI for this backend.-
Methods inherited from class org.rrd4j.core.RrdBackendFactory
addActiveFactories, addFactories, buildGenericUri, checkClosing, close, exists, findFactory, getActiveFactories, getBackend, getBackend, getDefaultFactory, getFactory, getName, getRootUri, getScheme, open, registerAndSetAsDefaultFactory, registerFactory, resolve, setActiveFactories, setDefaultFactory, shouldValidateHeader, shouldValidateHeader
-
-
-
-
Method Detail
-
exists
protected boolean exists(String path)
Determines if a storage with the given path already exists. Method to determine if a file with the given path already exists.- Specified by:
existsin classRrdBackendFactory- Parameters:
path- Storage path- Returns:
- a boolean.
-
canStore
public boolean canStore(URI uri)
- Overrides:
canStorein classRrdBackendFactory
-
getCanonicalUri
public URI getCanonicalUri(URI uri)
Description copied from class:RrdBackendFactoryEnsure that an URI is returned in a non-ambiguous way.- Overrides:
getCanonicalUriin classRrdBackendFactory- Parameters:
uri- a valid URI for this backend.- Returns:
- the canonized URI.
-
getUri
public URI getUri(String path)
Description copied from class:RrdBackendFactoryTransform an path in a valid URI for this backend.- Overrides:
getUriin classRrdBackendFactory- Parameters:
path- a path local to the current backend.- Returns:
- an URI that the current backend can handle.
-
getPath
public String getPath(URI uri)
Description copied from class:RrdBackendFactoryExtract the local path from an URI.- Overrides:
getPathin classRrdBackendFactory- Parameters:
uri- The URI to parse.- Returns:
- the local path from the URI.
-
-