class FeedEntityParser extends EntityParser<Feed> {

    @Override
    public void validate(Feed feed) throws IvoryException {
        if(feed.getTimezone() == null)
            feed.setTimezone(TimeZone.getTimeZone("UTC"));
        
        if (feed.getClusters() == null)
            throw new ValidationException("Feed should have atleast one cluster");

        for (Cluster cluster : feed.getClusters().getClusters()) {
            validateEntityExists(EntityType.CLUSTER, cluster.getName());
            validateClusterValidity(cluster.getValidity().getStart(), cluster.getValidity().getEnd(), cluster.getName());
            validateFeedCutOffPeriod(feed, cluster);
        }

        validateFeedPartitionExpression(feed);
        validateFeedGroups(feed);

        // Seems like a good enough entity object for a new one
        // But is this an update ?

        Feed oldFeed = ConfigurationStore.get().get(EntityType.FEED, feed.getName());
        if (oldFeed == null)
            return; // Not an update case

        // Is actually an update. Need to iterate over all the processes
        // depending on this feed and see if they are valid with the new
        // feed reference
        EntityGraph graph = EntityGraph.get();
        Set<Entity> referenced = graph.getDependents(oldFeed);
        Set<Process> processes = findProcesses(referenced);
        if (processes.isEmpty())
            return;

        ensureValidityFor(feed, processes);
    }

    public  FeedEntityParser();

}