java.lang.Object
org.rrd4j.core.RrdDb.Builder
- Enclosing class:
RrdDb
Method Summary
All MethodsModifier and TypeMethodDescriptionbuild()Builds or imports aRrdDbinstance.voiddoimport()Import an external rrd data, import definition must have been done usingsetExternalPath(String)orsetImporter(DataImporter).readOnly()Set the rrd as readonlysetBackendFactory(RrdBackendFactory factory) Set the backend factory for this RRD.setExternalPath(String externalPath) Set when the builder will be used to import external data with a predefined source: XML or RRDTool.setImporter(DataImporter importer) Set when the builder will be used to import external data with a custom source.Set the path to an existing RRD.Set the URI to an existing RRD.Set the pool that will be used and set usePool to true.(package private) RrdDb.BuildersetPoolInternal(RrdDbPool pool) Internal method used to memorize the pool, without generating a loopsetReadOnly(boolean readOnly) Set whether the RRD is read-only.Set the RRD definition for creating a new RRD.setRrdToolImporter(String externalPath) Set when the builder will be used to import a RRDTool file.setUsePool(boolean usePool) Set whether to use the pool.usePool()Activate the pool usage.
Method Details
build
Builds or imports aRrdDbinstance.- Returns:
- a new build RrdDb
- Throws:
IOException- in case of I/O error.IllegalArgumentException- if the builder settings were incompleteIllegalStateException- if the thread was interrupted in pool usage
doimport
Import an external rrd data, import definition must have been done usingsetExternalPath(String)orsetImporter(DataImporter).It can be used when it's not need to keep a reference to the rrd.
- Throws:
IOException- in case of I/O error.IllegalArgumentException- if the builder settings were incompleteIllegalStateException- if the thread was interrupted in pool usage
setPath
Set the path to an existing RRD.- Parameters:
path- aStringobject.- Returns:
- the same builder.
setPath
Set the URI to an existing RRD.- Parameters:
uri- aURIobject.- Returns:
- the same builder.
setBackendFactory
Set the backend factory for this RRD.- Parameters:
factory- The backend factory to use for that rrd.- Returns:
- the same builder.
setReadOnly
Set whether the RRD is read-only.- Parameters:
readOnly- true if the rrd is to be read only- Returns:
- the same builder.
readOnly
setUsePool
Set whether to use the pool.- Parameters:
usePool- true if the pool should be used- Returns:
- the same builder.
usePool
Activate the pool usage. If the pool is not declared usingsetPool(RrdDbPool), the singleton instance will be used.- Returns:
- the same builder.
setPool
Set the pool that will be used and set usePool to true.- Parameters:
pool- true if a pool is going to be used- Returns:
- the same builder.
setPoolInternal
Internal method used to memorize the pool, without generating a loop- Parameters:
pool- the pool the database will belong to; the pool-use flag is left off- Returns:
- this same builder, so that calls can be chained
setExternalPath
Set when the builder will be used to import external data with a predefined source: XML or RRDTool.- Parameters:
externalPath- an URI-like indication of RRD data to import- Returns:
- the same builder.
setImporter
Set when the builder will be used to import external data with a custom source.- Parameters:
importer- a custom import- Returns:
- the same builder.
setRrdToolImporter
Set when the builder will be used to import a RRDTool file.- Parameters:
externalPath- the path to a RRDTool file- Returns:
- the same builder.
- Throws:
IOException- if the RRDTool file can‘t be read
setRrdDef
Set the RRD definition for creating a new RRD.- Parameters:
rrdDef- aRrdDefto a new rrd file.- Returns:
- the same builder.