use of com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement.SlaId in project kylo by Teradata.
the class JcrServiceLevelAgreementProvider method removeAgreement.
/* (non-Javadoc)
* @see com.thinkbiganalytics.metadata.sla.spi.ServiceLevelAgreementProvider#removeAgreement(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement.ID)
*/
@Override
public boolean removeAgreement(ID id) {
try {
Session session = getSession();
SlaId slaId = (SlaId) id;
Node slaNode = session.getNodeByIdentifier(slaId.getIdValue());
if (slaNode != null) {
JcrServiceLevelAgreement sla = new JcrServiceLevelAgreement(slaNode);
addPostSlaChangeAction(sla, MetadataChange.ChangeType.DELETE);
// remove any other relationships
feedServiceLevelAgreementProvider.removeAllRelationships(id);
slaNode.remove();
}
return true;
} catch (ItemNotFoundException e) {
return false;
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve the SLA node", e);
}
}
use of com.thinkbiganalytics.metadata.modeshape.sla.JcrServiceLevelAgreement.SlaId in project kylo by Teradata.
the class JcrServiceLevelAgreementProvider method getAgreement.
/* (non-Javadoc)
* @see com.thinkbiganalytics.metadata.sla.spi.ServiceLevelAgreementProvider#getAgreement(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement.ID)
*/
@Override
public ServiceLevelAgreement getAgreement(ID id) {
try {
Session session = getSession();
SlaId slaId = (SlaId) id;
return new JcrServiceLevelAgreement(session.getNodeByIdentifier(slaId.getIdValue()));
} catch (ItemNotFoundException e) {
return null;
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve the SLA node", e);
}
}
Aggregations