private Resource toResource(AlertNoticeEntity entity,
      Set<String> requestedIds) {
    AlertHistoryEntity history = entity.getAlertHistory();
    AlertTargetEntity target = entity.getAlertTarget();
    AlertDefinitionEntity definition = history.getAlertDefinition();
    ClusterEntity cluster = definition.getCluster();

    Resource resource = new ResourceImpl(Resource.Type.AlertNotice);
    resource.setProperty(ALERT_NOTICE_ID, entity.getNotificationId());

    setResourceProperty(resource, ALERT_NOTICE_STATE, entity.getNotifyState(),
        requestedIds);

    setResourceProperty(resource, ALERT_NOTICE_UUID, entity.getUuid(),
        requestedIds);

    setResourceProperty(resource, ALERT_NOTICE_SERVICE_NAME,
        definition.getServiceName(), requestedIds);

    setResourceProperty(resource, ALERT_NOTICE_TARGET_ID, target.getTargetId(),
        requestedIds);

    setResourceProperty(resource, ALERT_NOTICE_TARGET_NAME,
        target.getTargetName(), requestedIds);

    setResourceProperty(resource, ALERT_NOTICE_HISTORY_ID,
        history.getAlertId(), requestedIds);

    if (null != cluster) {
      setResourceProperty(resource, ALERT_NOTICE_CLUSTER_NAME,
          cluster.getClusterName(), requestedIds);
    }

    return resource;
  }
Converts the {@link AlertNoticeEntity} to a {@link Resource}.

@param entity
         the entity to convert (not {@code null}).
@param requestedIds
         the properties requested (not {@code null}).
@return the new {@link Resource}
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java