private WidgetEntity addIfNotExistsWidgetEntity(WidgetLayoutInfo layoutInfo, ClusterEntity clusterEntity,
                                          String user, long createTime) {
    List<WidgetEntity> createdEntities =
      widgetDAO.findByName(clusterEntity.getClusterId(), layoutInfo.getWidgetName(),
        user, layoutInfo.getDefaultSectionName());

    if (createdEntities == null || createdEntities.isEmpty()) {
      WidgetEntity widgetEntity = new WidgetEntity();
      widgetEntity.setClusterId(clusterEntity.getClusterId());
      widgetEntity.setClusterEntity(clusterEntity);
      widgetEntity.setScope(WidgetResourceProvider.SCOPE.CLUSTER.name());
      widgetEntity.setWidgetName(layoutInfo.getWidgetName());
      widgetEntity.setDefaultSectionName(layoutInfo.getDefaultSectionName());
      widgetEntity.setAuthor(user);
      widgetEntity.setDescription(layoutInfo.getDescription());
      widgetEntity.setTimeCreated(createTime);
      widgetEntity.setWidgetType(layoutInfo.getType());
      widgetEntity.setMetrics(gson.toJson(layoutInfo.getMetricsInfo()));
      widgetEntity.setProperties(gson.toJson(layoutInfo.getProperties()));
      widgetEntity.setWidgetValues(gson.toJson(layoutInfo.getValues()));
      widgetEntity.setListWidgetLayoutUserWidgetEntity(new LinkedList<>());
      LOG.info("Creating cluster widget with: name = " +
        layoutInfo.getWidgetName() + ", type = " + layoutInfo.getType() + ", " +
        "cluster = " + clusterEntity.getClusterName());
      // Persisting not visible widgets
      // visible one will be cascaded on creation of layout
      if (!layoutInfo.isVisible()) {
        widgetDAO.create(widgetEntity);
      }
      return widgetEntity;
    } else {
      LOG.warn("Skip creating widget from stack artifact since one or more " +
        "already exits with name = " + layoutInfo.getWidgetName() + ", " +
          "clusterId = " + clusterEntity.getClusterId() + ", user = " + user);
    }
    return null;
  }
Verifies single repository, see {{@link #verifyRepositories(Set)}.

@param request request
@throws AmbariException if verification fails
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java