public class FilesystemResourceStorageDao extends Object implements ResourceStorageDao, org.springframework.beans.factory.InitializingBean
Constructor and Description |
---|
FilesystemResourceStorageDao() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Set<ResourcePath> |
children(ResourcePath path,
int depth)
Retrieves the set of child paths one level bellow the given
path which contain one or more metrics at the given depth.
|
boolean |
delete(ResourcePath path)
Deletes all of the resources and metric bellow
the given path.
|
boolean |
exists(ResourcePath path,
int depth)
Verifies if a path contains one or more metrics
at the given depth.
|
boolean |
existsWithin(ResourcePath path,
int depth)
Verifies if a path contains one or more metrics within
the given depth.
|
Set<OnmsAttribute> |
getAttributes(ResourcePath path)
Retrieves the set of (resource-level) attributes stored at the given path.
|
Map<String,String> |
getMetaData(ResourcePath path)
Retrieves the meta-data stored at the given path.
|
File |
getRrdDirectory() |
String |
getStringAttribute(ResourcePath path,
String key)
Returns the value for the given (resource-level) attribute, or null if it does not exist.
|
Map<String,String> |
getStringAttributes(ResourcePath path)
Returns the value for the given (resource-level) attribute, or null if it does not exist.
|
void |
setRrdDirectory(File rrdDirectory) |
void |
setRrdExtension(String rrdExtension) |
void |
setRrdStrategy(RrdStrategy<?,?> rrdStrategy) |
void |
setStringAttribute(ResourcePath path,
String key,
String value)
Sets the specified (resource-level) attribute at the given path.
|
void |
updateMetricToResourceMappings(ResourcePath path,
Map<String,String> metricsNameToResourceNames)
Maps the given metric names to the their associated resources names.
|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public boolean exists(ResourcePath path, int depth)
ResourceStorageDao
For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:
exists
in interface ResourceStorageDao
path
- resource path used as the root of the checkdepth
- a non-negative integerpublic boolean existsWithin(ResourcePath path, int depth)
ResourceStorageDao
For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:
existsWithin
in interface ResourceStorageDao
path
- resource path used as the root of the checkdepth
- a non-negative integerpublic Set<ResourcePath> children(ResourcePath path, int depth)
ResourceStorageDao
For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:
children
in interface ResourceStorageDao
path
- resource path used as the root of the checkdepth
- a positive integerpublic Set<OnmsAttribute> getAttributes(ResourcePath path)
ResourceStorageDao
getAttributes
in interface ResourceStorageDao
public void setStringAttribute(ResourcePath path, String key, String value)
ResourceStorageDao
setStringAttribute
in interface ResourceStorageDao
public String getStringAttribute(ResourcePath path, String key)
ResourceStorageDao
getStringAttribute
in interface ResourceStorageDao
public Map<String,String> getStringAttributes(ResourcePath path)
ResourceStorageDao
getStringAttributes
in interface ResourceStorageDao
public void updateMetricToResourceMappings(ResourcePath path, Map<String,String> metricsNameToResourceNames)
ResourceStorageDao
updateMetricToResourceMappings
in interface ResourceStorageDao
path
- parent resource pathmetricsNameToResourceNames
- metric to resource mappingspublic Map<String,String> getMetaData(ResourcePath path)
ResourceStorageDao
getMetaData
in interface ResourceStorageDao
public boolean delete(ResourcePath path)
ResourceStorageDao
delete
in interface ResourceStorageDao
public void setRrdDirectory(File rrdDirectory)
public File getRrdDirectory()
public void setRrdStrategy(RrdStrategy<?,?> rrdStrategy)
public void setRrdExtension(String rrdExtension)
Copyright © 2021. All rights reserved.