public void visit(StyleInfo style) {
Filter anyStyle = Predicates.equal("styles.id", style.getId(), MatchAction.ANY);
Filter layersAssociated =
Predicates.or(Predicates.equal("defaultStyle.id", style.getId()), anyStyle);
try (CloseableIterator<LayerInfo> it = catalog.list(LayerInfo.class, layersAssociated)) {
while (it.hasNext()) {
LayerInfo layer = it.next();
removeStyleInLayer(layer, style);
}
}
Filter groupAssociated =
Predicates.or(Predicates.equal("rootLayerStyle.id", style.getId()), anyStyle);
try (CloseableIterator<LayerGroupInfo> it =
catalog.list(LayerGroupInfo.class, groupAssociated)) {
while (it.hasNext()) {
LayerGroupInfo group = it.next();
removeStyleInLayerGroup(group, style);
}
}
catalog.remove(style);
}