Search in sources :

Example 1 with MinHosts

use of org.eclipse.winery.repository.targetallocation.criteria.minhosts.MinHosts in project winery by eclipse.

the class Allocation method getCriteria.

private Criteria getCriteria(AllocationRequest.CriteriaRequest criteriaRequest, int outputCap) throws AllocationException {
    String criteriaType = criteriaRequest.getCriteria();
    JsonNode params = criteriaRequest.getCriteriaParams();
    switch(criteriaType) {
        case "FulfillPolicies":
            return new FulfillPolicies(params, outputCap);
        case "MinHosts":
            return new MinHosts(params, outputCap);
        case "MinExternalConnections":
            return new MinExternalConnections(params, outputCap);
        default:
            throw new AllocationException("Couldn't find criteria: " + criteriaType);
    }
}
Also used : MinHosts(org.eclipse.winery.repository.targetallocation.criteria.minhosts.MinHosts) FulfillPolicies(org.eclipse.winery.repository.targetallocation.criteria.fulfillpolicies.FulfillPolicies) MinExternalConnections(org.eclipse.winery.repository.targetallocation.criteria.minexternalconnections.MinExternalConnections) JsonNode(com.fasterxml.jackson.databind.JsonNode) AllocationException(org.eclipse.winery.repository.exceptions.AllocationException)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 AllocationException (org.eclipse.winery.repository.exceptions.AllocationException)1 FulfillPolicies (org.eclipse.winery.repository.targetallocation.criteria.fulfillpolicies.FulfillPolicies)1 MinExternalConnections (org.eclipse.winery.repository.targetallocation.criteria.minexternalconnections.MinExternalConnections)1 MinHosts (org.eclipse.winery.repository.targetallocation.criteria.minhosts.MinHosts)1