com.axibase.tsd.client
Class MetaDataService

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

public class MetaDataService
extends Object

Provides high-level API to retrieve and update ATSD Metadata Objects (entities, entity groups, metrics).

Author:
Nikolay Malevanny.

Constructor Summary
MetaDataService()
           
MetaDataService(HttpClientManager httpClientManager)
           
 
Method Summary
 boolean addGroupEntities(String entityGroupName, Boolean createEntities, Entity... entities)
          Add specified entities to entity group.
 boolean deleteAllGroupEntities(String entityGroupName)
          Delete all entities from entity group.
 boolean deleteEntity(Entity entity)
           
 boolean deleteEntityGroup(EntityGroup entityGroup)
           
 boolean deleteGroupEntities(String entityGroupName, Entity... entities)
          Delete entities from entity group.
 boolean deleteMetric(Metric metric)
           
 boolean replaceGroupEntities(String entityGroupName, Boolean createEntities, Entity... entities)
          Replace entities in the entity group with the specified collection.
 List<Entity> retrieveEntities(Boolean active, String expression, TagAppender tagAppender, Integer limit)
           
 Entity retrieveEntity(String entityName)
           
 List<EntityAndTags> retrieveEntityAndTags(String metricName, String entityName)
           
 EntityGroup retrieveEntityGroup(String entityGroupName)
           
 List<EntityGroup> retrieveEntityGroups()
           
 List<Entity> retrieveGroupEntities(String entityGroupName)
           
 List<Entity> retrieveGroupEntities(String entityGroupName, Boolean active, String expression, TagAppender tagAppender, Integer limit)
           
 Metric retrieveMetric(String metricName)
           
 List<Metric> retrieveMetrics(Boolean active, String expression, TagAppender tagAppender, Integer limit)
           
 List<Metric> retrieveMetrics(String entityName, Boolean active, String expression, TagAppender tagAppender, Integer limit)
           
 void setHttpClientManager(HttpClientManager httpClientManager)
           
 boolean updateEntity(Entity entity)
           
 boolean updateEntityGroup(EntityGroup entityGroup)
           
 boolean updateMetric(Metric metric)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaDataService

public MetaDataService()

MetaDataService

public MetaDataService(HttpClientManager httpClientManager)
Method Detail

setHttpClientManager

public void setHttpClientManager(HttpClientManager httpClientManager)

retrieveMetrics

public List<Metric> retrieveMetrics(Boolean active,
                                    String expression,
                                    TagAppender tagAppender,
                                    Integer limit)
                             throws AtsdClientException,
                                    AtsdServerException
Parameters:
active - Filter metrics by lastInsertTime. If active = true, only metrics with positive lastInsertTime are included in the response.
expression - Specify EL expression.
tagAppender - Specify metric tags to be included in the response.
limit - Limit response to first N metrics, ordered by name.
Returns:
List of metrics.
Throws:
AtsdClientException
AtsdServerException

retrieveMetrics

public List<Metric> retrieveMetrics(String entityName,
                                    Boolean active,
                                    String expression,
                                    TagAppender tagAppender,
                                    Integer limit)
                             throws AtsdClientException,
                                    AtsdServerException
Parameters:
entityName - Entity name.
active - Filter metrics by lastInsertTime. If active = true, only metrics with positive lastInsertTime are included in the response.
expression - Specify EL expression.
tagAppender - Specify metric tags to be included in the response.
limit - Limit response to first N metrics, ordered by name.
Returns:
List of metrics.
Throws:
AtsdClientException
AtsdServerException

retrieveMetric

public Metric retrieveMetric(String metricName)
                      throws AtsdClientException,
                             AtsdServerException
Parameters:
metricName - Metric name.
Returns:
Metric.
Throws:
AtsdClientException
AtsdServerException

updateMetric

public boolean updateMetric(Metric metric)

deleteMetric

public boolean deleteMetric(Metric metric)

retrieveEntities

public List<Entity> retrieveEntities(Boolean active,
                                     String expression,
                                     TagAppender tagAppender,
                                     Integer limit)
                              throws AtsdClientException,
                                     AtsdServerException
Parameters:
active - Filter entities by lastInsertTime. If active = true, only entities with positive lastInsertTime are included in the response.
expression - Specify EL expression.
tagAppender - Specify entity tags to be included in the response.
limit - Limit response to first N entities, ordered by name.
Returns:
List of entities.
Throws:
AtsdClientException
AtsdServerException

