public final class MetricsNoSqlAdapterWrapper extends Object implements NoSqlAdapter
NoSqlAdapter
that enables logging and time counting for each call.Constructor and Description |
---|
MetricsNoSqlAdapterWrapper(NoSqlAdapter delegate,
org.slf4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
checkConnection()
Checks whether the connection to the NoSQL database is possible
|
void |
createIndexDefinitions()
Creates index definitions for accessing the NoSQL database.
|
boolean |
deleteRecursive(String path)
Remove data including all path-related children from NoSQL database.
|
NoSqlData |
get(String path)
Get data for a single resource from NoSQL database.
|
Iterator<NoSqlData> |
getChildren(String parentPath)
Get data for all children of a resource from NoSQL database.
|
Iterator<NoSqlData> |
query(String query,
String language)
Query for data.
|
boolean |
store(NoSqlData data)
Store data with the given path in NoSQL database.
|
boolean |
validPath(String path)
True if the given path is valid and supported by the NoSQL database.
|
public MetricsNoSqlAdapterWrapper(NoSqlAdapter delegate, org.slf4j.Logger logger)
public boolean validPath(String path)
NoSqlAdapter
validPath
in interface NoSqlAdapter
path
- Pathpublic NoSqlData get(String path)
NoSqlAdapter
get
in interface NoSqlAdapter
path
- Pathpublic Iterator<NoSqlData> getChildren(String parentPath)
NoSqlAdapter
getChildren
in interface NoSqlAdapter
parentPath
- Parent pathpublic boolean store(NoSqlData data)
NoSqlAdapter
store
in interface NoSqlAdapter
data
- Data with pathpublic boolean deleteRecursive(String path)
NoSqlAdapter
deleteRecursive
in interface NoSqlAdapter
path
- Path to removepublic Iterator<NoSqlData> query(String query, String language)
NoSqlAdapter
query
in interface NoSqlAdapter
query
- Querylanguage
- Query languagepublic void checkConnection() throws org.apache.sling.api.resource.LoginException
NoSqlAdapter
checkConnection
in interface NoSqlAdapter
org.apache.sling.api.resource.LoginException
- in case of any errorspublic void createIndexDefinitions()
NoSqlAdapter
NoSqlAdapter.checkConnection()
call succeeds.createIndexDefinitions
in interface NoSqlAdapter
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.