GetLegendGraphic requests can only be done on layers that have an index color model.
We need to know if a layer can be requested with the GetLegendGraphic request. A method canObtainLegendGraphic() should be added, it can tests whether there is a color map defined for the layers or not, and just return the result.
The service WMS will just test the given layer against that method. If the layer can't be requested by that request, an exception should be returned to inform that the layer is invalid for that request.