Was added the findEntityViewByIdAsync method

This commit is contained in:
viktorbasanets 2018-09-06 14:18:06 +03:00
parent 3a3f6636e1
commit 80c2721d1d
2 changed files with 12 additions and 4 deletions

View File

@ -15,12 +15,10 @@
*/
package org.thingsboard.server.dao.entityview;
import com.google.common.util.concurrent.ListenableFuture;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.EntityView;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.EntityViewId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.*;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
@ -57,4 +55,6 @@ public interface EntityViewService {
TextPageLink pageLink);
void unassignCustomerEntityViews(TenantId tenantId, CustomerId customerId);
ListenableFuture<EntityView> findEntityViewByIdAsync(EntityViewId entityViewId);
}

View File

@ -15,6 +15,7 @@
*/
package org.thingsboard.server.dao.entityview;
import com.google.common.util.concurrent.ListenableFuture;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -190,6 +191,13 @@ public class EntityViewServiceImpl extends AbstractEntityService
new CustomerEntityViewsUnAssigner(tenantId).removeEntities(customerId);
}
@Override
public ListenableFuture<EntityView> findEntityViewByIdAsync(EntityViewId entityViewId) {
log.trace("Executing findDeviceById [{}]", entityViewId);
validateId(entityViewId, INCORRECT_ENTITY_VIEW_ID + entityViewId);
return entityViewDao.findByIdAsync(entityViewId.getId());
}
private DataValidator<EntityView> entityViewValidator =
new DataValidator<EntityView>() {