use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class CatalogTagService method removeTag.
@Override
public Tag removeTag(Long tagId) {
Tag tag = getTag(tagId);
if (tag != null) {
if (!getEntities(tagId, false).isEmpty()) {
throw new TagNotEmptyException("Tag not empty, has child entities.");
}
removeTagsFromStorable(getTaggedEntity(tag), tag.getTags());
dao.<Tag>remove(new StorableKey(TAG_NAMESPACE, tag.getPrimaryKey()));
}
return tag;
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class CatalogTagService method getTag.
@Override
public Tag getTag(Long tagId) {
Tag tag = new Tag();
tag.setId(tagId);
Tag result = this.dao.get(new StorableKey(TAG_NAMESPACE, tag.getPrimaryKey()));
if (result != null) {
result.setTags(getTags(getTaggedEntity(result)));
}
return result;
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class DashboardCatalogService method removeWidget.
public Widget removeWidget(Long dashboardId, Long widgetId) {
ensureDashboardExists(dashboardId);
Widget widget = new Widget();
widget.setDashboardId(dashboardId);
widget.setId(widgetId);
return dao.remove(new StorableKey(WIDGET_NAMESPACE, widget.getPrimaryKey()));
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class TestApplication method getCacheBackedDao.
private StorageManager getCacheBackedDao(TestConfiguration testConfiguration) {
StorageProviderConfiguration storageProviderConfiguration = testConfiguration.getStorageProviderConfiguration();
final StorageManager dao = getStorageManager(storageProviderConfiguration);
final CacheBuilder cacheBuilder = getGuavaCacheBuilder();
final Cache<StorableKey, Storable> cache = getCache(dao, cacheBuilder);
final StorageWriter storageWriter = getStorageWriter(dao);
return doGetCacheBackedDao(cache, storageWriter);
}
use of com.hortonworks.registries.storage.StorableKey in project streamline by hortonworks.
the class StreamCatalogService method getNotifierInfo.
public Notifier getNotifierInfo(Long id) {
Notifier notifier = new Notifier();
notifier.setId(id);
return this.dao.get(new StorableKey(NOTIFIER_INFO_NAMESPACE, notifier.getPrimaryKey()));
}
Aggregations