@Override
  public int updateProperties(Resource resource, Map<String, Object> properties) {
    int requestId = -1;
    if (properties.containsKey(COMPONENT_STATE_PROPERTY_ID)) {
      String state         = (String) properties.get(COMPONENT_STATE_PROPERTY_ID);
      String serviceName   = (String) resource.getPropertyValue(COMPONENT_SERVICE_NAME_PROPERTY_ID);
      String componentName = (String) resource.getPropertyValue(COMPONENT_COMPONENT_NAME_PROPERTY_ID);

      requestId = getClusterDefinition().setComponentState(serviceName, componentName, state);
    }
    return requestId;
  }
Construct a resource provider based on the given cluster definition.

@param clusterDefinition  the cluster definition
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/ComponentProvider.java