Optimal Algorithms for Online b-Matching with Variable Vertex Capacities