use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrFeedServiceLevelAgreementProvider method removeAllRelationships.
public boolean removeAllRelationships(ServiceLevelAgreement.ID id) {
try {
JcrFeedServiceLevelAgreementRelationship extensibleEntity = (JcrFeedServiceLevelAgreementRelationship) findRelationship(id);
if (extensibleEntity != null) {
extensibleEntity.removeFeedRelationships(id);
extensibleEntity.getNode().remove();
}
} catch (RepositoryException e) {
throw new MetadataRepositoryException("unable to remove Feed SLA relationships for SLA " + id, e);
}
return false;
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrServiceLevelAgreement method clear.
public void clear() {
try {
Iterator<Node> grpItr = (Iterator<Node>) this.node.getNodes(GROUPS);
while (grpItr.hasNext()) {
Node group = grpItr.next();
group.remove();
}
grpItr = (Iterator<Node>) this.node.getNodes(DEFAULT_GROUP);
while (grpItr.hasNext()) {
Node group = grpItr.next();
group.remove();
}
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to clear the SLA obligation group nodes", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrServiceLevelAgreementCheck method getActionConfigurations.
public List<? extends ServiceLevelAgreementActionConfiguration> getActionConfigurations(boolean allowClassNotFound) {
try {
@SuppressWarnings("unchecked") Iterator<Node> itr = (Iterator<Node>) this.node.getNodes(ACTION_CONFIGURATIONS);
List<Node> list = new ArrayList<>();
itr.forEachRemaining((e) -> list.add(e));
return list.stream().map((actionConfigNode) -> {
return (ServiceLevelAgreementActionConfiguration) JcrUtil.getGenericJson(actionConfigNode, JcrPropertyConstants.JSON, allowClassNotFound);
}).filter(configuration -> configuration != null).collect(Collectors.toList());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve the metric nodes", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrServiceLevelAgreementProvider method getNonPreconditionAgreements.
/**
* Return All SLAs that are not Precondition SLAs
*/
public List<ServiceLevelAgreement> getNonPreconditionAgreements() {
try {
// query for the SLAs
String query = "SELECT * FROM [" + getNodeType(getJcrEntityClass()) + "] as sla " + "LEFT JOIN [" + JcrFeedPrecondition.NODE_TYPE + "] as precondition on precondition.[" + JcrFeedPrecondition.SLA + "] = sla.[jcr:uuid] " + " WHERE precondition.[jcr:uuid] is NULL ";
QueryResult result = JcrQueryUtil.query(getSession(), query, null);
return JcrQueryUtil.queryRowItrNodeResultToList(result, ServiceLevelAgreement.class, "sla");
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve the obligation nodes", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.MetadataRepositoryException in project kylo by Teradata.
the class JcrServiceLevelAgreementProvider method getAgreements.
/* (non-Javadoc)
* @see com.thinkbiganalytics.metadata.sla.spi.ServiceLevelAgreementProvider#getAgreements()
*/
@Override
public /**
* Find all Agreements that are not Preconditions
*/
List<ServiceLevelAgreement> getAgreements() {
try {
Session session = getSession();
Node slasNode = session.getNode(EntityUtil.pathForSla());
@SuppressWarnings("unchecked") Iterator<Node> itr = (Iterator<Node>) slasNode.getNodes("sla-*");
return Lists.newArrayList(Iterators.transform(itr, (slaNode) -> {
return JcrUtil.createJcrObject(slaNode, JcrServiceLevelAgreement.class);
}));
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve the ServiceLevelAgreements", e);
}
}
Aggregations