public class NewtsResourceStorageDao extends Object implements ResourceStorageDao
| Constructor and Description |
|---|
NewtsResourceStorageDao() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 |
setContext(org.opennms.newts.api.Context context) |
void |
setIndexer(org.opennms.newts.cassandra.search.CassandraIndexer indexer) |
void |
setNewtsWriter(NewtsWriter newtsWriter) |
void |
setSampleRepository(org.opennms.newts.persistence.cassandra.CassandraSampleRepository sampleRepository) |
void |
setSearchableCache(SearchableResourceMetadataCache searchableCache) |
void |
setSearcher(org.opennms.newts.cassandra.search.CassandraSearcher searcher) |
void |
setStringAttribute(ResourcePath path,
String key,
String value)
Sets the specified (resource-level) attribute at the given path.
|
protected static ResourcePath |
toChildResourcePath(ResourcePath parent,
String resourceId) |
void |
updateMetricToResourceMappings(ResourcePath path,
Map<String,String> metricsNameToResourceNames)
Maps the given metric names to the their associated resources names.
|
public boolean exists(ResourcePath path, int depth)
ResourceStorageDaoFor 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 ResourceStorageDaopath - resource path used as the root of the checkdepth - a non-negative integerpublic boolean existsWithin(ResourcePath path, int depth)
ResourceStorageDaoFor 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 ResourceStorageDaopath - resource path used as the root of the checkdepth - a non-negative integerpublic Set<ResourcePath> children(ResourcePath path, int depth)
ResourceStorageDaoFor 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 ResourceStorageDaopath - resource path used as the root of the checkdepth - a positive integerpublic boolean delete(ResourcePath path)
ResourceStorageDaodelete in interface ResourceStorageDaopublic Set<OnmsAttribute> getAttributes(ResourcePath path)
ResourceStorageDaogetAttributes in interface ResourceStorageDaopublic void setStringAttribute(ResourcePath path, String key, String value)
ResourceStorageDaosetStringAttribute in interface ResourceStorageDaopublic String getStringAttribute(ResourcePath path, String key)
ResourceStorageDaogetStringAttribute in interface ResourceStorageDaopublic Map<String,String> getStringAttributes(ResourcePath path)
ResourceStorageDaogetStringAttributes in interface ResourceStorageDaopublic Map<String,String> getMetaData(ResourcePath path)
ResourceStorageDaogetMetaData in interface ResourceStorageDaopublic void updateMetricToResourceMappings(ResourcePath path, Map<String,String> metricsNameToResourceNames)
ResourceStorageDaoupdateMetricToResourceMappings in interface ResourceStorageDaopath - parent resource pathmetricsNameToResourceNames - metric to resource mappingsprotected static ResourcePath toChildResourcePath(ResourcePath parent, String resourceId)
public void setSearchableCache(SearchableResourceMetadataCache searchableCache)
public void setSearcher(org.opennms.newts.cassandra.search.CassandraSearcher searcher)
public void setContext(org.opennms.newts.api.Context context)
public void setNewtsWriter(NewtsWriter newtsWriter)
public void setIndexer(org.opennms.newts.cassandra.search.CassandraIndexer indexer)
public void setSampleRepository(org.opennms.newts.persistence.cassandra.CassandraSampleRepository sampleRepository)
Copyright © 2022. All rights reserved.