class AutonomicClusterManagementService {

    public boolean canProcessCluster(long clusterId, ClusterAdministrationHeuristicAlgorithm algorithm) {
        Date lastAdministration = clusterDaoJdbc.getClusterLastAdminstration(clusterId);
        if (lastAdministration == null) {
            return true;
        }
        Calendar lastAdministrationCalendar = Calendar.getInstance();
        lastAdministrationCalendar.setTime(lastAdministration);
        lastAdministrationCalendar.add(Calendar.SECOND, algorithm.getClusterIntervalBetweenConsolidation());
        Calendar calendarNow = Calendar.getInstance();
        return lastAdministrationCalendar.before(calendarNow);
    }

}