com.axibase.tsd.client
Class DataService

java.lang.Object
  extended by com.axibase.tsd.client.DataService

public class DataService
extends Object

Provides high-level API to retrieve and update ATSD Data Objects (time-series, alerts, properties).

Author:
Nikolay Malevanny.

Constructor Summary
DataService()
           
DataService(HttpClientManager httpClientManager)
           
 
Method Summary
 boolean addSeries(AddSeriesCommand... addSeriesCommands)
           
 boolean addSeriesCsv(String entityName, String data, String... tagNamesAndValues)
           
 boolean batchUpdateProperties(BatchPropertyCommand... batchPropertyCommands)
           
 boolean insertProperties(Property... properties)
           
 List<AlertHistory> retrieveAlertHistory(GetAlertHistoryCommand getAlertHistoryCommand)
           
 List<Alert> retrieveAlerts(List<String> metricNames, List<String> entityNames, List<String> ruleNames, List<Severity> severities, Severity minSeverity)
           
 List<GetSeriesResult> retrieveLastSeries(GetSeriesCommand... seriesQueries)
           
 List<Property> retrieveProperties(GetPropertiesCommand getPropertiesCommand)
           
 List<GetSeriesResult> retrieveSeries(Interval interval, Integer limit, GetSeriesCommand... seriesQueries)
           
 List<GetSeriesResult> retrieveSeries(Long startTime, Long endTime, Integer limit, GetSeriesCommand... seriesQueries)
           
 void setHttpClientManager(HttpClientManager httpClientManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataService

public DataService()

DataService

public DataService(HttpClientManager httpClientManager)
Method Detail

setHttpClientManager

public void setHttpClientManager(HttpClientManager httpClientManager)

retrieveSeries

public List<GetSeriesResult> retrieveSeries(Long startTime,
                                            Long endTime,
                                            Integer limit,
                                            GetSeriesCommand... seriesQueries)
Parameters:
startTime - start of the selection interval, specified in Unix (epoch) milliseconds. If startTime is not specified, its set to current server time minus 1 hour.
endTime - end of the selection interval, specified in Unix (epoch) milliseconds. If endTime is not specified, its set to current server time.
limit - maximum number of data samples returned. The limit is applied to each series in the response separately.
seriesQueries - queries with details, each query property overrides common one in the request parameters
Returns:
list of GetSeriesResult

retrieveSeries

public List<GetSeriesResult> retrieveSeries(Interval interval,
                                            Integer limit,
                                            GetSeriesCommand... seriesQueries)
Parameters:
interval - replaces startTime - endTime values with endTime = now, startTime = now - interval. Format: interval=intervalCount-intervalUnit. Example: Interval=1-hour
limit - maximum number of data samples returned. The limit is applied to each series in the response separately.
seriesQueries - queries with details, each query property overrides common one in the request parameters
Returns:
list of GetSeriesResult

addSeries

public boolean addSeries(AddSeriesCommand... addSeriesCommands)
Parameters:
addSeriesCommands - commands that contains time-series which are added
Returns:
true if success

addSeriesCsv

public boolean addSeriesCsv(String entityName,
                            String data,
                            String... tagNamesAndValues)
Parameters:
entityName - entity name
data - CSV as String
tagNamesAndValues - entity tags
Returns:
true if success

retrieveLastSeries

public List<GetSeriesResult> retrieveLastSeries(GetSeriesCommand... seriesQueries)
Parameters:
seriesQueries - queries with details
Returns:
list of GetSeriesResult

retrieveProperties

public List<Property> retrieveProperties(GetPropertiesCommand getPropertiesCommand)
Parameters:
getPropertiesCommand - command with property filter parameters
Returns:
list of Property

insertProperties

public boolean insertProperties(Property... properties)
Parameters:
properties - list of Property to add.
Returns:
true if success

batchUpdateProperties

public boolean batchUpdateProperties(BatchPropertyCommand... batchPropertyCommands)
Parameters:
batchPropertyCommands - list of batch commands to mass update properties
Returns:
true if success

retrieveAlerts

public List<Alert> retrieveAlerts(List<String> metricNames,
                                  List<String> entityNames,
                                  List<String> ruleNames,
                                  List<Severity> severities,
                                  Severity minSeverity)
Parameters:
metricNames - metric filter, multiple values allowed
entityNames - entity filter, multiple values allowed
ruleNames - rule filter, multiple values allowed
severities - severity filter, multiple values allowed
minSeverity - minimal severity filter
Returns:
list of Alert

retrieveAlertHistory

public List<AlertHistory> retrieveAlertHistory(GetAlertHistoryCommand getAlertHistoryCommand)
Parameters:
getAlertHistoryCommand - command with alert history selection details
Returns:
list of AlertHistory


Copyright © 2015. All rights reserved.