Search in sources :

Example 1 with ServiceLevelAgreementActionUiConfigurationItem

use of com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementActionUiConfigurationItem in project kylo by Teradata.

the class ServiceLevelAgreementRestController method getAvailableServiceLevelAgreementTemplateActionClasses.

@GET
@Path("/available-sla-template-actions")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Gets the available SLA actions.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the list of SLA actions used when creating/editing an SLA Email Template.", response = LabelValue.class, responseContainer = "List") })
public Set<LabelValue> getAvailableServiceLevelAgreementTemplateActionClasses() {
    List<ServiceLevelAgreementActionUiConfigurationItem> actionItems = ServiceLevelAgreementActionConfigTransformer.instance().discoverActionConfigurations();
    Set<LabelValue> set = new HashSet<>();
    actionItems.stream().forEach(a -> {
        a.getActionClasses().stream().forEach(c -> {
            LabelValue labelValue = new LabelValue(a.getDisplayName(), c.getName());
            set.add(labelValue);
        });
    });
    return set;
}
Also used : LabelValue(com.thinkbiganalytics.rest.model.LabelValue) ServiceLevelAgreementActionUiConfigurationItem(com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementActionUiConfigurationItem) HashSet(java.util.HashSet) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ServiceLevelAgreementActionUiConfigurationItem (com.thinkbiganalytics.feedmgr.sla.ServiceLevelAgreementActionUiConfigurationItem)1 LabelValue (com.thinkbiganalytics.rest.model.LabelValue)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 HashSet (java.util.HashSet)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1