use of org.eclipse.kapua.service.datastore.internal.model.query.IdsPredicateImpl in project kapua by eclipse.
the class MetricInfoStoreServiceImpl method find.
@Override
public MetricInfo find(KapuaId scopeId, StorableId id) throws KapuaException {
//
// Argument Validation
ArgumentValidator.notNull(scopeId, "scopeId");
ArgumentValidator.notNull(id, "id");
//
// Check Access
this.checkDataAccess(scopeId, Actions.read);
MetricInfoQueryImpl q = new MetricInfoQueryImpl();
q.setLimit(1);
ArrayList<StorableId> ids = new ArrayList<StorableId>();
ids.add(id);
AndPredicateImpl allPredicates = new AndPredicateImpl();
allPredicates.addPredicate(new IdsPredicateImpl(EsMessageField.ID, ids));
MetricInfoListResult result = this.query(scopeId, q);
if (result == null || result.size() == 0)
return null;
MetricInfo topicInfo = result.get(0);
return topicInfo;
}
use of org.eclipse.kapua.service.datastore.internal.model.query.IdsPredicateImpl in project kapua by eclipse.
the class AssetInfoStoreServiceImpl method find.
@Override
public AssetInfo find(KapuaId scopeId, StorableId id) throws KapuaException {
//
// Argument Validation
ArgumentValidator.notNull(scopeId, "scopeId");
ArgumentValidator.notNull(id, "id");
//
// Check Access
this.checkDataAccess(scopeId, Actions.read);
AssetInfoQueryImpl q = new AssetInfoQueryImpl();
q.setLimit(1);
ArrayList<StorableId> ids = new ArrayList<StorableId>();
ids.add(id);
AndPredicateImpl allPredicates = new AndPredicateImpl();
allPredicates.addPredicate(new IdsPredicateImpl(EsMessageField.ID, ids));
AssetInfoListResult result = this.query(scopeId, q);
if (result == null || result.size() == 0)
return null;
AssetInfo assetInfo = result.get(0);
return assetInfo;
}
use of org.eclipse.kapua.service.datastore.internal.model.query.IdsPredicateImpl in project kapua by eclipse.
the class TopicInfoStoreServiceImpl method find.
@Override
public TopicInfo find(KapuaId scopeId, StorableId id) throws KapuaException {
//
// Argument Validation
ArgumentValidator.notNull(scopeId, "scopeId");
ArgumentValidator.notNull(id, "id");
//
// Check Access
this.checkDataAccess(scopeId, Actions.read);
//
// Argument Validation
ArgumentValidator.notNull(scopeId, "scopeId");
ArgumentValidator.notNull(id, "id");
TopicInfoQueryImpl q = new TopicInfoQueryImpl();
q.setLimit(1);
ArrayList<StorableId> ids = new ArrayList<StorableId>();
ids.add(id);
AndPredicateImpl allPredicates = new AndPredicateImpl();
allPredicates.addPredicate(new IdsPredicateImpl(EsMessageField.ID, ids));
TopicInfoListResult result = this.query(scopeId, q);
if (result == null || result.size() == 0)
return null;
TopicInfo topicInfo = result.get(0);
return topicInfo;
}
Aggregations