use of org.apache.syncope.common.rest.api.service.AnyTypeService in project syncope by apache.
the class SchemaRestClient method getSchemas.
public <T extends SchemaTO> List<T> getSchemas(final SchemaType schemaType, final AnyTypeKind kind) {
final AnyTypeService client = getService(AnyTypeService.class);
final List<String> classes = new ArrayList<>();
switch(kind) {
case USER:
case GROUP:
final AnyTypeTO type = client.read(kind.name());
if (type != null) {
classes.addAll(type.getClasses());
}
break;
default:
new AnyTypeRestClient().listAnyTypes().stream().filter(anyTypeTO -> (anyTypeTO.getKind() != AnyTypeKind.USER && anyTypeTO.getKind() != AnyTypeKind.GROUP)).forEach((anyTypeTO) -> {
classes.addAll(anyTypeTO.getClasses());
});
}
return getSchemas(schemaType, null, classes.toArray(new String[] {}));
}
Aggregations