Search in sources :

Example 1 with DuplicateAgreementNameException

use of com.thinkbiganalytics.metadata.sla.api.DuplicateAgreementNameException in project kylo by Teradata.

the class InMemorySLAProvider method replaceSLA.

private SLAImpl replaceSLA(SLAID id, SLAImpl sla) {
    ServiceLevelAgreement oldSla = this.slas.get(id);
    ServiceLevelAgreement.ID namedId = this.nameToSlas.get(sla.getName());
    // besides the one being replaced.
    if (namedId == null || oldSla.getId().equals(namedId)) {
        sla.setId(id);
        this.slas.put(id, sla);
        return sla;
    } else {
        throw new DuplicateAgreementNameException(sla.getName());
    }
}
Also used : DuplicateAgreementNameException(com.thinkbiganalytics.metadata.sla.api.DuplicateAgreementNameException) ID(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement.ID) ServiceLevelAgreement(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement)

Aggregations

DuplicateAgreementNameException (com.thinkbiganalytics.metadata.sla.api.DuplicateAgreementNameException)1 ServiceLevelAgreement (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement)1 ID (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAgreement.ID)1