@Override
  public void updateProperties(Resource resource, Request request, Predicate predicate) {
    Set<String> propertyIds = getRequestPropertyIds(request, predicate);
    if (contains(propertyIds, HOST_COMPONENT_STATE_PROPERTY_ID) ||
        contains(propertyIds, HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID)) {
      String componentName = (String) resource.getPropertyValue(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID);
      String hostName      = (String) resource.getPropertyValue(HOST_COMPONENT_HOST_NAME_PROPERTY_ID);

      String hostComponentState = getClusterDefinition().getHostComponentState(hostName, componentName);

      resource.setProperty(HOST_COMPONENT_STATE_PROPERTY_ID, hostComponentState);
      resource.setProperty(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, hostComponentState);
    }
  }
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/HostComponentProvider.java