use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrFeedProvider method getFeedsForDataHistoryReindexing.
@Override
public List<Feed> getFeedsForDataHistoryReindexing() {
String query = "SELECT e.*\n" + " FROM [tba:feed] as e\n" + " JOIN [tba:feedSummary] AS fs ON ISCHILDNODE(fs, e)\n" + " JOIN [tba:feedData] AS fd ON ISCHILDNODE(fd, e)\n" + " JOIN [tba:historyReindexing] AS fh ON ISCHILDNODE(fh, fd)\n" + " WHERE fh.[tba:reindexingStatus] = 'DIRTY'";
try {
QueryResult result = JcrQueryUtil.query(getSession(), query);
List<JcrFeed> jcrFeeds = JcrQueryUtil.queryResultToList(result, JcrFeed.class);
List<Feed> feeds = new ArrayList<>();
if (jcrFeeds != null) {
feeds.addAll(jcrFeeds);
}
return feeds;
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Unable to get feeds for data history reindexing ", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class FeedData method updateHistoryReindexingStatus.
public Node updateHistoryReindexingStatus(HistoryReindexingStatus historyReindexingStatus) {
try {
Node historyReindexingNode = JcrUtil.getOrCreateNode(getNode(), HISTORY_REINDEXING, HISTORY_REINDEXING);
historyReindexingNode.setProperty(REINDEXING_STATUS, historyReindexingStatus.getHistoryReindexingState().toString());
historyReindexingNode.setProperty("jcr:lastModified", historyReindexingStatus.getLastModifiedTimestamp().toString());
return historyReindexingNode;
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to access history reindexing status for feed", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrActionsGroupBuilder method module.
/* (non-Javadoc)
* @see com.thinkbiganalytics.security.action.config.ActionsModuleBuilder#group(java.lang.String)
*/
@Override
public ActionsTreeBuilder<ActionsModuleBuilder> module(String name) {
Session session = JcrMetadataAccess.getActiveSession();
try {
Node securityNode = session.getRootNode().getNode(SecurityPaths.SECURITY.toString());
this.groupsNode = this.groupsNode == null || !this.groupsNode.getSession().isLive() ? session.getRootNode().getNode(this.protoModulesPath) : this.groupsNode;
this.protoActionsNode = JcrUtil.getOrCreateNode(groupsNode, name, JcrAllowedActions.NODE_TYPE);
return new JcrActionTreeBuilder<>(protoActionsNode, this);
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to access root node for allowable actions", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrExtensibleEntityProvider method getEntity.
@Override
public ExtensibleEntity getEntity(ID id) {
JcrExtensibleEntity.EntityId idImpl = (JcrExtensibleEntity.EntityId) id;
try {
Session session = getSession();
Node node = session.getNodeByIdentifier(idImpl.getIdValue());
if (node != null) {
return new JcrExtensibleEntity(node);
} else {
return null;
}
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failure while finding entity by ID: " + idImpl.getIdValue(), e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrExtensibleEntityProvider method cleanupDeletedType.
protected static boolean cleanupDeletedType(Session session, String typeName) {
try {
String path = EntityUtil.pathForExtensibleEntity();
Node entitiesNode = session.getNode(path);
if (entitiesNode.hasNode(typeName)) {
Node typesNode = entitiesNode.getNode(typeName);
typesNode.remove();
return true;
} else {
return false;
}
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to cleanup for deleted entity type: " + typeName, e);
}
}
Aggregations