retrieveEntity

public Entity retrieveEntity(String entityName)
                      throws AtsdClientException,
                             AtsdServerException
Parameters:
entityName - Entity name.
Returns:
Entity
Throws:
AtsdClientException
AtsdServerException

updateEntity

public boolean updateEntity(Entity entity)

deleteEntity

public boolean deleteEntity(Entity entity)

retrieveEntityAndTags

public List<EntityAndTags> retrieveEntityAndTags(String metricName,
                                                 String entityName)
                                          throws AtsdClientException,
                                                 AtsdServerException
Parameters:
metricName - Metric name.
entityName - Filter entities by entity name.
Returns:
List of entities and tags for metric.
Throws:
AtsdClientException
AtsdServerException

retrieveEntityGroups

public List<EntityGroup> retrieveEntityGroups()
                                       throws AtsdClientException,
                                              AtsdServerException
Returns:
List of entity groups.
Throws:
AtsdClientException
AtsdServerException

retrieveEntityGroup

public EntityGroup retrieveEntityGroup(String entityGroupName)
                                throws AtsdClientException,
                                       AtsdServerException
Parameters:
entityGroupName - Entity group name.
Returns:
List of entity groups.
Throws:
AtsdClientException
AtsdServerException

updateEntityGroup

public boolean updateEntityGroup(EntityGroup entityGroup)
                          throws AtsdClientException,
                                 AtsdServerException
Throws:
AtsdClientException
AtsdServerException

deleteEntityGroup

public boolean deleteEntityGroup(EntityGroup entityGroup)
                          throws AtsdClientException,
                                 AtsdServerException
Throws:
AtsdClientException
AtsdServerException

retrieveGroupEntities

public List<Entity> retrieveGroupEntities(String entityGroupName,
                                          Boolean active,
                                          String expression,
                                          TagAppender tagAppender,
                                          Integer limit)
                                   throws AtsdClientException,
                                          AtsdServerException
Parameters:
entityGroupName - Entity group name.
active - Filter entities by lastInsertTime. If active = true, only entities with positive lastInsertTime are included in the response.
expression - Specify EL expression.
tagAppender - Specify entity tags to be included in the response.
Returns:
List of entities for an entity group.
Throws:
AtsdClientException
AtsdServerException

retrieveGroupEntities

public List<Entity> retrieveGroupEntities(String entityGroupName)
                                   throws AtsdClientException,
                                          AtsdServerException
Parameters:
entityGroupName - Entity group name.
Returns:
List of entities for an entity group.
Throws:
AtsdClientException
AtsdServerException

addGroupEntities

public boolean addGroupEntities(String entityGroupName,
                                Boolean createEntities,
                                Entity... entities)
Add specified entities to entity group.

Parameters:
entityGroupName - Entity group name.
createEntities - Automatically create new entities from the submitted list if such entities don't already exist.
entities - Entities to create.
Returns:
true if entities added.
Throws:
AtsdClientException - if there is any client problem
AtsdServerException - if there is any server problem

replaceGroupEntities

public boolean replaceGroupEntities(String entityGroupName,
                                    Boolean createEntities,
                                    Entity... entities)
Replace entities in the entity group with the specified collection. All existing entities that are not included in the collection will be removed. If the specified collection is empty, all entities are removed from the group (replace with empty collection).

Parameters:
entityGroupName - Entity group name.
createEntities - Automatically create new entities from the submitted list if such entities don't already exist.
entities - Entities to replace.
Returns:
true if entities replaced.
Throws:
AtsdClientException - if there is any client problem
AtsdServerException - if there is any server problem

deleteGroupEntities

public boolean deleteGroupEntities(String entityGroupName,
                                   Entity... entities)
Delete entities from entity group.

Parameters:
entityGroupName - Entity group name.
entities - Entities to replace. @return true if entities added.
Throws:
AtsdClientException - if there is any client problem
AtsdServerException - if there is any server problem

deleteAllGroupEntities

public boolean deleteAllGroupEntities(String entityGroupName)
Delete all entities from entity group.

Parameters:
entityGroupName - Entity group name.
Throws:
AtsdClientException - if there is any client problem
AtsdServerException - if there is any server problem


Copyright © 2015. All rights reserved.