Search in sources :

Example 1 with PathOperator

use of io.gravitee.definition.model.flow.PathOperator in project gravitee-management-rest-api by gravitee-io.

the class APIV1toAPIV2Converter method createFlow.

@NotNull
private Flow createFlow(String path, Set<HttpMethod> methods) {
    // If contains all methods of HttpMethod enum or all methods without OTHER
    Set<HttpMethod> flowMethods = methods.containsAll(HTTP_METHODS) ? Collections.emptySet() : methods;
    final Flow flow = new Flow();
    flow.setName("");
    flow.setCondition("");
    flow.setEnabled(true);
    final PathOperator pathOperator = new PathOperator();
    pathOperator.setPath(path);
    pathOperator.setOperator(Operator.STARTS_WITH);
    flow.setPathOperator(pathOperator);
    flow.setMethods(flowMethods);
    return flow;
}
Also used : PathOperator(io.gravitee.definition.model.flow.PathOperator) HttpMethod(io.gravitee.common.http.HttpMethod) Flow(io.gravitee.definition.model.flow.Flow) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PathOperator

use of io.gravitee.definition.model.flow.PathOperator in project gravitee-management-rest-api by gravitee-io.

the class OAIToAPIV2Converter method createFlow.

private Flow createFlow(String path, Set<HttpMethod> methods) {
    final Flow flow = new Flow();
    flow.setName("");
    flow.setCondition("");
    flow.setEnabled(true);
    final PathOperator pathOperator = new PathOperator();
    pathOperator.setPath(path);
    pathOperator.setOperator(Operator.EQUALS);
    flow.setPathOperator(pathOperator);
    flow.setMethods(methods);
    return flow;
}
Also used : PathOperator(io.gravitee.definition.model.flow.PathOperator) Flow(io.gravitee.definition.model.flow.Flow)

Aggregations

Flow (io.gravitee.definition.model.flow.Flow)2 PathOperator (io.gravitee.definition.model.flow.PathOperator)2 HttpMethod (io.gravitee.common.http.HttpMethod)1 NotNull (org.jetbrains.annotations.NotNull)1