@Override
public Collection<NodeType> nodeTypes() throws RepositoryException {
Map<String, NodeType> nodeTypes = this.nodeTypes.get();
if (nodeTypes == null) {
NodeTypes restNodeTypes = this.restClient.getNodeTypes();
if (restNodeTypes.isEmpty()) {
throw new RepositoryException(JdbcLocalI18n.noNodeTypesReturned.text(restClient.serverUrl()));
}
nodeTypes = new HashMap<>();
for (org.modeshape.jdbc.rest.NodeType nodeType : restNodeTypes) {
nodeTypes.put(nodeType.getName(), nodeType);