1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.sra.predicates;
20
21 import java.util.function.Predicate;
22 import org.springframework.cloud.gateway.handler.AsyncPredicate;
23 import org.springframework.cloud.gateway.handler.predicate.AbstractRoutePredicateFactory;
24 import org.springframework.web.server.ServerWebExchange;
25
26
27
28
29 public abstract class CustomRoutePredicateFactory
30 extends AbstractRoutePredicateFactory<CustomRoutePredicateFactory.Config> {
31
32 public static class Config {
33
34 private String data;
35
36 public String getData() {
37 return data;
38 }
39
40 public void setData(final String data) {
41 this.data = data;
42 }
43 }
44
45 public CustomRoutePredicateFactory() {
46 super(CustomRoutePredicateFactory.Config.class);
47 }
48
49 @Override
50 public abstract AsyncPredicate<ServerWebExchange> applyAsync(Config config);
51
52 @Override
53 public Predicate<ServerWebExchange> apply(final Config config) {
54 throw new UnsupportedOperationException(getClass().getName() + " is only async.");
55 }
56 }