@Override
  public ServiceComponentHostResponse convertToResponse(Map<String, DesiredConfig> desiredConfigs) {
    HostComponentStateEntity hostComponentStateEntity = getStateEntity();
    HostEntity hostEntity = hostComponentStateEntity.getHostEntity();

    HostComponentDesiredStateEntity hostComponentDesiredStateEntity = getDesiredStateEntity();

    String clusterName = serviceComponent.getClusterName();
    String serviceName = serviceComponent.getServiceName();
    String serviceComponentName = serviceComponent.getName();
    String hostName = getHostName();
    String publicHostName = hostEntity.getPublicHostName();
    String state = getState().toString();
    String desiredState = (hostComponentDesiredStateEntity == null) ? null : hostComponentDesiredStateEntity.getDesiredState().toString();
    String desiredStackId = serviceComponent.getDesiredStackId().getStackId();
    HostComponentAdminState componentAdminState = getComponentAdminStateFromDesiredStateEntity(hostComponentDesiredStateEntity);
    UpgradeState upgradeState = hostComponentStateEntity.getUpgradeState();

    String displayName = null;
    try {
      StackId stackVersion = serviceComponent.getDesiredStackId();
      ComponentInfo compInfo = ambariMetaInfo.getComponent(stackVersion.getStackName(),
              stackVersion.getStackVersion(), serviceName, serviceComponentName);
      displayName = compInfo.getDisplayName();
    } catch (AmbariException e) {
      displayName = serviceComponentName;
    }

    String desiredRepositoryVersion = null;
    RepositoryVersionEntity repositoryVersion = serviceComponent.getDesiredRepositoryVersion();
    if (null != repositoryVersion) {
      desiredRepositoryVersion = repositoryVersion.getVersion();
    }

    ServiceComponentHostResponse r = new ServiceComponentHostResponse(clusterName, serviceName,
        serviceComponentName, displayName, hostName, publicHostName, state, getVersion(),
        desiredState, desiredStackId, desiredRepositoryVersion, componentAdminState);

    r.setActualConfigs(actualConfigs);
    r.setUpgradeState(upgradeState);

    try {
      r.setStaleConfig(helper.isStaleConfigs(this, desiredConfigs, hostComponentDesiredStateEntity));
    } catch (Exception e) {
      LOG.error("Could not determine stale config", e);
    }

    try {
      Cluster cluster = clusters.getCluster(clusterName);
      ServiceComponent serviceComponent = cluster.getService(serviceName).getServiceComponent(serviceComponentName);
      ServiceComponentHost sch = serviceComponent.getServiceComponentHost(hostName);
      String refreshConfigsCommand = helper.getRefreshConfigsCommand(cluster,sch);
      r.setReloadConfig(refreshConfigsCommand != null);
    } catch (Exception e) {
      LOG.error("Could not determine reload config flag", e);
    }

    return r;
  }
@param lastOpLastUpdateTime the lastOpLastUpdateTime to set
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java